Create special WordPress slideshow with "jquery.cycle.all.js"

i want to create my own slideshow without using any slider plugins hear is my code -- in the footer ---                                 in my front-page.php

the title 1
                 <img src="<?php bloginfo( 'template_url' );?>/slideimage/myimage1.jpg">

the title 2
                 <img src="<?php bloginfo( 'template_url' );?>/slideimage/myimage2.jpg">

      -- in css file ----               #slideshow {         width: 232px;         height: 232px;     }     #navSlider {         z-index: 50;         position:absolute;         width:19px;         top:0;         right:-5px;     }     #navSlider a {         display:block;         height:31px;         margin: 0 0px;         padding: 3px 6px;         border: 1px solid #ccc;         background: #cff;         text-decoration: none     }     #navSlider a.activeSlide {         background: #aaf;         padding:9px 0 0 0;         text-align:center;     }     #navSlider a:focus {         outline: none;     }     #textBack {         background-color:#000;         /*color:#FFF;*/         opacity: 0.4;         height:30px;         position:absolute;         right:0;         bottom:0;         width:232px;         /*text-align:center;*/     }     #textSlide {         color:#fff;         height:26px;         position:absolute;         bottom:0;         right:10px;         font-size:18px;         /* margin:auto;*/         /* width:232px;*/         /* text-align:center;*/     }     .pics {         height: 232px;         width: 232px;         padding: 0;         margin: 0;     }     .pics img {         padding: 15px;         border: 1px solid #ccc;         background-color: #eee;         width: 200px;         height: 200px;         top: 0;         left: 0     }     .slideContent {         margin: 30px auto;         width: 244px;         height: 234px;         position:relative;         top: 0;         left: 0;         background-color:#069;     }      i create this and actually it works alone very nice but i don't know why it won't work in wordpress and is there any matter if there is another slider? please help


struggling with syntax for the_post_thumbnail();

i want to display the alt text for a featured image. I've been using the the_post_thumbnail(); function to display the image like this:               if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.         the_post_thumbnail('medium');     }       Question: How do I display the Alt attribute for this image?


wordpress help needed. How to display both home.php and index.php?

Hey guys i recently created a theme. I want to show home.php when a visitor visit home page but all my blog posts are listed in index.php file. Can someone suggest me how to display index.php i tried http://www.mysiteurl.com/index.php but it redirecting me to http://www.mysiteurl.com/home.php Please advise me. Thanks


How to grab facebook page feed?

Hey all, i'm using the plugin wp-Lifestream in its 0.99.9.6 version (the 0.99.9.8-BETAdoesnt work for me) and i was wondering if it was possible to associate a fb page feed rather than a profile feed. So far i didnt find any answer to that. Thanks in advance.


Sort By Custom Field - Strange Problem

I have a site where I'm posting some of the post at Features with a meta key name "Listing Type" and meta value "Featured". Now the problem is when I use: `query_posts($query_string . '&meta_key=listing_type&orderby=Featured');` ...only the Featured post showing. All I just want to show is the featured posts and then the rest of the post by the date order with the pagination too..


Suggestions for Dressing up blog for the holidays

I was wondering what you guys are doing to dress up your blogs ? any plugins that add some cool effects like snow flakes, maybe greeting popup, footer, music, header rotation, list of new years resolution, wishlist widget display .... I was wondering what you doing to dress up your blog around holidays, maybe we can compile a nice list together - but god forbid - do them all together in one blog :P thanks for suggestions.


term_description help

i have a piece of code which is helped to display the description of custom taxonomies but i want to put `<h1>` tag for the title of description, but that description box doesn't takes html tags, so how can i implement html tags to my description here is my code

<?php                  if ( is_tax( 'location' ) ) {                     echo term_description();                 }                 elseif (is_tax('mba_courses')){                     echo term_description();                 }                 elseif (is_tax('duration')){                     echo term_description();                 }                 ?>


Prevent access or auto-delete readme.html, license.txt, wp-config-sample.php

Just a quick question that might help a tad bit with security. I noticed that the readme.html file has the version number listed. It reappears after each upgrade and so do the licence.txt, and wp-config-sample.php. Is there a easy way to have WordPress auto remove these files after an upgrade? I already block the version number from showing in the meta tags, rss feeds, atom, etc. I know this type of security isn't exactly _that_ much helpful, but just thought it might be a tiny start. I heard that people can simply check the version of jQuery that is included in WP-includes and cross reference which version of WP shipped it.


CSS for Created Menu "Active Selected" not working, everything else is!

I have created a Menu (for the nav bar) it is placed in a copy of the header.php file in my child theme right below:                <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>      It works fine EXCEPT the CSS for the Active Selected menu item is not working for everything but "Home". This changes the background for "Home" when selected but none of the other top menu items.               #access ul li.current_page_item > a, #access ul li.current-menu-ancestor > a, #access    ul li.current-menu-item > a, #access li.selected > a, #access ul li.current-menu-parent > a, #access ul li.current_page_item, #access ul li.current-menu-item, #access li.selected {     background-color: #1E0D51 !important;     }      All the CSS does show up for Hover. I have spent hours on this and can not figure out what the problem is. Any insights or ideas are gratefully appreciated. Thanks Tim Place in header.php after `<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary','container' => '' ) ); ?>`
                  <?php if ( is_user_logged_in() ) { ?>
 <a href="<?php echo                                               bp_loggedin_user_domain() ?>activity/just-me/">My Wall

 <a href="<?php echo bp_loggedin_user_domain() ?       >activity/friends/">My Friends' Activities

 <a href="<?php echo bp_loggedin_user_domain() ?    >profile/edit/group/1">Edit My Profile

 All Members

 All Groups

 <a href="<?php echo bp_loggedin_user_domain() ?>groups/">My Groups

 All Events

 Calendar View

 <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">My Events

 <a href="<?php echo bp_loggedin_user_domain() ?>events/my-events/">Create an Event

          <?php ;} ?>


Create XML files on post edit screen

Ok, that's a weird question, I know.. I'm so confortable with WP that I don't want to use any other application to generate XML (KML - _Editors note: These are Google Earth files._ ) files. I want to use a custom post type with nothing else just a bunch of custom fields and meta boxes. I have the XML schema (a custom single.php) set up: certain custom field values goes in between the right XML tags and in theory I have an XML that I'm able to create, modify and delete with WP. The problem is that it is still a php/html file and not an xml, and the browser uses it as a html/php file and tries to interpret it as html even though xml is declared at the top. Is there a libary or a way to grab the html output of these files and somehow convert it to XML? Thanks. **UPDATE 1:** That's how I get a placemark's name (it gives you the name) but without the tags:               <?php if(get_field('marker_style')): ?>         <?php while(the_repeater_field('marker_style')): ?>             <?php echo '<name>' the_sub_field('marker_style_id') '</name>' ;?>         <?php endwhile; ?>     <?php endif; ?>      **Update 2** : With the help a tutorial I came up with this code: http://pastebin.com/zGJHm19t But it's not working. It looks that I can't store my field values in variables and use them on the page in this context. You may think it's because of the plugin I use for custom fields, but that's not the case: if I put a simple `$title = the_title()` and then I try to echo the `$title` I get nothing. On line 39-42 the original tutorial gave the values themselves and the XML got populated with them beautifully. The logic here is that I store the values in variables and use the vars here, but as I mentioned, for some reason I don't see right now, the variables are empty.


odd behaviours from template tags

Some of my template tags are playing up, and they have left me confused. On one site, that has been live for over a year without any of these issues, on all the pages that have custom query loops, `the_content()` was repeating the first entry. I replaced that line with `echo get_the_cotent($post->ID)`, which I thought was totally equivalent, and it solved the problem. Now, I have a very similar issue with another site. Trying to fetch and display content from child pages, I have this code block:               global $post;     $my_wp_query = new WP_Query();     $all_wp_pages = $my_wp_query->query(array('post_type' => 'page'));     $children = get_page_children($post->ID,$all_wp_pages);     foreach($children as $child){              ?>

<?php the_title($child->ID); ?>

           <?php     }      but this just repeats the title of the parent page. However, if I replace `the_title` with `echo get_the_title(` is works as expected. I am only _assuming_ these are comparable issues, the certainly have similar symptoms and solutions.


Why is my comment feed broken?

Here is my site. According to the WordPress codex, my comments feed should be http://oldmankit.com/comments/feed/. Indeed, every post has that link in its header. However, it's broken. If you click on that link, you'll see that loading it returns a completely blank page. My first question is, can anyone help me work out why it's broken? Second, is there a good reason to keep the comments feed? Obviously the posts feed is important for a blog, but a _comments_ feed?


Out of Memory when Uploading an Image

Sometimes when I upload a picture (either with flash or browser uploader), I get a message like (this was with a 1.46MB jpg):               Fatal error: Out of memory (allocated 69206016) (tried to allocate 4000 bytes) in /home/ab64489/public_html/wp-includes/media.php on line 254      I am on a shared host, but the max upload size is 64MB. I've tried uploading other files (I made a zip of some random files, with the archive totaling ~58.1MB, and it uploads and crunches with no problem, so it's not the file size). It also seems that the upload works fine, but when it tries to crunch, then it encounters the error. I've seen similar problems here and on other sites with no real solutions. What could be the cause of this issue?


Javascript 2 elements dependent onclick .toggle

Hi I have two JavaScript elements for logging into and create an account. They both overlap each-other when the div id is clicked and I need them to hide when the other id is clicked and vice versa.               <script type="text/javascript">     jQuery(document).ready(function(){         jQuery('#sign-in').live('click', function(event) {                      jQuery('#login-content').toggle();         });     });     jQuery(document).ready(function(){         jQuery('#create-account').live('click', function(event) {                      jQuery('#create-content').toggle();         });     });     </script>


Query specific posts per user selections from dropdown menus

This may be a little different than most people do. I'm trying to show certain posts that are determined by 4 different "categories." I have a large database table full of "products" (I'm using the WP Products plugin, but I'm willing to change plugins). When a person comes to the site, they'll have 4 drop down menus to chose a specific category in each menu, and then query the results determined by those 4 categories. I've been looking into `query_posts` or `$wpdb` to implement this. What is the best route to take in this situation?


How to rotate the header image per day?

I'd like to have my header banner change every day, chosen (e.g. randomly) from a list/folder of images. So far I only found plugins that select a random banner per post or per page view, neither is what I want. Do you know of a plugin, or any other way? Edit: Example. I'm adding a folder to my wordpress installation. This folder contains some header images. Every 24 hours, an random image is chosen from this folder and becomes the header image for 24 hours, until another random image is chosen. Actually, I don't care how exactly the image is chosen - I'm fine with rotating through all images in the folder as well. The only thing I care about is that the chosen image stays there for 24 hours. Basically it's the same as if I were picking a new header image manually every day.


Show individual author rank from query of cumulative post view count for all authors

I originally was going to post a question on how I would go about ranking a list of authors by the amount of post views from all of their posts combined. But I luckily found a solution here: List users with the most total posts view This is the code I'm using from that page, except I tweaked it a little to fetch post views from a plugin I use:               <?php global $wpdb;     $topuser = array();          // query all posts by each user     $users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");      foreach ( $users as $user ) {                $query = get_posts( array('author' => $user->ID,  'posts_per_page' => '10000000000'));         $counter = 0;              // get each post of a user         foreach ( $query as $post ){             $views = absint( get_post_views('normal') );             $counter += $views;         }         $topuser[] = array( 'id' => $user->ID, 'views' => $counter);         wp_reset_query();     }          // function to sort array based on views count     function sortViews($a, $b) {         return $b['views'] - $a['views'];     }     usort($topuser, 'sortViews'); // sort the array     $output = array_slice($topuser, 0, 10); // slice the array by limit 3          // output the result: user, total postview count, latest post     foreach ($output as $user){         $profile = get_userdata($user['id']);         $query = get_posts( array('author' => $user['id'], 'numberposts' => 1 ));              echo '
' . $profile->user_nicename .' ('. $user['views'] .')
';                     foreach ( $query as $post ){             echo 'post_name . '">' . $post->post_title . '';             echo get_post_meta($post->ID, get_post_views('normal'), true);         }     } ?>      Now I would like to take this solution a step further towards my vision when first coming up with the idea. I want to show the specific rank (position in the list) of each user on their buddypress profile page. I would paste this code in member-header.php Example: It would say something like "User Rank: 15", meaning that this user shows up as the 15th result when executing the above query (of course I would change the number from 10 to more which is why that would be possible). Hope you guys can help out. Thanks in advance :)


Whenever I got to my new pages (http://www.cwmags.com/news) it requests login?

I have two news pages on different domain names (different content) using the same template. http://www.cwmags.co.uk/news and http://www.cwmags.com. I have check .htaccess (301 redirects), CHMOD permissions and on both sites they are identical (apart from difference in domain name). Authentication Required Log In required. Clicking cancel is sufficient to access the web pages. Any suggestions on where to look?


How to respond with WP_Ajax_Response();

I'm using WP_Ajax_Response(); to respond to some ajax and output it to a div, everything works great. But how exactly do I respond if I want to output some php in to a div? A wordpress loop for example. I assume can't just do `$response = include 'loopHandle.php';` and then `$("body.blog #content").html(this.data);` I've seen some methods that make a call directly to your file and then use wp_load(); but I've heard that's something we should stay away from. I also know that an AJAX response must be in JSON or XML, so how do I get php into my div? **Example** On this click event:               $link_url = esc_url(wp_nonce_url( admin_url('admin-ajax.php?&action=dynamic_date&my_date='.$date), "dynamic_date_nonce")); ?>
<a href='<?php echo $link_url; ?>' id='sort-month'>     <?php _e($fmonth,'sort-month'); ?>
      I send over my action, nonce and date key-pairs. I then capture those key- pairs using something like:               var s = {};     s.response = 'ajax-response';     s.type = "GET";     s.url = sortbydate.ajax_url;     s.data = $.extend(s.data, { action: url.action, _ajax_nonce: url._wpnonce, my_date: url.my_date });     s.global = false;     s.timeout = 30000;     s.success = function(r) {     res = wpAjax.parseAjaxResponse(r,this.response);     $.each( res.responses, function() {     switch(this.what) {     case "fulldate":     $("body.blog #content").html(this.data);      The important variable here is the my_date key-pair. The action then kicks off this function in my functions.php.               function dynamic_date() {     check_ajax_referer('dynamic_date_nonce');     $fdate = $_GET['my_date'];     $response = new WP_Ajax_Response();     $response->add(array(     'what' => 'fulldate',     'data' => $fdate)); //get and send the data you want to front end.     $response->send();     } //end action jackson      Which outputs "2012-9" or whatever date I click on. That's great, works fine for test purposes, but now I want to use that date by exploding it into an an array and use those variables in a wordpress loop. Currently I have the loop in a file called loopHandle.php, but it's not making use of the date variables as if my understanding is correct I can't access them from loopHandle.php? If I could, then I'd just use `$fdate = $_GET['my_date'];` in loopHandle.php and finish my loop. I'm still left with the conundrum of loading loopHandle.php into my div though. The one method I assume is the way to go about it is to form the loop in my functions.php, somehow convert it into JSON or XML and out put it on my page.


Get price and title from Simple Shopping Cart Plugin

**Plugin:**   WordPress Simple Paypal Shopping Cart **Implementation Used:**   HTML in theme page template (page.php) Example: echo print_wp_cart_button_for_product('Product Name',Price); So if I wanted to sell a blue widget for $9.99 the code would be:               echo print_wp_cart_button_for_product('Blue Widget',9.99);      **Problem:**   When using the code above the plugin works fine... however, when I try to populate the product name and price it does not work. I am using the WP custom field for the price as such:               $price=get_post_meta($post->ID, 'Price', true);      Then I populate the shopping cart code as such:               echo print_wp_cart_button_for_product('the_title()',$price);      When products are added to the cart it shows the product name as "the_title()" and the price as "$0.00" The title and price display anywhere on the page I place them accept for in the cart code for some reason.


Load plugin selectively for pages or posts, etc

It's possible select which plugin load by page or post, because i have 35 plugins and many of these no necessary in many pages or posts and only for some pages, how can do this? I've tested beta plugin for this but it doesn't work right and I want to know if exists code in wordpress to deactivate plugin in some pages or posts that I can use to create my plugin.


How to sanitize user input?

What is the correct way sanitizing form data before submitting to the database? I have the following text input:               <form method="post" action="options.php">         <?php wp_nonce_field('update-options'); ?>          <input style="width:100%" type="text" name="data[title]" id="title" value="<?php $title = get_option('data_test'); echo $title['title']; ?>" /></p>              <input type="hidden" name="action" value="update"/>         <input type="hidden" name="page_options" value="lu_ban_data"/>         <input style="float:left;margin-top: 10px; margin-bottom: 10px; vertical-align: middle; clear: both;" class="button-primary" type="submit" value="<?php _e('save changes') ?>" />     </form>      I tried doing `echo sanitize_text_field($title['title']);`, but it only sanitizes the data upon requesting it from the db, the data inside the db still contains unwanted characters. This is why I want to sanitize before submitting it.


Grouping of CPTs and taxonomies into menu groups in admin

I have a group of custom post types such as "CPT A", "CPT B" and "CPT C". I display the admin page for each of these as subpages under a common Admin page.               add_menu_page('Console',         'Console',         'plugin_console',         'plugin',         array ( $this, 'page_main' ),         "http://example.com/favicon.ico",         6         );      There are also custom taxonomies for the CPTs, and some of them are shared. What I'm to do is, in the admin pane add submenu page off the main one that links to the taxonomies in edit-tags.php.               add_submenu_page('plugin',         'Taxonomy',         'Taxonomy',         'manage_options',         'plugin-taxonomy',         array( $this, 'page_taxonomy' )         );      The problem I encounter is that the list table doesn't fill. Any suggestions on a good/better approach are most welcome. Just as a follow up, I want a menu that looks something like:               -Console     --CPT A     --CPT B     --CPT C     --Taxonomy 1     --Taxonomy 2


Variable not staying set

This is most likely just a PHP problem, and it's probably a pretty simple answer, but I just can't seem to get my brain to function this morning. This is what I'm trying to do:                $job_file = $cfs->get('job_file'); // job_file is a URL           if ($job_file = NULL) {          echo "NOT AVAILABLE";      } else {          echo '' . get_the_title() . '';      }      It will display the URL of the current page instead of the `$job_file` variable. What am I missing?


Admin bad not appearing in front end and cant get it back

I tried everything i found on the net: checking whether wr_header and wp_footer exist in my template (they do), checking my css (no rule is blocking it), checking whether the option is activated on my profile (it is), etc. but whatever i do i cant get it back. There is only a blank space up there. Is there any effective way to find out what is causing this? Its driving me crazy. Thanks.


cannot grab post meta from extended Walker_Category class properly

Trying to show some custom post meta inside an extended Walker_Category class. I am very inexperienced with Object Oriented Design so this issue is quite difficult for me to solve I am essentially trying to check the boxes of the categories that the user has already entered if they happen to edit a post with saved data here is the code so far in the extended class:                   <?php         class MyCategoryWalker extends Walker_Category{                   public $post_cb;                   //pass through the saved checkbox choices         function __construct($custom_meta){             $this->post_cb = $custom_meta;         }                   //get the array of checkbox choices and convert it into a simple string format          function get_cat_rp_list(){                  $the_cat_list;             foreach($this->post_cb as $cat_list){                 $the_cat_list .= $cat_list.', ';             }             $the_cat_list = rtrim($the_cat_list, ',');                  return $the_cat_list;              }                   //actually builds the checkbox list         public function start_el(&$output, $term, $depth, $args){              echo self::get_cat_rp_list();              $args = wp_parse_args(array(           'name'    => 'my_category_input',           'checked' => array(self::get_cat_rp_list()), //will input the string of checkboxes saved                ), $args);              extract($args);              $checked = checked(in_array($term->term_id, $checked));              ob_start(); ?>                 <li>           <input type="checkbox" <?php print $checked; ?> id="category-<?php print $term->term_id; ?>" name="<?php print $name; ?>[]" value="<?php print $term->term_id; ?>" />           <label for="category-<?php print $term->term_id; ?>">             <?php print esc_attr($term->name); ?>           </label>                     <?php // closing LI is added inside end_el              $output .= ob_get_clean();       }     }      so that was in my class, For testing purposes I have added the "`echo self::get_cat_rp_list();`" in the `start_el()` method. On the particular post I have, there are only two categories stored in the post. However it echos out the two categories about 30 times (the same amount of total categories I have on this site actually) here is my code to show the check list on the post:               $custom_meta = get_post_meta($post->ID, '_custom-meta-box', true);          $newWalker = new MyCategoryWalker();          wp_list_categories(array(       'walker'   => $newWalker,       'name'     => 'my_category_input',       // name of the input     ));      here is the code that saves/updates the checbox selection (which DOES work):               function save_pref_meta_box()     {         global $post;         // Get our form field         if(isset( $_POST['my_category_input'] ))         {             $custom = $_POST['my_category_input'];             $old_meta = get_post_meta($post->ID, '_custom-meta-box', true);             // Update post meta             if(!empty($old_meta)){                 update_post_meta($post->ID, '_custom-meta-box', $custom);             } else {                 add_post_meta($post->ID, '_custom-meta-box', $custom, true);             }         }     }


media_sideload_image returning File is empty

I've tried everything I could find on the internet, but my media_sideload_image is still only giving the error `File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.` I've checked my PHP.ini file and file uploads is on. It gives this error on every image url I give it. I'm programming on localhost using xampp. The code :               function check_images($content, $post_id){             if(!empty($content))             {                 $doc = new DOMDocument();                 $doc->loadHTML($content);                 $tags = $doc->getElementsByTagName("img");                 if( $tags->length > 0 )                 {                     foreach( $tags as $tag )                     {                         require_once(ABSPATH . 'wp-admin/includes/media.php');                         require_once(ABSPATH . 'wp-admin/includes/file.php');                         require_once(ABSPATH . 'wp-admin/includes/image.php');                         $val = $tag->getAttribute( 'src' );                         $url = $val;                         $upload = media_sideload_image(urldecode(rawurlencode($url)), $post_id);                         if(is_wp_error($upload)){                             echo $upload->get_error_message();                         }                      }                  }              }     }       I don't really know what to try next to get this problem solved, any help is appreciated! The purpose of this functions is to import all images from `<img>` tags inside a given string to the Wordpress Media Library. If you have any other way to do this, instead of using `media_sideload_image`, then feel free to share.


I want to edit the search function

I'm changing some parts of WordPress, like adding posts or comments, to use procedures in the database instead of using inline database calls to see if the performance enhances. I've been looking the search function now, but I can't find the code for it, the select string more importantly. Anyone who can help me locate where the code for the search function is (like searching for posts or comments not the archive)? Thanks in advance.


What is proper way to change or edit specific theme options?

I have installed WP property real home theme and now want to add some extra fields in it. My questions are   1. Is there any plugin which add some extra fields to this particular theme.   2. Do i have only chance to read more about documentation of this theme(I have already read that).   3. Do i need to do manually in code and database to achieve this. Please provide suggestions. Thank you. ![I want to add red fields in real home theme](http://i.stack.imgur.com/YJwzP.jpg)


Using jQuery DataTables and yadcf

I want to display a sortable/filterable table of data using the jQuery yadcf plugin, that runs with DataTables. First thing I did is the DataTables integration, that can be seen on this page This first step works fine, so I went on to the next step. I then set up another page with exactly the same HTML/PHP and Datatables code, but adding the enqueue of the yadcf script+css, I can see several issues:   * column 0: the search works only on the first line (the link) of each row, though with DataTables alone both lines are searched   * using the filter of any column displays the expected result, but the controls immediately disappear, so it is not possible to add another filter, or clear the existing one.   * same behaviour when one clicks on any "clear filter" button   * some filter types are not recognized: `range_number_slider` is not displayed properly and `select2` provokes an error as `select2` is not a defined function; but I've no idea how to integrate the missing functions.   * all the controls / messages and such remain in english, and I don't know how /where to translate them   * column 0 "autocomplete" results in an ugly display, as the helper message is inserted at the beginning of 1st row, propelling the following columns further on the right. Currently, my js file is the following:               jQuery(function() {         jQuery(document).ready(function() {             'use_strict';                  var oTable;                  oTable = jQuery('#hebergements').DataTable({                 "columns": [                     null,                     null,                     null,                     null,                     null,                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                     { "bFilter": false, "bSort": false},                 ],                 "language": {                     "processing": "Préparation des données ...",                     "lengthMenu": "_MENU_ hébergements par page",                     "zeroRecords": "Désolé, aucun hébergement avec ces critères",                     "info": "_PAGE_ / _PAGES_",                     "infoEmpty": "Aucun enregistrement disponible",                     "infoFiltered": "<span>- (filtre à partir de _MAX_ hébergements)</span>",                     "search": "recherche",                     "paginate": {                         "first":    "premier",                         "previous": "précédent",                         "next":     "suivant",                         "last":     "dernier"                     }                 },                 "sScrollX": "100%",                 "sScrollXInner": "200%",                 "bJQueryUI": true,                 "bstateSave": true             });                  yadcf.init(oTable, [                 { column_number: 0,                     column_data_type: "html",                     html_data_type: "text",                     filter_type: "auto_complete"                 },                 { column_number: 1,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 2,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 3,                      column_data_type: "html",                     html_data_type: "text"                 },                 { column_number: 4,                     filter_type: "range_number_slider"                 }             ]);              } );     });      As these scripts will be used in an only page of the site, the enqueues have been put in the functions file:               function specific_scripts() {         if ( !is_admin() )              if (is_page( array(932, 934 ) ) ) {                 wp_enqueue_script('datatable', get_template_directory_uri() . '/js/jquery.dataTables.js', array('jquery'));                 wp_enqueue_script('liste-hebergements', get_template_directory_uri() . '/js/liste-hebergements.js', array('jquery', 'datatable'));                 wp_enqueue_style('liste-hebergements-style', get_template_directory_uri() . '/css/jquery.dataTables.css');                 wp_enqueue_style('liste-hebergements-style2', get_template_directory_uri() . '/css/jquery.dataTables_themeroller.css');                      if (is_page(934)) {                     wp_enqueue_script('yadcf', get_template_directory_uri() . '/js/jquery.dataTables.yadcf.js', array('datatable', 'jquery', 'jquery-ui-autocomplete', 'jquery-ui-slider'));                     wp_enqueue_style('liste-hebergements-style3', get_template_directory_uri() . '/css/jquery.dataTables.yadcf.css');                 }             }         }     }     add_action( 'wp_print_scripts', 'specific_scripts');      At this stage, I'm stuck and don't know how to proceed further. Thanks for helping.


Filter index page plugin

I am looking for a wordpress plugin that allows my users to customize which posts are appearing on the home page. The users should have a settings page where they can select which categories and tags they´d like to see posts from. Do you know if anything like that has been developed? Free or premium.


How to use WP default post list tables in a plugin?

I'm developping a plugin to manage a base of users and I'd like to show them in the same type of table used in other parts of the WP admin (post lists, user lists, etc.), I'd like to have the same look and the if possible the column sorting too.


how to change user roles for users who doesn't have any. (about 8000 users)

We have about 8000 users who doesn't have any roles. we need to change them to "contributor". How can I change them to "contributor"? Should I do on database? if so, which fields I need to update? Thanks,


What are the recommended database permissions for WordPress?

I just got WP running on my own server. I am not trying to lock things down more. What permissions should the db user have to my WP db?


Looking for WordPress Slideshow Gallery Plugin

I'm looking to see if there is already a plugin that does a gallery slide show like Huffington Post does where it shows either one image or video then you click next to see the next one. There is no need for a rating system. I'm hoping there is so I don't have to figure out how to make one :) http://www.huffingtonpost.com/lee-brenner/viral-videos-2010_b_801501.html Other examples: http://bleacherreport.com/articles/437878-larissa-riquelme-and-the-25-hottest- superfan-photoshoots/page/1 http://www.businessinsider.com/super-bowl-commercials-super-bowl- xlv-2011-2#volkswagen--the-force-1 **FOUND A SOLUTION USING NEXTGEN:** Actually someone found this post and they found the solution :) http://gregrickaby.com/2010/07/add-an-anchor-to-nextgen- gallery-image-browser.html


How can I add function calls to my plugin's options.php default submit routine?

I'm combining two of my plugins into one. I'd like to make the activation routine of the second plugin a checkbox selection in the settings panel of the new plugin. However, I'm unsure how to execute functions when the options are submitted. How can I do this? The my-plugin-options.php is basically this...               <form method="post" action="options.php">     <?php wp_nonce_field('update-options'); ?>     //options form goes here     <input type="hidden" name="action" value="update" />     <input type="hidden" name="page_options" value="check1, check2, check3, etc" />     <p class="submit">     <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" />     </p>     </form>      And its called from my main plugin file with this...               function my_settings_admin() {     include_once dirname(__FILE__) . '/my-plugin-options.php';     }           add_options_page( 'My Plugin Settings',          'My Plugin Settings',          'manage_options',          'my-plugin-options.php',          'my_settings_admin',          $my_plugin_dir.'/favicon.png',          'top');


similar to Editor can create any new user except administrator

I have set up a wp multi-site with custom roles. One of the roles can add users. I need a solution to only show two roles available to the limited role on add user and leave all user types available to administrator. This code snipped works great for removing Administrator mode, but I don't understand enough of it to know if I could expand it to dis-clude other roles as well. Any help appreciated.


Woocommerce: Changing the variations select default value?

At my site i want to change the default value of the selecter that appears, when different variations exists. If anyone can give me a clue of how and where this is done, it would be highly appreciated!


Get a variable from object in array

I'm trying to `echo` `get_the_category($id)[0]->slug` and this works on localhost but not on the server. The error is > Parse error: syntax error, unexpected '['.... Is there a workaround?


How to create custom home page via plugin?

I want to code a plug-in that creates new custom home page. Note that I have never coded any plug-in before. 1) After activation of plug-in user needs to go to the options of the plug-in and set up that current home page will be replaced by the one that this plug- in generates ( I hope I can code this bit somehow in the future ) 2) **Plug-in generates custom home page that displays only**   * title and body of the latest post   * number of comments Could someone help me how to code the **2)** ? Currently I have one php file that is very simple plug-in. I can activate / deactivate it but I don't know how to code the home page. I'll be using WP 3.6


Change the contents of a dropdown through the admin panel?

I have a custom post type "Events". In Events, I have a custom field for "Place" which is a dropdown list. Is there a way to edit the contents of the dropdown list through the admin panel or is changing the code itself the only way?


WordPress Mulitisite - Unable to create directory

On one of my multisites I get the following error message when trying to upload any media: "Unable to create directory http://www.domain.com/wp- content/blogs.dir/18/files/2013/08. Is its parent directory writable by the server?" Firstly, the directory already exists as I see it when SSHing into the site. Secondly, I even recursively set the entire blogs.dir folders to 777. But I still get this error. This is the only site of 14 on my multisite install that gives me this error. Any ideas?


Some images not found 404 in localhost

I just transferred a WordPress installation from the domain to my localhost. I did all the usual steps: copy files, export DB and replace `domain.com` with `localhost`, update `wp-config.php` and refresh permalinks. All pages and custom rewrite rules work, but some images are giving a 404. When I check those images on the actual domain it all works fine, but something doesn't look right; if I check the url of the image it points to this path:               http://domain.com/wp-content/uploads/2013/08/IMG_0425-185x185.jpg      But this file doesn't exist! I looked in the uploads folder through FTP and the file isn't there, only `IMG_0425-185x185-150x150.jpg` exists. Note that `185x185` is part of the original filename but `150x150` is added by WP. In localhost the image doesn't show up (404), which makes sense. Why is the image showing up on the domain when it doesn't even exist? Is WordPress resolving the image to the generated thumbnail somehow? Why isn't it working on the localhost if this is the case? **Edit:** This is what makes no sense. How is this possible? Maybe the cache has something to do?   As you can see no trace of `IMG_0425-185x185.jpg` in the folder (??) but `IMG_0425-185x185-150x150.jpg` exists. ![enter image description here](http://i.imgur.com/gxp5iOQ.jpg)


Is it possible to use wp_localize_script to create global JS variables without a specific script handle?

Can we somehow use wp_localize_script() to create global js variables without a specific script handle which can be accessed from all the js files, even if the js scripts are not enqueued properly by using wp_enqueue_script ? This is the code I am using which creates varibale for 'ajaxscript' handle, so I cant access the object 'ajaxobject' in a js file which is being included in the header.php directly by `<script src="xxx" .... />`               wp_register_script( 'ajaxscript', get_bloginfo( 'template_url' ) . '/js/ajaxscript.js', array(), $version );     wp_enqueue_script( 'ajaxscript' );     wp_localize_script( 'ajaxscript', 'ajaxobject',         array(              'ajaxurl'   => admin_url( 'admin-ajax.php' ),             'ajaxnonce' => wp_create_nonce( 'itr_ajax_nonce' )         )     );


Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying

I am registering sidebars and sidebar widgets. The theme currently supports two sidebars. Primary and Secondary. `add_action('widgets_init', array($this, 'add_sidebars'), 10, 2);`               public function add_sidebars(){         register_sidebar(array(             'name' => 'Primary Sidebar',             'id' => 'mbe-sidebar-primary-sidebar',             'description' => '',             'class' => 'mbe-sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));         register_sidebar(array(             'name' => 'Secondary Sidebar',             'id' => 'mbe-sidebar-secondary-sidebar',             'description' => '',             'class' => 'mbe-sidebar',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
'         ));         $this->add_sidebar_widgets();     }      Then I add all the preset widgets (post objects from a post type) as an available sidebar widget.               private function add_sidebar_widgets(){         global $mbe_content;         $widgets = $mbe_content->get_content('archive', 'mbe-sidebar-widgets');         if(!$widgets){             return;         }         foreach($widgets as $widget){             wp_register_sidebar_widget(                 'mbe-sidebar-widget-'.$widget['post_name'],                 $widget['post_title'],                 array($this, 'display_widget'),                 array(                     'description' => 'Sidebar Widget'                 ),                 ''             );         }     }          public function display_widget($args, $params){         echo 'widget';     }      I have also set those sidebar widgets as active widgets in the primary sidebar. Now for example, at a theme level, If I wanted to just use a dynamic sidebar...               if(is_active_sidebar('mbe-sidebar-primary-sidebar')){         dynamic_sidebar('mbe-sidebar-primary-sidebar');     } else{         echo 'NO PRIMARY WIDGETS!'.PHP_EOL;     }      It show's "widget" from my widgets, but that's where the output for my widgets will occur. So that doesn't matter. The point is, the dynamic sidebar is working, and I can see my widget outputter. A question I'm having is, how come if I add a simple default WordPress widget to the sidebar, it doesn't output anything on the sidebar? It's like it doesn't even exist or something. **How can I get my widgets to output on the sidebar, while still allowing the default sidebar widgets provided by WordPress to output on the sidebar as well?** I originally thought it was my `function display_widget()` So I tried getting all widgets, looping through them, then calling `the_widget()` on each of their widget ID's, but then I'm getting errors about that widget not being found, blah blah.


nothing comes up when i go to my website.com/wp-admin? Which files should I look for?

My hosting company (godaddy) tells me that someone has hacked my wordpress admin login and have put garbage on filesystem. My website is down. and nothing comes up when i try to get my files using mywebsite.com/wp-admin (which I use to manage my files). I am not an expert and had got the site done from outside agency.


Wordpress function like is_category for subcategory? is_subcategory?

Is there a function in WordPress that will check if the page you are on is a sub-category archive page? Like the way is_category checks if it's a category page?


Image URLs stopped working due to Permalinks?

I've been changing my Permalinks and changing my site the the "www" version (Which I think has broken my image and video links). All my images are "red x" now, both inside the library and the posts themselves. I have been looking in my cpanel and all the file paths are correct, but if I try to view them through WP or even just copy the url and try it within my browser, it appears broken. Is there a way to fix this at all? Other than reload everything back up. :-( To update: I just re-uploaded an image and it was saved as header1.png, so WP can see that there is another image in there. It's strange because all the paths seem to match in my library to where they are stored within cpanel. I feel that because I cahnged the permalink structure to %category%/%postname% that that is affecting the image structure which is wp- content/uploads/%year%/%month%/%imagename% by the looks of it.


How do I print a term list but alter the link text?

I have a long list of taxonomy terms that all look like City-ST-Zip, ie: Phoenix-AZ-85043 or San-Diego-CA-92037 How do I print the list of terms so that the link URL remains intact but the link text is just the city name? ie:
Phoenix
      Also - A lot of cities have multiple zip codes, but I don't want to show a city name more than once.


Should i delete the posts created by a plugin on uninstall?

I created a plugin which is based on a Custom Post Type. When someone uninstalls this plugin, should i delete the posts under this post type or i should just leave them untouched?


How to strip non-alphanumeric characters, convert spaces to dashes, uppercase to lowercase in this context

I am using the Advanced Custom Fields plugin, which is very good. I am trying to take the output of one of the fields I created and give it the "permalink treatment", that is strip out non-alphanumeric characters like slashes, convert uppercase to lowercase, and convert spaces to dashes. Specifically I am wanting to do this with the checkbox field. I want to do this, because I want to use the outputted values as css class names. Its output is called by this bit of PHP (modified slightly from the documented use, see example #4):               <?php          $values = get_field('field_name');     if($values)     {          foreach($values as $value)     {         echo ' ' . $value;     }          }          ?>      Which returns all of the checkbox values (5 - 10 in this case) separated by a space. I successfully got the values showing up as class names, but now I need a way to format them to actually work as class names. How could I tweak this to work? I found this bit that seems to work for a sinlge string:               function stripJunk($string){             $string = str_replace(" ","-", trim($string));                  $string = preg_replace("/[^a-zA-Z0-9-]/","", $string);         $string = strtolower($string);         return $string;}      but in my case it's an array, and I don't know how to work with that. I'm pretty worthless when it comes to PHP, except for being able to tweak things a little bit without breaking it.


How to declare/provide file path in JQuery which is emeeded in the Wordpress theme

How to give the source location path in the jquery code, where my file is in **cah-new/wp-content/themes/theme_name/includes/func.php** and i have to give that path in the jquery code               $.get(\"func.php\", {      kindly help me, thanks in advance


At what priority does add_filter overwrite core functions?

I'm writing a plugin that adds some extra thumbnails, checkboxes, etc to the end of a post. I'm trying to figure out how to use add_filter properly. Basically, I've got `add_filter('the_content', 'do_some_magic_at_the_end');` And there is a corresponding do_some_magic_at_the_end function that takes $content and appends some stuff to it. I want this filter to be added after all other filters. I don't want it overwriting any other filter. The docs says default priority is 10, so I assume it is simply being added to a chain of filters that get run on the_content. If I set the priority to 1, will it overwrite any core functions?


Help with Wp + Mixitup code

I'm using MixItUp and having this issue. I'm calling the filters like this:               <?php     $categories=  get_categories('child_of=14&hide_empty=0');     foreach ($categories as $category)         echo '
category_nicename.'">'.$category->cat_name.'
';     ?>      it works fine, all categories are showing with their respective data filter, just as expected. However, when I try to output the content for those categories, I get nothing at all, not even errors, just blank. This is the code I'm using:               <li class="mix <?php foreach(get_the_category() as $category) { echo $category->slug . ' ';} ?>">     <?php the_post_thumbnail('prod_th'); ?>
      Just in case, teh code works fine in pure HTML5, so I guess I'm doing something wrong in PHP or maybe forgetting something Any idea on what am I doing wrong? Thanx in advance :) Fore reference, I'm using this: http://kune.fr/javascript/tutoriel-integreez- mixitup-a-wordpress/


Compare Two Custom Post Types Using The Same Custom Taxonomy

I have two post types, _courses_ and _testimonials_ , sharing the same taxonomies. What I am looking to accomplish is to check whether a course is in the same category as a testimonial. Then display if it is, keeping in mind they could have more than one category each. I am currently able to check which categories they are in using `get_the_term_list()` but can't figure out how to go about comparing them to one another. What I need is to be able to check is if the categories checked off in pm_course(post-type) is the same as course_testimonials(post-type). If they have the same category then I want to display the testimonial, if not I want to do nothing. Really a basic if else statement but I can't seem to find a way to see if the checked categories are the same in both.


optimise SQL wordpress call

I have this code :               $querystr = "     SELECT *     FROM {$wpdb->prefix}posts     INNER JOIN {$wpdb->prefix}postmeta m1       ON ( {$wpdb->prefix}posts.ID = m1.post_id )     INNER JOIN {$wpdb->prefix}postmeta m2       ON ( {$wpdb->prefix}posts.ID = m2.post_id )     WHERE     {$wpdb->prefix}posts.post_type = 'produits'     OR {$wpdb->prefix}posts.post_type = 'coupsdecoeur'     AND {$wpdb->prefix}posts.post_status = 'publish'     GROUP BY {$wpdb->prefix}posts.ID     ORDER BY {$wpdb->prefix}posts.post_date     DESC;     ";      when loading page containing this so slooooooowwwww, is there a trick to optimize this ? I just need the post title and a meta value called "wpcf-lien". Thanks a lot.


Can I use a Custom Field as the Featured Image URL?

Each post of my blog has a Custom Field which is the URL of a photo on Flickr. How can I use it as the Featured Image? Please note I'm asking this question because I'm migrating to a theme that makes use of the Featured Image to display thumbnails on the blog’s home page, but I would avoid enter them all by hand for all the 300+ old posts. **EDIT:**   * I'd prefer to avoid to change the theme's code, to avoid complications during future updates. But I can use child themes.   * The theme I'm using uses the `get_post_thumbnail_id()` function to obtain the featured image attached to the post:              <?php if ( has_post_thumbnail() ) :     $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );     ?>
         <a class="swipebox" href="<?php echo $full_image_url[0]; ?>" title="<?php printf( esc_attr__('Permalink to image of %s', 'envirra'), the_title_attribute('echo=0') ); ?>" rel="bookmark">             <?php the_post_thumbnail( 'vw_large' ); ?>


How To Add Perfect Apostrophe And Quotation Mark In WordPress Posts?

I have a blog at www.exeideas.com where I am sharing codes snippet too. I am new to WordPress and migrated from Blogger. So now my all codes shared in posts stop working. When I check my codes then found that all was fin but just Apostrophe, Quotation and, Dash are changes that is causing to stop my codes. I am sharing below what I am getting and what I want.   1. I am getting `’` and want `'`.   2. I am getting `”` and want `"`.   3. I am getting `‘` and want `'`.   4. I am getting `–` and want `-`. Now tell me what to do to fix this out. My code box CSS is given below. `#execodediv0 {width:99%;max-height:300px;border:3px solid black;overflow:auto;font: 12px Arial!important;word-wrap:break-word;}`


Group comments in the admin section

Is there any way to re-arrange the comments in the admin panel of WP? I'd list to nest them in the same way as it is happening in the front-end, thus having the opportunity to see the comment I have replied immediately above my answer. I did look for a plug-in, but apparently there is anything? I would be happy also for a quick dirty patch to be coded, but I don't have any idea where I can start looking this into. The only pertinent topic I found is this, but doesn't really enter into details. Thanks


Update own Plugin Repository on Multisite

i have a curios problem what i cannot fix. On the plugin mainfile i defined:               add_filter('pre_set_site_transient_update_plugins', array('moreads_update','check_4_updates'));     add_filter('plugins_api', array('moreads_update','plugin_api_info'),10,3);      The Class Functions:               static public function check_4_updates($checkdata) {         global $wp_version;              //var_dump($checkdata);return $checkdata;              $options = get_option(MABASENAME);         $options = is_serialized($options) ? unserialize($options) : $options;         if (empty($checkdata->checked)) {return $checkdata;}         $args = array(             'slug' => MASLUG,             'version' => @$checkdata->checked[MASLUG]         );         $request_post = array(             'body' => array(                 'action' => 'plugin_update_check',                 'token' => !empty($options['token']) ? trim($options['token']) : '',                 'domain' => !empty($options['domain']) ? trim($options['domain']) : '',                 'request' => serialize($args)             ),             'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url')         );         $raw_response = wp_remote_post('http://api.domain.tld/',$request_post);         $response = false;         if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200)) {             $response = is_serialized($raw_response['body']) ? unserialize($raw_response['body']) : $raw_response['body'];         }         if (!empty($response)) {             if(strpos(@$response->package, self::$_apiurl) !== false) { // Only API Domain for Update Server allowed                 @$checkdata->response[MASLUG] = $response;             }         }         return $checkdata;     }     static public function plugin_api_info($def, $action, $args) {         global $wp_version;              if (!isset($args->slug) || ($args->slug != MASLUG)) {             return false;         }              $options = get_option(MABASENAME);         $options = is_serialized($options) ? unserialize($options) : $options;         $plugin_info = get_site_transient('update_plugins');         $current_version = @$plugin_info->checked[MASLUG];         $args->version = $current_version;              $request_post = array(             'body' => array(                 'action' => $action,                 'token' => !empty($options['token']) ? trim($options['token']) : '',                 'domain' => !empty($options['domain']) ? trim($options['domain']) : '',                 'request' => serialize($args)             ),             'user-agent' => 'WordPress/'.$wp_version.'; '.get_bloginfo('url')         );         $response = wp_remote_post('http://api.domain.tld/',$request_post);         if (is_wp_error($response)) {             $res = new WP_Error('plugins_api_failed', __('An unknown error occured while connecting the plugin-API.').'

'.__('Try again?').'', $response->get_error_message());         } else {             $res = unserialize($response['body']);             if ($res === false) {                 $res = new WP_Error('plugins_api_failed', __('Unknown error.'), $response['body']);             }         }         return $res;     }      The API returned follow objects:               Update:     $erg->slug,     $erg->package,     $erg->new_version,          Plugin-Info:     $erg->slug=array(         'homepage',         'name',         'version',         'author',         'last_updated',         'external',         'requires',         'tested',         'downloaded',         'package',         'download_link',         'sections' => array(             'description',             'change_log',             'other_notes'         )     );      On the single blog all works fine. If i set a new version, the update will shown on Wordpress Update Page. But on a multisite Blog i see nothings. I have tried only in one blog on multisite, networkwide and also activate into the first blog, no update available. If i will check it with               set_site_transient('update_plugins', null);     add_filter('plugins_api_result',function($res,$action,$args){print_r(array($res,$action,$args));return $res;});      my update routine "check_4_updates()" will not call on multisite! What are happend here, what's wrong? Thanks, Stefan


Variable not working in WP_Query

I have used this technique before and cannot work out why this time it is not working. 'news_category' is a custom taxonomy of my custom post type 'News'. I am getting the taxonomy of the current post (which is custom post type 'news') using get_the_term_list, replacing the spaces with '-' and using the variable in my query. If I echo the query it gives me the exact string I am expecting - and if I manually enter this string into the query, it works, but the variable doesnt.               <?php $cats = get_the_term_list($post->ID, 'news_category'); ?>                          <?php $cat = str_replace(' ', '-', $cats);?>                          <?php $category = strtolower($cat); ?>                          <?php echo $category; ?>                              <?php $args = array(                                                  'post_type' =>'news',                                             'news_categories' => $category,                                             'post__not_in'=> array($post->ID)                                             ); ?>                                        <?php $sidebar_category = new WP_Query($args); ?>


List pages within a certain parent and show published month

How can I list all pages within a certain parent (ID=917) and show the month and year they were published in this format: Aug 2011   * This is a page (link to page)   * This is another page (link) Jul 2011 Jun 2011   * This is another page (link) etc etc UPDATE: Also, just in case, how can I just show the months that have a page within it? So from the example above, it wouldn't show Jul. **Please don't tell me to use posts instead of pages as that isn't an option on the setup I have.**


add_post_meta from front end form

I am trying to add new post and meta data from the front end. I have a form and a custom post type named 'parts'. Looking for the easiest way of adding meta box and passing a value from the front end form to `add_post_meta` function and manipulating the data from the back end. In my case of having a lot of fields to be added, the tuts are pretty big pieces of code and I dislike plugins.


How to restrict specific post types from being read or added by specific user roles (eg. author)?

I'm not very clear how to restrict admin area post types access to specific user roles. In my case, I have some post type such as "suppliers" which I do not want to show to "authors". By default WP allows authors to browse, add or edit their own content. But I don't want my authors to add a "supplier" or browse entries from other admins. I've looked into Wordpress code and the codex: http://codex.wordpress.org/Function_Reference/register_post_type there seems to be a parameter in `register_post_type( 'supplier', $args )`, which I tried to define in $args as follows, among of course other variables which I don't think I need to list here since my post type is working fine:                    'capabilities'          => array( 'edit_others_posts' ),          'map_meta_cap'          => true,      I haven't fully understood the parameter `"map_meta_cap"` - I assumed that by indicating `'edit_others_posts'` would have sufficed to bar access of 'suppliers' by simple authors (which cannot, in fact, edit other's posts). I tested this and doesn't work. Authors can still see all the "suppliers" content in the admin area and add a supplier as if it was a blog post. How can I prevent authors (or any other specific user role or users without certain capabilities) to access and add content under specific custom post types I've created? thank you


Page not found error shown while installing wordpress on IIS server

I am installing a wordpress folder on a windows server, but it shows page not found. I am unable to even see the first page of installation. This is the site address http://np-environmental.com/newsite/ Can anyone tell what the issue can be??


Allow users to only CREATE one single (custom) post

At first, sorry for my bad english.. :-) I created a custom post type with taxonomy and now want to allow users (of a specific user group) to post only **one** single post in a specific category. If the user has already posted a post, he can only edit his own post (I already have the PHP for that). I found a lot of solutions that users can only post in a specific category or only edit their own posts, but no-where an conditional that the user can only post one post. The functionality might be seen as a "second profile", it should be like a profile (Users can post one post, edit this post, all users and guests can view the post). I would have several ideas, maybe a conditional, if the user has 0 posts in the category, than he has the right to post..? I would be really glad for any help! Thanks a lot!


what to backup (for partial restore)??

My site has hacked three times, and as forced by host provider, now there is no option in front of me, except restoring a healthy backup for around 3 weeks ago. (Hacker had created a backdoor in my site, and was using my site for sending mass spam emails, and i couldn't find that backdoor. I could only remove bad files which was uploaded by hacker). Before restoring that old backup (for 3 weeks ago), what i must to backup - or download- to add posts created during these 3 weeks. I mean, if restore backup of 3 weeks ago, i lose all posts created during this 3 weeks. what must i do to get my site to current state with all posts, pictures, ... Thanks in advance (and sorry for bad english)


Image path in posts (/uploads/yyyy/mm) does not match actual file location

I just moved to a new server and upgraded WordPress as well. Somewhere in the process my image paths in old posts got mismatched to the actual file location. All the old images are now broken. As an example, in olds post the image is linked as "/wp- content/uploads/2014/05/image.jpg" but the actual file location is "/wp- content/uploads/2014/08/image.jpg". It appears this may be due to a change in WordPress in which attachments are stored by the parent post date as opposed to the actual upload date: https://core.trac.wordpress.org/ticket/10752 I have no idea how to fix this. I have over 2000 images that are mislinked now. Is there maybe some way to move all the images from all the /uploads/ sub- directories into the main /uploads/ folder and then run a database script to rewrite all of the img src URLs? Or a better solution?


Cleanup uploads folder, Media Library db structure

I am doing an upgrade and cleanup of an old blog that started on Blogger.com, then moved to self-hosted WordPress 2.1, 2.3 and now 3.0. Images in the posts are scattered around: most of them are in `/wp-content/`, but not all in `/wp- content/uploads/` or `/wp-content/uploads/year/month/`. Others still reference the blogger.com image servers. I want to consolidate them all in `/wp- content/uploads/year/month/`, which I think is the "correct" place? This should make later upgrades easier. What is the best way to do this? I would like to update the metadata too, so that the Media Library can manage all of them. I could not find any documentation on this, so sorry if I missed it, please point me to it. Of course, I would provide redirects from the old locations to the new. What is the best way to do this? A template `404.php`, of a plugin? I would like to add some logging, so we can find the referring pages and maybe correct them. (This question was originally asked on the WordPress support forums, but got no useful answer there).


Taxonomy templates in a multilanguage site

Let's say I have a multilanguage (English and Spanish) site with a custom post type called Books, with two custom taxonomies, Authors and Publishers. The template files used to render the taxonomy archives in English would be: taxonomy-author.php taxonomy-publisher.php My question is, do I have to duplicate this file for the Spanish version too, like this? taxonomy-autor.php taxonomy-editorial.php Is there a way to avoid having to do this for every language in my site? Any ideas? Thanks in advance


How to solve dropdown menu problem

Please look and help me how to solve this I want look like: Here But my code show: On Chrome   On mozilla Website link Here


Multi site clarification

I've done some reading about multisite over at WordPress.org and looking to see if I'm understanding correctly. My current blog domain is somewhat locale restricted by name. However, much of my content is not. So, within the next 2 - 3 months I plan to use another domain that I own as a "master" domain and have my current site within that. The way that my current blog is structured on the host is like this:   * WordPress URL: h..p://www.mysite.com/wordpress   * Site address URL: h..p://www.mysite.com   * Directory structure on the host: /home/myusername/mysite.com/wordpress According to the WordPress.org site: "This means each additional site in your network will be created as a new virtual subdomain or subdirectory." So, what changes (if any) will I need to make to my current site in order for it to be a subdomain of the new site? Thanks. p.s. - hope this is clear. if not I can clarify later. at work now.


Changing Woocommerce Product Description

I've been changing the way that the Single product page looks. I've moved a few things about by hooking into Woocommerce and also editing the css. Out of the box the single product page shows the short description (described as woocommerce_template_single_excerpt in the content-single-product.php file) next to the product image, but I want to show the full description. The full description is shown in the product data tabs underneath the product. Looking in the tabs directory at the description.php file it seems to just set the heading. Presumably as the product is a custom post type the product description is the content of the custom post. I've worked around it by putting the full description in the product short description section but I'd like a solution that doesn't require someone adding products to have to do this. Can anyone suggest a way of doing this please?


Wordpress Export Import Site Navigation Menu

When I do an export and import the menus get transferred but I have to set the Site Navigation Menu manualy. Obviously it's only a small detail but can I ask is this a bug or expected behaviour and is there any way to include the site navigation menu selection in the export file. The same thing is the case for custom menu widgets.


How to use WP_Query in a CPT achive page?

I can't get `WP_Query` to work in my custom-post-type archive page. Can someone please tell me what I'm doing wrong? I would appreciate any help. Here's the code in `archive-bulletin.php`:               <?php get_header();      //wp_reset_query();     wp_reset_postdata();     $q = new WP_Query("post-type=bulletin" );     show_var("the query", $q);          if ($q->have_posts() ) :        while ($q->have_posts() ) : $q->the_post();         echo "<h1>" . the_title(). "</h1>";         the_content();       endwhile;     endif;     wp_reset_postdata();     ?>      Instead of showing my `bulletin` posts, it shows only `post` posts. The result is similar with or without the resets. (The function `show_var()` just wraps `var_dump()` in a `<pre>`.) The `bulletin` posts show as expected with `archive.php` (i.e., when there's no CPT archive template). In case it's of help, here's the code I use to register the post type, etc. in the main file of my plugin:               // register bulletin post-type     add_action( 'init', 'bulletin_init' );          function bulletin_init() {       $labels = array(         'name' => __("Bulletins"),         'singular_name' => __("Bulletin"),         'menu_name' => __("Bulletins"),         'add_new' => _x('Add New', 'bulletin'),         'add_new_item' => __("Add New Bulletin"),         'edit_item' => __("Edit Bulletin"),         'new_item' => __("New Bulletin"),         'view_item' => __("View Bulletin"),         'search_items' => __("Search Bulletins"),         'not_found' => __("Bulletin Not Found"),         'not_found_in_trash' => __("No bulletins found in trash"),      );            $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'exclude_from_search' => false,         'show_ui' => true,         'show_in_menu' => true,          'query_var' => true,         'rewrite' => true,         'menu_position' => 10,         'supports' => array(            'editor',            'excerpt',            'revisions'         ),         'taxonomies' => array( '' ),         'has_archive' => true       );       register_post_type("bulletin", $args );            add_filter('manage_edit-bulletin_columns', 'add_bulletin_columns');       add_action('manage_bulletin_posts_custom_column', 'bulletin_columns_data', 10, 2);       add_filter( 'manage_edit-bulletin_sortable_columns', 'bulletin_columns_sortable' );       add_filter( 'request', 'bulletin_columns_orderby' );     }      Of course I pared down the code in `archive-bulletin.php` to highlight the root problem. My larger effort is to create a CPT archive page that will display the posts ordered not by date posted, but by custom meta value (`bulletin_date`). I've seen the post here, but it's so entangled with particulars that don't apply, that I can't get anything out of it. # EDIT Here's the code for my `pre_get_posts` function that solves the larger issue:               function archive_bulletin_sort( $q ) {              if( $q->is_post_type_archive('bulletin') ){// && $q->is_main_query() ) {             $q->set('meta_key', 'bulletin_date');             $q->set('orderby', 'meta_value');             $q->set('order', 'DESC');         }     }     add_action( 'pre_get_posts', 'archive_bulletin_sort' );


Custom query from all posts & all child page from one parent page?

I'm working on a wordrpess site for improve search result. Now I want to fetch posts from a certain category & all child pages from one parent page. If I set               post_parent => parent_id      then it only show all child pages, and not any posts(blog post). But I want to show child pages from given id && blog posts. like:               post_parent=>parent_id && post_type=>post&&category=>array(cats id).      Any suggestions on how to accomplish this


Three step order form, how to go to next step

I have an order.php that is in fact a custom page template. This template loads the first step of my order form via:               <?php include('order/order-step-one.php'); ?>      Now in this order-step-one.php my Next-button (post method) has to send the user to /order/order-step-two.php Currently this does not work. I need to find a way to include order-step-two in the original order.php via the submit button in order-step-one. How do I achieve this?


Ajax contact form return 0

I have a contact form that I want to submit using ajax. It seems like send the data, but the only retrieved is 0. HTML form:               <form method="post" action="http://www.codetocode-developments.com/ela/wp-admin/admin-ajax.php" name="contactform" id="contactform">            <fieldset>                                                      *Your Name                     <input name="name" type="text" id="name" size="30" value="" />
                                                                  *Email                     <input name="email" type="text" id="email" size="30" value="" />
                                                                  *Phone                     <input name="phone" type="text" id="phone" size="30" value="" />
                        </fieldset>            <fieldset>               Subject               <select class="form-control" name="subject" id="subject">                  <option value="Support">Support</option>                  <option value="a Sale">Sales</option>                  <option value="a Bug fix">Report a bug</option>               </select>
                              *Your comments               <textarea name="comments" cols="40" rows="5" id="comments"></textarea>               <button type="submit" class="btn btn-border btn-lg" style="border-color:#00aff0;color:#00aff0;" data-color="#00aff0" data-hover="#00aff0" id="submit" value="Submit" data-loader="http://www.codetocode-developments.com/ela/wp-content/themes/ela/assets/images/ajax-loader.gif">Send Message</button>            </fieldset>         </form>      JS code:               $('#contactform').submit(function(){                  var action = $(this).attr('action');                  $("#message").slideUp(750,function() {             $('#message').hide();                  $('#submit')                 .after('')                 .attr('disabled','disabled');                  $.post(action, {                 name: $('#name').val(),                 email: $('#email').val(),                 phone: $('#phone').val(),                 subject: $('#subject').val(),                 comments: $('#comments').val(),                 verify: $('#verify').val()             },                 function(data){                     document.getElementById('message').innerHTML = data;                     $('#message').slideDown('slow');                     $('#contactform img.loader').fadeOut('slow',function(){$(this).remove()});                     $('#submit').removeAttr('disabled');                     if(data.match('success') != null) $('#contactform').slideUp('slow');                      }             );                  });                  return false;              });      PHP:               add_action('wp_ajax_ajaxContacForm', 'ajaxContacForm');     add_action('wp_ajax_nopriv_ajaxContacForm', 'ajaxContacForm');          //Ajax contact form filter function     function ajaxContacForm() {              if(!$_POST) exit;              global $ela_opt;              if (!defined("PHP_EOL")) define("PHP_EOL", "\r\n");              $name     = $_POST['name'];         $email    = $_POST['email'];         $phone   = $_POST['phone'];         $subject  = $_POST['subject'];         $comments = $_POST['comments'];                   if(trim($name) == '') {             echo '
Please enter your name.
';             exit();         } else if(trim($email) == '') {             echo '
Please enter a valid email address.
';             exit();         } else if(trim($phone) == '') {             echo '
Please enter a valid phone number.
';             exit();         } else if(!is_numeric($phone)) {             echo '
Phone number can only contain digits.
';             exit();         } else if(!isEmail($email)) {             echo '
You have enter an invalid e-mail address,please try again.
';             exit();         }              if(trim($subject) == '') {             echo '
Please enter a subject.
';             exit();         } else if(trim($comments) == '') {             echo '
Please enter your message.
';             exit();         }               if(get_magic_quotes_gpc()) {             $comments = stripslashes($comments);         }                   // Configuration option.         // Enter the email address that you want to emails to be sent to.         // Example $address = "joe.doe@yourdomain.com";              //$address = "example@themeforest.net";         $address = $ela_opt['contact_email'];                   // Configuration option.         // i.e. The standard subject will appear as, "You've been contacted by John Doe."              // Example, $e_subject = '$name . ' has contacted you via Your Website.';              $e_subject = 'You\'ve been contacted by ' . $name . '.';                   // Configuration option.         // You can change this if you feel that you need to.         // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here.              $e_body = "You have been contacted by $name with regards to $subject, their additional message is as follows." . PHP_EOL . PHP_EOL;         $e_content = "\"$comments\"" . PHP_EOL . PHP_EOL;         $e_reply = "You can contact $name via email, $email or via phone $phone";              $msg = wordwrap( $e_body . $e_content . $e_reply, 70 );              $headers = "From: $email" . PHP_EOL;         $headers .= "Reply-To: $email" . PHP_EOL;         $headers .= "MIME-Version: 1.0" . PHP_EOL;         $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL;         $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;              if(mail($address, $e_subject, $msg, $headers)) {                  // Email has sent successfully, echo a success page.                  echo "<fieldset>";             echo "
";             echo "
Well done!
";             echo "
Thank you $name, your message has been submitted to us.
";             echo "
";             echo "</fieldset>";              } else {                  echo 'ERROR!';              }              die();          }      I usually use chrome developers tools to find errors on html, js.. but this time I don't know how to find where is the error and all seems correct. Can somebody help me find the problem? Thanks in advance!


When is it too late to call the action wp_enqueue_scripts?

I'm creating a plugin that always enqueues a script in the footer. I also have a function that if called would enqueue an additional script that depends on the other one. Here is the basic format of my plugin...               <?php     class MyPlugin {         public function __construct() {             add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts'));         }              public function enqueue_scripts() {             wp_enqueue_script('myscript', plugins_url('js/myscript.js', __FILE__), array('jquery'), null, true);         }              public function api() {             add_action('wp_enqueue_scripts', array($this, 'api_scripts'));         }              public function api_scripts() {             wp_enqueue_script('api', plugins_url('js/api.js', __FILE__), array('myscript'), null, true);         }     }     $_GLOBALS['myplugin'] = new MyPlugin();      In my theme's functions.php file I would like to know when I can make a call to enqueue the script. I've tried attaching to plugins_loaded, but the script is not called.               <?php     function myfunction() {         global $myplugin;         $myplugin->api();     }     add_action('plugins_loaded', 'myfunction');


Is it possible to maintain image aspect ratio when scaling images?

I'm using a theme which displays a grid of images, but it only works with landscape images at the moment (with portrait images, people's heads are cut off). The theme uses custom featured image sizes defined in functions.php through the use of add_image_size(). Is there a way to set the image sizes proportionately to maintain the correct aspect ratio?


UTF8 Encoding problems when exporting posts

I have a Wordpress installation with MySQL encoded as utf8_general_ci. I'm trying to export it using wordpress' export tool, but the result XML breaks some special characters such as "é", "ê", etc turning them into "Ã©" for example. The XML file is being downloaded into a Windows machine and scp'ed into a Linux. In both platforms the encode is off. I checked the resulting xml with "file" and it´s telling me it is a UTF8 file. What am I missing? Thanks!


Users managed to register on website with no register button?

Due to recent spam, I wanted to stop registration on my website for a while. But doing so meant the registration page would redirect to the homepage, which was bad for SEO. So I left the registration page there, removed the 'register' submit button and put in a little message telling people to contact me if they wanted to be registered manually. 1 day later, I have another 5 users who somehow managed to register! All of these are spam users. How did they do this? I removed the 'register' submit button on the register page so did they manage to make their own submit button? (editing the webpage on their end) Also if you go to mysite.com/wp-register.php or /wp-admin/ it asks for a password (.htpasswd protected). The actual register page is located at: /wp-login.php?action=register (This is a custom page that matches my theme btw) What do you think it is? I can private message you the website if you like. Thank you!


Extract image src from a post and send it to an external form

I have created a Facebook App to upload photos to facebook from image url with help of some tutorials. It needs an image url and description. I want to put a button "Upload to Facebook" below every "Image" type posts in wordpress. App Main Part to upload images -               <?php     if(isset($_POST["source"]))     {     try {         $access_token=$facebook->getAccessToken();         $graph_url= "https://graph.facebook.com/me/photos?"       . "url=" . urlencode($_POST["source"])       . "&message=" . urlencode($_POST['message'])       . "&method=POST"       . "&access_token=" .$access_token;         $response=file_get_contents($graph_url);         $json=json_decode($response);       }       catch (FacebookApiException $e) {         error_log('Could not post image to Facebook.');       }     }     ?>                        <form enctype="multipart/form-data" action=" " method="POST">             Paste an image URL here:             <input name="source" type="text">

             Say something about this photo:             <input name="message"                    type="text" value="">

             <input type="submit" value="Upload" class="btn btn-primary"/>
         </form>      How can i extract image src dynamically from a custom post type(Image), and set src as `source` in form automatically. (There is only one image in every image type post)


How do you use orderby with meta_query in Wordpress 3.1?

Is it possible to order my list of custom posts, after filtering it with meta_query, by the meta data of my choice? For example, I have a custom post type called webinars. I am trying to list all upcoming webinars, and have them ordered by the custom meta field called webinar_startDate. Using the following query, I was able to return the webinars succesfully excluding the old webinars. However, they still come out in the order they were published, and not by webinar_startDate.               <?php $my_array =  array(         'meta_query' => array(                 array(                     'key' => 'webinar_startDate',                     'value' => date("Y-m-d H:i:s"),                     'compare' => '>=',                     'type' => 'DATETIME'                 )         ),         'orderby' => 'meta_value',         'post_type' => 'webinars',         'posts_per_page' => 20,         'order' => 'ASC'     ); ?>      I suspect that due to the change from 3.0 to 3.1, the use of orderby => meta_value is probably different, but I can't find an answer within the WordPress documentation to explain this. Can anyone help? Thanks in advance.


Using auth_redirect returns cannot modify header information

I'm hooking `auth_redirect` to `wp_head`, but it's returning cannot modify header information. Do I have to hook it to a different action? Something that loads before wp_head? I tried hooking it to get_headers and send_headers, but then it didn't even work. Any ideas? Thanks!               add_action('wp_head','check_if_logged_in');               function check_if_logged_in() {       $pageid = get_option('sd_page_id');       if ( !is_user_logged_in() && is_page($pageid) ) {           auth_redirect();       }     }      Also, to clarify, for some reason it works in localhost but not on my server. Weird.


save_post not working with attachments

I've made a Meta Box for Posts and Pages, and while testing added Attachments too. But, curiously, the hook `save_post` does not fire.               $cpts = apply_filters( 'my_filter', array( 'post', 'page' ) ); // Added attachment through filter     foreach( $cpts as $pt )     {         add_meta_box(             'my_metabox_id',             __( 'Meta Box' ),              array( $this, 'my_metabox_callback' ),             $pt,             'side'         );     }     add_action( 'save_post', array( $this, 'save_metabox_data' ) );      Why is that? Isn't `attachment` a Post Type too and hence subject to the same hooks as other post types?


modifying a template and adding jQuery to it

There is a page template called "All Bookmarks" for displaying all links grouped by category. I want to modify it 2 ways:   * each category of links should be collapsible/expandable by clicking on the category header   * the template should accept a list of categories to either include or exclude For the collapsible part, assumably I need only add a class to each category header so that my jQuery code can affect them. For the category limiting, assumably I need a way to pass parametres to the template. However, I'm a complete noob to WP and I don't know   * where to put the jQuery code   * whether to add the class to the template, or to create a new template   * where to store a new template so that it will be available to Pages   * if templates can take parametres or if a template needs to refer to a custom PHP function   * where to store custom PHP functions I've been wandering around WordPress.org for a while becoming more and more frustrated. I'd appreciate it if someone could address the above questions and perhaps point me to a good explanation of WP code structure. Thanks!               Version: WP 3.1     Theme: Suffusion 3.7.7


How to add field for new site-wide option on Network Settings screen?

I'm working on a plugin, and part of it involves setting an option value that applies to all sites in a WordPress network. I know about the add_site_option and get_site_option functions that let you save the value into the wp_sitemeta table, but what I can't figure out is how to place the fields in the appropriate place in the WordPress backend, and how to intercept the saving of sitewide values in order to insert the add_site_option call when that happens. For the first problem (adding the fields), I would normally use the Settings API, specifically register_setting and add_settings_field, to whitelist the new option and then insert a field for it into the appropriate options page. But I can't find information anywhere on whether you can use add_settings_field to add a field to the Settings page in the new Network Admin section of the backend, if there's an alternative function that does what it does for Network Admin pages, or if you just have to inject the HTML manually. (You can do it manually by writing a function that echoes out the field and then connecting that function to the "wpmu_options" action, which gets run at the end of the Settings page in Network Admin. But then you also have to deal with nonces and everything else manually.) The second problem probably involves finding an action that runs when the user hits "Save" on the Network Admin Settings page, but I've been unable to find that yet. Any leads would be greatly appreciated. So -- thoughts? Is there an elegant way to allow management of sitewide options for a plugin through the new Network Admin area? If so, how's it done?


Wordpress plugin for real estate that scales?

Anyone have recommendations for wordpress plugins that can scale easily and integrates with Wordpress' new custom post types? Not interested in themes as discussed here: Real Estate website with Word Press


Media Upload Tab reload and change $_GET

I have created a new tab under the new media upload whose content is created by:               $folder_id = $_GET['folder_id'];     global $wpdb;     $foldertable = $wpdb->prefix . 'icrm_folders';          if (!$folder_id) {         $sql = $wpdb->prepare( "SELECT * FROM {$foldertable} WHERE folder_id IS NULL" );     } else {         $sql = $wpdb->prepare( "SELECT * FROM {$foldertable} WHERE folder_id = %d", $folder_id );     }          $folders = $wpdb->get_results( $sql, ARRAY_A );     echo '
';     foreach ( $folders as $folder ) {         echo '
' . $folder['name'] . '
';     }     echo '
';      The goal here is to allow the user to navigate the media in a folder like structure (and other things not relevant here). Since the content loads based on the $_GET URL how do I let the user click on a folder and see its content? I tried using ajax to reload the content and passing the variable but its not working, I think there is something wrong with my path but I can't tell. I also tried to add it directly to the link but using `<a href="?folder_id="' . $folder['id'] . '">` But that just made the entire modal reload..... There isn't very good documentation on 3.5 so I'm struggling on where to even look. If someone could point me in the right direction, I would quite appreciate it. Thanks!


Can't delete unwanted favicon

I have a favicon that is a remnant of a disactivated wordpress theme. I can't find the favicon file in the theme folder, or the wordpress or server root. I have added my own reference to a new favicon, but the old one is still displayed. > <link rel="icon" type="image/png" > href="http://www.steve.doig.com.au/wordpress/wp-content/themes/grid-focus- > public-10/images/favicon.ico"> My site is here. **Edit:** Favicon is ![New Favicon](http://www.steve.doig.com.au/wordpress/wp- content/themes/grid-focus-public-10/images/favicon.ico)


What parameter should I pass to wp_enqueue_style to depend on the themes stylesheet?

I have written a basic gallery plugin that uses wp_enqueue_style to include a stylesheet on the page. I'd like for the WordPress theme to be able to override the style of the plugin which means I'd like to my plugin to play nice and output the css file **before** the theme css file. wp_enqueue_style has a `deps` parameter for exactly this requirement. My question is what value should I use for the `deps` parameter if I want to say "I depend on the themes css file"? The current plugin code is incorrect because it uses `false` for the `deps` parameter:                  // Enqueue a CSS style file - see http://codex.wordpress.org/Function_Reference/wp_enqueue_style                                                                 wp_enqueue_style('bitvol_galleria_css', BITVOL_GALLERIA_URL . '/bitvolution-image-galleria.css', false, $this->bitvol_galleria_version, 'all' );


Manually add admin bar

Does anyone know how to include the admin bar in a page template where `wp_head()` and `wp_footer()` are not present? I'm developing a template other scripts and styles are just getting in the way. Rather than go through and dequeue all of the stuff I don't need, I've simple removed the two hooks altogether. All I want instead is the admin bar. Thanks!


How to delete old posts' edits to save space?

I need to delete old edits and autosave, they have grown overtime, and are not needed anymore, seeing this post: http://wordpress.stackexchange.com/a/67228/27148 it states: > If you have no use for the post revisions and autosaves then disable them in > wp-config and WordPress will clean them up on its own but I can't find exactly where to edit. using wordpress 3.5


Changing a username

I have had a small number of users on my blog whiching to change thier username. I was reading that is in stored in the DB but where is it and how do I change it.


How can I Rewrite a 'page' URL based on query string parameters?

I have the following page which contains a single post and a number of comments:      http://mysite.com/tips When a user posts a comment, I add meta-data to it so I can filter comments by using these URL's:   http://mysite/tips?id=cat&filter_id=1   http://mysite/tips?id=dog&filter_id=2 I want to use the following url's instead:   http://mysite/tips/cat   http://mysite/tips/dog The tips page displays a list of posts based on the query string parameters. I worked through this tutorial, which seemed to be what I needed, but when I type in my url, I get a page not found error. http://thereforei.am/2011/10/28/advanced-taxonomy-queries-with-pretty-urls/ Is this possible?


Echo simple string in Plugin

I am getting started with plugin development. I wrote the following program to display text on screen but nothing happened. Please help. Thanks.               <?php     /*     Plugin Name: Fahad     Plugin URI:     Description: Declares a plugin that will be visible in the     WordPress admin interface     Version: 1.0     Author: Yannick Lefebvre     Author URI: http://ylefebvre.ca     License: GPLv2     */     ?>               function fahad(){         echo "I am alive";     }     add_filter('wp-footer', fahad);


Display static pages instead of category, in code

I'm very new to programming and not sure how to go about this. The following code returns 3 category names and feature images and then outputs them on the page.

                 <?php                     $featured_categories = array(8,9,10);                     foreach  ($featured_categories as $featured) {                         if (get_option(THEME_PREFIX . 'enable_category_' . $featured)) {                             echo '';                             $category_id = get_option(THEME_PREFIX . 'featured_category_' . $featured);                              query_posts("cat=$category_id&showposts=1"); if (have_posts()) : while (have_posts()) : the_post(); ?>
                                     <a href="<?php echo get_category_link($category_id); ?>" title="View all posts in <?php echo get_cat_name($category_id); ?>">                                         <?php the_post_thumbnail(); ?>
<?php echo get_cat_name($category_id); ?>
                                     <?php echo category_description($category_id); ?>
                               <?php                             endwhile; endif;                              wp_reset_query();                         }                     }                 ?>
      What I would like to do is, instead of it returning 3 categories that are specified in the admin area, I want to point to three static pages instead. So it will return the feature images for these 3 pages and also the name. Can anyone help please? I think the line that needs to be changed is '$featured_categories = array(8,9,10);' to point to the pages instead. Am I on the right track here?


WPML tables not deleted when removing multisite subsite, need help clearing up my sql-file!

I´m building a WP Multisite for a client that wants a multilingual site. Before choosing WP Multisite, I bought and tried out WPML. However that plugin didn't fit for the job so I deleted it and got a refund. However, now this seems to come back pestering me somehow. Now when using Multisite, I have been using Backupbuddy to export and duplicate my site for different testing purposes. Now some trouble has appeared, the database is friggin huge despite this being a very small page! The SQL is a wooping 500 megs, I can't even see it in MyPhpAdmin. I got the SQL-file on my desk and when I finally got it open, its bloated everywhere with remnants of WPML tables that seems to have been duplicated with every site duplication, but never removed upon site deletion. Has anyone encountered this? I´m no good at database editing and really unsure of how I can fix this.