title: Best way to achieve multiple links in a post title

text: Usually I would get a post title no problem, however now I need to achieve something like this: > The Example is written for this title As you can see two words are links in the title, another problem is that there could be any number of links, as it will depend on a content. How can I achieve this? will I have to use additional fields in WordPress? how to show WordPress which words in the title are links? And in addition, I will need to somehow store url for the link.


title: Call custom field into menu item

text:
I have a navigation menu in Wordpress. I would like it to check if the page has a custom field of "menu_icon" and if it does, add that custom field into the menu item it corresponds to. I'm sure this would require some sort of walker function extension but I am a bit new to PHP and Wordpress. I've search around and have not found a suitable tutorial. For example: (normal menu)

link

          (custom)

link


title: Query posts only with featured image

text:
I want to query 6 posts, but only those which have a featured image attached. I am using `meta_key` method for this with `WP_Query` as such:               $args = array(         'post_type'  => 'post',         'meta_key' => '_thumbnail_id',         'post_count' => 6 );     $query = new WP_Query($args);      Followed by               <?php while($query->have_posts()) : $query->the_post(); ?>
<?php the_title(); ?>
         <?php the_post_thumbnail('thumbnail'); ?>     <?php endwhile; ?>      This doesn't seem to work. The query is returning more than 6 posts and also those which don't have a featured image. Any ideas what I've got wrong here? @chip: `var_dump($query);` gives a large result so I have posted it in a pastebin


title: BackupBuddy WP CLI Invalid Profile Error

text: When I try to run a WordPress (3.8) backup of a site using wp-cli 10 alpha (site here)               wp --info     PHP binary: /usr/local/bin/php-5.3     PHP version:    5.3.5     php.ini used:   /etc/php53/php.ini     wp-cli root:    /usr/local/wp/vendor/wp-cli/wp-cli/php/     wp-cli config:       wp-cli version: 0.10.0-alpha      on my Dreamhost VPS in combination with BackupBuddy 4.2.12.1 I get this error               wp backupbuddy backup profile-name     Error: Error #85489548955. Invalid profile ID not numeric: `profile-name`.      Any ideas how I can remedy this?


title: Unable to select image using custom image field type

text: I'm using the advanced custom field plugin and having a bit of trouble when using the image field type. (I'm not sure if this relates to the plugin that much actually!). When inserting an image instead of the option to select it I only have the option to insert it into post, which tries to insert the image into a wysiwyg. I only get the option to select image if I first insert it into post then delete it from the wysiwyg, then click choose image again and find it in the media gallery. Is there any workarounds/plugins to allow me to select the image straight away?


title: category url structure

text: Is it possible to have listed all available categories on `www.example.com/category/` request. Using the following url as mentioned in my example generating 404 error.


title: Applying same style to all the comments on the page

text: I have this code below: `#comment-1, #comment-2, #comment-3 { width: 70%; margin: 1em 0 0.5em 0; }` This CSS is to format the comments for them to be 70% of the parent div's width. I see where it breaks after 3 comments, how do I get it to apply to all the comments on the page regardless of the number?


title: Infinite scroll jPlayer callback with PHP and post id?

text:
How can I call the correct callback function for infinite scroll plugin on WordPress with variable `<?php the_ID() ?>` ? I'm trying to connect jPlayer like this: Code in php:
          <div id="jp_container_<?php the_ID(); ?>">

             <div id="jquery_jplayer_<?php the_ID(); ?>" class="jp-jplayer">
     <div id="jp_interface_<?php the_ID(); ?>" class="jp-interface">

play

pause

stop

     <?php if ($my_meta = get_post_custom_values( 'extra', $ID )) { ?>     <a href="<?php       global $wp_query;     $postid = $wp_query->post->ID;     $extra = get_post_meta($postid, 'extra', true);      echo $extra; ?>" class="jp-extra" tartabindex="1" title="Слушать через устройство">     <?php } else { ?>     <a href="<?php       global $wp_query;     $postid = $wp_query->post->ID;     $extra = get_post_meta($postid, 'radio', true);      echo $extra; ?>" class="jp-next jp-extra" title="Слушать через устройство">
     <?php } ?>

                         Ошибка!                         Установите Flash Player.

      What browsers give me:

play

pause

stop

                         Ошибка!                         Установите Flash Player.

      When a new post is loaded with infinite scroll, the players do not work. If I set the ID manuall without PHP (for example `$("#jquery_jplayer_1705").jPlayer())`, it works fine. The player may be more 100 pieces and to manually add each one would be very hard.


title: do_shortcode() doesn't do shortcodes ;)

text:
Imagine this basic shortcode in your functions.php file:               function div_shortcode( $atts ) {        return '

';     }          add_shortcode('div', 'div_shortcode');      So every `[div]` in Wordpress editor gives `<div class="div"></div>`. Everything looks and works fine, right? Now here comes the trouble. I need to use my shortcode in PHP file (not putting it via WP Text Editor). Luckily there's a function for that:               <?php do_shortcode('[div]'); ?>       But, wait, it shows... nothing?               <?php do_shortcode('[gallery]'); ?>       Even this one doesn't work. Why is that happening? Any ideas?


title: Limitations when adding new users

text: I began adding new users to my site tonight, all as authors. Is there a limitation to the number of users or how quickly they are added, after adding the 50th user there seems to be a minute or two delay before wordpress will allow me to add the next user.


title: Illegal offset type in get_post_type_object()?

text: I'm getting the following warning in my WP admin custom posts listings page (`wp-admin/edit.php?post_type=video`)               Warning: Illegal offset type in isset or empty in wp-includes/post.php on line 817      I'm running WordPress v3.1.3 (latest). Line 817 is in the function `get_post_type_object()` . A search finds me these threads:   * http://wordpress.org/support/topic/warning-illegal-offset-type-in-isset-or-empty   * http://wordpress.org/support/topic/error-when-searching-for-posts-in-the-backend-illegel-offset These mention some different potential causes - e.g. it might be https://core.trac.wordpress.org/ticket/12704 - but that's now fixed (I'm running v3.1.3) - and the final post in one reads: > Basically, you have a plugin registering a post type incorrectly, and then > core complains. It isn't a bug in core best I can tell. I do have a plugin (my own) registering a post type, but I think it's doing it correctly. Here's the code. (Note that I was originally calling these "video" posts but later renamed the front-end description to "Training Module", but left the original post-type name).               function video_register() {         $labels = array(             'name' => _x('Modules', 'post type general name'),             'singular_name' => _x('Training Module', 'post type singular name'),             'add_new' => _x('Add New Module', 'video item'),             'add_new_item' => __('Add New Training Module'),             'edit_item' => __('Edit Training Module'),             'new_item' => __('New Training Module'),             'view_item' => __('View Training Module'),             'search_items' => __('Search Training Modules'),             'not_found' =>  __('No Training Modules found'),             'not_found_in_trash' => __('No Training Modules found in Trash'),             'parent_item_colon' => ''         );         $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'show_ui' => true,             'query_var' => true,             'has_archive' => 'video',             'menu_icon' => 'video16x16.png',             'rewrite' => array('slug'=>'training','with_front'=>false),             'capability_type' => 'post',             'hierarchical' => false,             'menu_position' => '15',             'supports' => array('title','author','editor','custom-fields','revisions','comments','trackbacks'),             'taxonomies' => array('category', 'post_tag')           );         register_post_type( 'video' , $args );     }     add_action('init', 'video_register');      Is there a problem there? Why am I seeing the warning?


title: Unable to stream pdf: headers already sent problem in dompdf

text:
I have used dompdf to display the user information in admin of my wordpress project. While generating the PDF file it works perfectly in my local server. But in live server `Unable to stream pdf: headers already sent` message is displayed. The page where pdf is generated is `http://mysite.com/wp- admin/admin.php?page=certificate&id=4`. The file for this link is `include(ABSPATH."wp- content/themes/ncc/certificate.php");` Here is the code I have used               <?php     require_once("dompdf/dompdf_config.inc.php");     ob_end_clean();     ob_start();     ?>

                 Certificate

                 Name

                 Email id

          <?php     $data = ob_get_clean();     $old_limit = ini_set("memory_limit", "64M");     $dompdf = new DOMPDF();     $size = array(0,0,800.00,700.00);     $dompdf->load_html($data);     $dompdf->set_paper($size);     $dompdf->render();     $dompdf->stream('certificate.pdf');     ?>      Can anyone help me what is the creating problem here. Thanks in advance


title: Retrieve latest post by multiple categories with ID

text:
I have the categories listed below in my `product` post type.               Category Name: Test 1 ID: 82     Category Name: Test 2 ID: 83     Category Name: Test 3 ID: 84     Category Name: Test 4 ID: 85      Now I want to retrieve for each category one post -- the last one added. I have tried below code but it isn't working right.               <?php         $args = array( 'product_cat_' => 82,83,84,85, 'post_type' => 'product', 'orderby' => 'post_date', 'order' => 'DESC', 'post_status' => 'publish', 'posts_per_page' => 4 );          $postslist = get_posts( $args );             foreach ($postslist as $post) :  setup_postdata($post);      ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
           <?php endforeach; ?>


title: Can't Update File Permissions on SSH connection for Use in WordPress

text: I am working with a WordPress site and am having all sorts of problems since I'm running it on SFTP. I've updated my wp-config.php file so I can authenticate plugins and updates but WordPress is still having trouble doing a lot of different things on the site because of file permission issues. First off, the file permissions are set like every other WordPress site I've worked on (folders at 775 and files at 664. For some reason, though, it can't access certain files (I have a feeling it's why my permalinks keep breaking when I try to update them). I've gone into Cyberduck and done the standard update to the file permissions but it always immediately reverts right back to the 775 and 664. I was just trying to set them to 777 to see if it would alleviate the problem but I can't even do that. Is there a reason my WordPress site can't read files that are on an SSH server? Thanks for your help (I wasn't really sure if I should post this here or in the WordPress forum since it deals with a couple issues...).


title: WP 3.5 media manager - how to create a working gallery frame

text: i am writing a plugin and after hours and hours of searching for any documentation on WP 3.5 media manager i managed to create my custom media frame that is being called when a user clicks on a custom TinyMCE button in that i added. this is the working code that inserts a single image:                onclick: function(e) {         var dej_frame;         e.preventDefault();                   // If the frame already exists, re-open it.         if (dej_frame) {             dej_frame.open();             return;         }              //create media frame         dej_frame = wp.media.frames.dej_frame = wp.media({             className: 'media-frame mojo-media-frame',             frame: 'post',              multiple: false,              state: 'insert',             library: {                 type: 'image' //Only allow images             },         });              dej_frame.on('insert', function() {                  var media_attachment = dej_frame.state().get('selection').first().toJSON();                            ed.execCommand('mceInsertContent', false, 'this will be instered in editor');         });              dej_frame.open();               }      This is working for single image. But, when i try to add gallery nothing happens. I do not know and couldn't find in the source (it's either too confusing or i am too stupid for this) I know that i need to write my own function that will add galleries, only i don't know what's the actual name of the function, how should it be called??


title: custom post type search by reference id

text: I have a custom content type of `tab_content` with a relationship to a `page`. In my current script I have the _id_ of a `page` and I want to do a query that will list all the children of type `tab_content` that have the relationship of a `page` with the specified id. All I have so far is:               new WP_Query(array('post_type' => 'tab_content'));      How do I tell the query that the custom field `parent` needs to be something like `80`? Thanks


title: Remove field in comment reply form

text:
I am trying to add in the below function a check to see if the comment depth is greater than 1, or if the comment is a reply so the 'My Rating' option does not appear when it is a comment reply. Or need the my rating field to be hidden or not displayed when on reply in CSS.               if($userRatingsEnabled) {         //get the ip address                     $ip=$_SERVER['REMOTE_ADDR'];         if(strpos($meta,$ip) === false) {         if ( $depth <= 1 ) {                   echo '
'. __('My Rating','made') . '
';                  echo '
<select id="rating" name="rating"><option value="">---------</option>';      ...more code Please help! Thanks,


title: Replace the slug of parent pages with #

text: I'm creating a Wordpress site with a Superfish CSS3 / Jquery dropdown menu, complete with hoverIntent as displayed here: http://users.tpg.com.au/j_birch/plugins/superfish/#examples As far as I can see, this menu works well on mobile devices, because the link values refer to the same page, like `#a`, so that clicking a link does not cause the page to reload. Please bear with me. I know that the right way would be to replace the dropdown menu entirely (with a select box or some other tool), but I need to have the exact same experience as on a desktop (long story). My question is: how can I replace the href value of parent pages, with an internal link like `#a`? My guess would be that doing this via jQuery would be the best solution. What are your views on this and could someone please provide a practical answer? Thanks in advance.


title: Listing all child-pages of a parent-page on the parent-page and each child-page?

text:
I have a parent page called "About". This page has three child pages "Members", "Information", "Contact". I want to list all the child-pages on all four pages, also the parent-page. So right now I have this which lists all the child-pages only on the parent-page.               <?php             if ( !$post->post_parent ) {                 echo '
';                     wp_list_pages("title_li=&child_of=".$post->ID."&link_before=— ");                 echo '
';             }         ?>      But I want all the pages also listed on each individual child page. How do I do that?


title: authenticate user without redirecting

text: I am working on a form (Gravity Form) which needs some user authentication when the form is submitted. Gravity's documentation pointed out the place where i should place my code. i.e. > gform_pre_submission_filter I tried using SimpleModal Login, but problem comes when the user is authenticated and it is redirected either to the dashboard (default) or using redirect_to. This causes all fields reset to defaults. Question is how can i preserve my form's (gravity form) entries and still authenticate and login the user?


title: Wordpress truncate posts question (plug-in related)

text: I'm using a plug-in ("Wordpress plugin random post slider") for Wordpress that pulls a random post from a category, and displays it in a slider for use as a shortcode or php code in a template. I've already made some modifications to the plug-in to get it to display properly on my site (http://lillypillyps.com.au), but it has some limitations that the developer will take forever to follow up on. I was wondering if someone might be able to help with the following questions in order of importance:   1. it's using some sort of truncate on the post content which is currently set to 170 characters (through the plug-in's settings page in the admin of WP). I want it to truncate to the nearest word so it doesn't cut-off mid-word.   2. is it possible to ONLY have the "... READ MORE" button display IF the content is longer than the truncation point? ie. not display if the content is less that 170 characters.   3. there is a few options for the transitions between the slides (scrollLeft/scrollRight/scrollUp/scrollDown), but the same jquery should be capable of fade-in/fade-out shouldn't it? How can I used this transition instead of the ones the plug-in "allows" me to use?


title: Count total number of post in foreach loop

text: I used the the following script (only with get_permalink....) to display posts from a post type where the post author has an extra meta field on his user page:               <?php // get users from user page         $blogusers = get_users();         foreach ($blogusers as $user) {             if(get_field('races','user_' . $user->ID)) {             while(the_repeater_field('races','user_' . $user->ID)) {                 $signed_up = get_sub_field('race_name', $post_object->ID);                 if($original_id == $signed_up->ID) { //original ID is the race_name post we are on                       $user_info = get_userdata($user->ID);                          $arg = array(                      'post_type' => array ('members'),                     'post_status' => array( 'publish'),                     'posts_per_page' => 200,                     'author' => $user_info->ID                     );                     $arg_query = new WP_Query();                     $arg_query->query( $arg );                          echo $total = $arg_query->post_count;                      } else {                 }             }         }     } ?>      While it worked to display titles of the posts from the members post type, I can't get my head around to count these posts. It shows: 1 1 1 instead of 3 and so on. How can I change the foreach to work properly?


title: Warning: Illegal string offset 'width'

text: Recently when I try to view the jpeg or png files in the media library, I got the messages Warning: Illegal string offset 'width' in /home/strataco/public_html/wp/wp- content/themes/twentyeleven/image.php on line 34 Warning: Illegal string offset 'height' in /home/strataco/public_html/wp/wp- content/themes/twentyeleven/image.php on line 35 and I can't edit or view the photos. In addition, the header image and sidebar on my site cannot be displayed. Anybody has any idea and how to solve this.


title: How to store accumulate multiple option values in a single array using Options_API

text: I have created an option array that stores a series of options, along with their values. The problem is that I want to ACCUMULATE these options and store them in the options database. Meaning I would be able to add multiple records to the database, instead of only updating a single option. For example, I need to store testimonials that will allow the user to keep the name/testimonial for several different people (i.e. Brad's testimonial, Carrie's Testimonial, etc), so the option would need the ability to add multiple records. Hopefully this is enough description. Here's my current options code:               add_option( 'testimonials_settings', $testimonials_options );               $testimonials_options = array (     'testimonials_active' => '0',     'testimonials_name' => '',     'testimonials_website_name' => '',     'testimonials_website_url' => '',     'testimonials_quote' => ''     );          if(isset($_POST['testimonials_update_options'])) {        $options = get_option('testimonials_settings');         $options['testimonials_active'] = $_POST['testimonials_active'];        $options['testimonials_name'] = $_POST['testimonials_name'];        $options['testimonials_website_name'] = $_POST['testimonials_website_name'];        $options['testimonials_website_url'] = $_POST['testimonials_website_url'];        $options['testimonials_quote'] = $_POST['testimonials_quote'];     update_option('testimonials_settings', $options);     }


title: What is the right way to include a wp-admin file in your theme?

text: I'm trying to use `wp_delete_user()` in my theme, to allow a user to delete their account from the front-end. Turns out that the `wp_delete_user()` is not defined unless /wp- admin/includes/user.php has been included. Is there a _right_ way to do this in WordPress? Something that uses get_bloginfo() or a global constant for example?


How can this be achived? Replace the post count on wp_list_categories with "Has Posts" instead of number and "No Posts" if none.


title: Mysql query and odd results

text: I've a query here :               $sql = "SELECT ID,post_title,post_content,post_date,post_type      FROM {$wpdb->posts}      WHERE post_content LIKE {$stuff}      AND post_status = 'publish'      AND post_type = '{$post_type}'      AND ID != {$post->ID}      LIMIT {$limit}";     $results= $wpdb->get_results($sql);      `$stuff` is a `%keyword%` and `$post_type` is a post type slug, the odd thing here is that when I use e.g. `articles` as post type, results also contains posts with `revision` status and `page` or `post` type and it seems that `if statements` like `post_type = '{$post_type}'` and `post_status = 'publish'` doesn't work at all!! What should i do? _**Update_** I did a `print_r()` for `$sql` : `SELECT ID,post_title,post_content,post_date,post_type FROM wp_posts WHERE post_content LIKE '%Battery%' OR post_content LIKE '%Watcher%' OR post_content LIKE '%Widget%' OR post_content LIKE '%matches%' OR post_content LIKE '%built%' OR post_content LIKE '%HTC%' OR post_content LIKE '%widgets%' OR post_content LIKE '%Please%' OR post_content LIKE '%check%' OR post_content LIKE '%Thrutu%' OR post_content LIKE '%day%' OR post_content LIKE '%job%' OR post_content LIKE '%app%' OR post_content LIKE '%donate%' OR post_content LIKE '%buying%' AND post_status = 'publish' AND post_type = 'articles' AND ID != 1388 LIMIT 4`


title: I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?

text: When looking at my "All Pages" they are listed in Alpha order, and I have to scroll through to find what I am updating. Is there a way to have a preference setting that it be sorted by date, without having to tell it every time to do that?


title: Wordpress to end support for PHP 4?

text: Recently getting into wordpress plugin development, I started to investigate how to make my code backward compatible to php 4+. I've focused only on php 5.1+ for the past 5 years, so this was an ordeal. Anyway, when looking at some plugins, one of them had this description: > IMPORTANT: This plugin is not compatible with PHP 4. If you try to install > it on a host running PHP 4, you will get a parse error. WordPress is ending > support for PHP 4 as of version 3.2 Is it true that wordpress is going to stop supporting php prior to php 5?


title: redirect old pages by .htaccess

text: i want to redirect pages from **sitename/sitename/pagename.html** and **sitemap/sitename/** to               sitemap/sitename/pagename       how i can do that by using . **haccess** file i tried this code RewriteEngine On RewriteBase / RewriteRule . /sitename/index.php [L] RedirectMatch 301 (.*).html$ sitename/$1 and i tired also to add                Redirect 301 sitename/sitename/      but it is not working but i think both not working because it still gives me an error when i open www.sitename.com/pagename.html


title: wordpress remove views from action links in a custom post

text: I have created a custom post type, but I want to remove the View link from actions, in the listing of the custom post. I have tried this snippet                  add_filter( 'post_row_actions',array(&$this, 'remove_row_actions', 10, 1));        public function remove_row_actions($action){            unset($action['view']);            return $action;        }      But it throws > `call_user_func_array() expects parameter 1 to be a valid callback, array > must have exactly two members in D:\wamp\www\wordpress\wp- > includes\plugin.php on line 173`


title: need help looping add_action in wp

text: i would like to know the proper way to do this               $dynValue=5;//loop this many times     //start of my loop     for ($num=1; $num <= $dynValue; $num++){          //note the incremented number ($num) in the call back     add_action('add_meta_boxes', 'mpc_meta_box_'.$num.');          //below is where im having the problem     // i am trying to increment this function name so i will not get the error that "function name has already been declared". i cannot add '.$num.' in the func name below cause its not valid php.     function mpc_meta_box_'.$num.'(){     //some content     }          }//end of my loop      i can do this with eval() but i know its not recommeneded


title: Looking for a way to take readers to random post when clicking a link

text: I did some reasearch but couldn't find a way to do it. Just to be clear I don't want to show a widget list of random posts on the sidebar. I want the ability for reader to click on a link that says "Random Post" and it will take them to a random post from my archive. How would I do it? I am php noob, so working code snippet would be much appreciated.


title: Same posts from my homepage are on all of my different page

text:
I see that you solved the problem of a WordPress user memo-maritime two years ago "Same posts from my homepage is on all of my different pages".The same problem i have.What should I do?I installed Pagenavi but not working.Theme by default(default.php) is something like this:               <?php endwhile; ?>

<a href="<?php echo get_option('woo_archives'); ?>" class="more"><?php _e('SEE MORE ARTICLES IN THE ARCHIVE',woothemes); ?>

      Now I installed pagenavi and I modified it in blog.php:               <?php endwhile; ?>

          <?php wp_pagenavi(); ?>      and in default.php I left as I mentioned above, nothing happens anyway, I tried.Contrary send me the exactly same page that is repeated on all 3 pages.I tried to fixed many times, but nothing happens,the same..I do not know exactly where would be this issue, maybe it is not there.If I change the theme,works!So the problem is the current theme..this function is repeated somewhere Many Thanks in advance


title: Using a page as home, how do I prevent nav from setting both home and page links active?

text: Let's say we have a site with four items in a managed menu, corresponding to pages: > Home | Foo | Bar | Baz The "Home" item is a custom link pointing at "/".   And we want the "Bar" content shown on the home page, so in Settings, we specify that for the front page. When visiting the homepage, both "Home" and "Bar" get active classes, resulting in styling(`.current-menu-item / .current_page_item`) like: > **Home** | Foo | **Bar** | Baz …when it seems reasonable to expect that only Home be highlighted. Did I do something wrong here, or is this actually buggy(or at least sub- optimal) behavior? And is there a relatively painless way to correct it in templating? I can undo the styling pretty easily with a bit of page-targeted CSS, but it's a workaround to the actual problem and I'm curious if there's something I'm missing in the theming.


title: How to find the page the front page is using?

text: I use WordPress theme Shiny. I had someone else do my site and now I am trying to figure out how to edit the homepage. The theme version is version 1.0.2. How can I edit my homepage?


title: How to add an excerpt and read more link to a page?

text: I've a custom/static "homepage.php" in my templates directory at my WordPress. Now I need to show differents "page excerpts" in my homepage, but I don't know what should be do it. At this moment I've in my "functions.php" de following function:               function excerpt_page() {       add_post_type_support( 'page', 'excerpt' );     }     add_action('init', 'excerpt_page');      With this function, I've in my Page editor a new field available where I can put an summary of the page. Somebody has any idea?


title: Permalinks not working (404) for the 'item' post type

text: I have searched various forums and blogs, however I could not find the isuse so far, neither a way to fix it. `item` does not seem to be a wordpress-reserved word. My custom post type registers just fine. I can work with it from admin, edit, delete, preview, assign terms, publish... . However any time I try to visit the permalink (e.g. `http://www.example.com/item/test-item-77/`) it goes to the 404 page! Had someone tried this out with the latest version of WP?


title: Sorting By Custom Posts With Attachments

text: I think I've got this figured out and I'd like to make sure I'm not missing anything obvious. My goal is to prioritize a list of results by custom posts with attachments. So, I have a query returning say 60 results and, of those 60, 40 have attachments. I'd like those to show first, then continue with the posts that don't have any attachments. Given the limitations of the "orderby" parameter my method of attack is as follows:   1. Create a custom field ("has_attachment") that is updated "true" if the post has any attachments. Tie the update into an action (e.g. "attachment_fields_to_save").   2. Run a query to set the value to true on posts that already have attachments. I would _like_ to make this bulletproof and go so far as to empty the field in the event that all attachments to the post are deleted. That's not necessary in my use-case, though, as the likelihood is slim. Anyway, I'd like to see if any of you have suggestions for improving my method or ideas for a different way to approach this. Otherwise, I'll get to work!


title: How to remove custom post type name from base url?

text: How can I remove custom post type slug from my base url ? for eg : mywebsiteurl.com/custom-post-slug/postname I would like to make it mywebsiteurl.com/postname instead .


title: How to get post id of last approved comment?

text: Can you help me with something simple? How can I get the post id of the last approved comment? I want to assign it to a variable. Thanks so much in advance!


title: Loop not displaying comments_popup_link

text:
I cannot get the `comments_popup_link` to display with the posts retrieved by the foreach loop. Only the title and permalink are displayed. Any idea why the comment link is left out?               <?php       if(count($ids)){         echo '
News

';         foreach($ids as $id){            echo '
'.get_the_title( $id ).'';            if ( comments_open() ) :            echo '
';            comments_popup_link( '', '1 comment', '% comments', '');            echo '
';            endif;         }         echo '

';        }


title: gallery PHP & CSS

text: I am creating my own theme, and in order to display a gallery I want to add the PHP to call the gallery, and then use CSS to style it. I am using the plugin from the following site and when i follow the process in the page below I get errors. could someone shed some light on the PHP required to display a gallery within a div so that i can theme it. added to plugin                   <?php         remove_shortcode('gallery');         add_shortcode('gallery', 'parse_gallery_shortcode');          ?>      added to `function.php`                            <?php                  function parse_gallery_shortcode($atts) {                       global $post;                       if ( ! empty( $atts['ids'] ) ) {             // 'ids' is explicitly ordered, unless you specify otherwise.             if ( empty( $atts['orderby'] ) )                 $atts['orderby'] = 'post__in';             $atts['include'] = $atts['ids'];                  }                  extract(shortcode_atts(array(             'orderby' => 'menu_order ASC, ID ASC',             'include' => '',             'id' => $post->ID,             'itemtag' => 'dl',             'icontag' => 'dt',             'captiontag' => 'dd',             'columns' => 3,             'size' => 'medium',             'link' => 'file'         ), $atts));                   $args = array(             'post_type' => 'attachment',             'post_status' => 'inherit',             'post_mime_type' => 'image',             'orderby' => $orderby         );              if ( !empty($include) )             $args['include'] = $include;         else {             $args['post_parent'] = $id;             $args['numberposts'] = -1;         }              $images = get_posts($args);              foreach ( $images as $image ) {                 $caption = $image->post_excerpt;                  $description = $image->post_content;             if($description == '') $description = $image->post_title;                  $image_alt = get_post_meta($image->ID,'_wp_attachment_image_alt', true);                  // render your gallery here             echo wp_get_attachment_image($image->ID, $size);                }     }


title: Authors Page : A page of authors

text: I'm looking for a way to create a parent authors page and then use the `author.php` for the individual author pages. I've been out of the loop (no pun) for a couple months and am wondering the best way to do it.


title: "add from media library" tab is super slow

text: The add from media tab for wordpress is _super slow_ on my local. It takes at least a full minute for the modal box to load content when I click that tab. I am guessing it is because I have 65 pages of images and WP is loading all 65 pages. Is there a good plug-in or a hack out there to help speed up content loading when adding feature images to posts from the medial library? Thanks.


title: The Events Calendar Plugin - List View Background Colour Issue

text: I'm trying to look for some help, I've got a WordPress website that I'm working on. I'm using this plugin called **The Events Calendar** , but in List View, the background keeps showing in transparency... Would somebody be able to help me trigger and find where in the code I can change the background color instead of having it in transparency? Here is the link: http://bit.ly/1cJlC8e


title: Help on conditional statement to accompany wp_insert_post function please?

text:
I'm trying to programatically insert posts from an external MySQL database as posts on my wordpress blog, I've got something that works, but there is no way of wordpress checking to see if the post already exists before it inserts a new post at the moment, so I'm getting lots of duplicate entries. I'm sure for anyone who knows how, we're talking about some simple conditional if, else statements here, but I can't get my head around what to check for to make sure that the post hasn't already been added to the wordpress database? I've figured its something of a distinction between wp_insert_post and wp_update_post, I just can't figure out what to check against and how I get wordpress to check each entry? Do I need to add some custom_meta data? Or can the conditional statement check against the title or date for example? Really appreciate any help of advice anyone can suggest? Thanks a lot! My code is as follows:                                   if( ) {                              // Create post object                         $post = array();                         $post['post_title'] = $user ." said " . $text;                         $post['post_content'] = "
" . $user . " " . $date .":
" . $text . "

\n";                         $post['post_status'] = 'publish';                         $post['post_date'] = date("jS F Y, G:i.s", $date);                         //$post['post_type'] => 'post';                              // Insert the post into the database                         wp_insert_post( $post );                           }                      else {                         // Update post object                         $post = array();                         $post['post_title'] = $user ." said " . $text;                         $post['post_content'] = "
" . $user . " " . $date .":
" . $text . "

\n";                         $post['post_status'] = 'publish';                         $post['post_date'] = date("jS F Y, G:i.s", $date);                         //$post['post_type'] => 'post';                                   // Insert the post into the database                         wp_update_post( $post );                  }


title: Is it possible to sort posts by vote using the GD Star Rating plugin?

text: Anyone has experience using the GD Star Rating plugin? and make a loop that sorts posts by vote/stars?


title: post_row_actions for custom post type

text: I'm using this code to have a duplicate post function in WordPress Admin. However, when I add the filter for a custom post type, like this:               add_filter( 'directory_row_actions', 'rd_duplicate_post_link', 10, 2 );      (The Custom Post Type has a registered name of `directory`) - it doesn't add it to the action row underneath the entry title. When I do it for the posts or pages, like this:               add_filter( 'post_row_actions', 'rd_duplicate_post_link', 10, 2 );      it works perfectly. I've been reading that `post_row_actions` has been deprecated but I can't find anywhere that says it's replacement. Does anyone know how to get this working for my Custom Post Type?


title: Hide page visual editor if certain template is selected?

text: How do I hide the page editor (WYSIWYG editor) if the current page is set to a certain template. I have the following code already to add in custom meta boxes when certain templates are chosen:               add_action('admin_init','my_meta_init');     function my_meta_init()     {         $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];         $template_file = get_post_meta($post_id, '_wp_page_template', TRUE);              $savemeta = true;              if ($template_file == 'template-page-2quotes.php') {             add_meta_box('main_quote_meta-meta', 'Top Quote', 'main_quote_meta', 'page', 'side', 'low');             add_meta_box('sub_quote_meta-meta', 'Right Hand Side Quote', 'sub_quote_meta', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-1quote.php') {             add_meta_box('sub_quote_meta-meta', 'Right Hand Side Quote', 'sub_quote_meta', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-factsnfigures.php') {             add_meta_box('facts_n_figures-meta', 'Amount Raised', 'facts_n_figures', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-fundraising.php') {             add_meta_box('fundraising_ideas-meta', 'Fundraising Ideas', 'fundraising_ideas', 'page', 'side', 'low');         } else {             $savemeta = false;           }         if($savemeta == true) {             add_action('save_post','my_meta_save');         }     }      What I would like for example is that the editor is removed if `$template_file == 'template-page-2quotes.php'` Edit (Working Code):               add_action('admin_init','my_meta_init');     function my_meta_init()     {         $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];         $template_file = get_post_meta($post_id, '_wp_page_template', TRUE);              $savemeta = true;         $hideeditor = false;              if ($template_file == 'template-page-2quotes.php') {             add_meta_box('main_quote_meta-meta', 'Top Quote', 'main_quote_meta', 'page', 'side', 'low');             add_meta_box('sub_quote_meta-meta', 'Right Hand Side Quote', 'sub_quote_meta', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-1quote.php') {             add_meta_box('sub_quote_meta-meta', 'Right Hand Side Quote', 'sub_quote_meta', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-factsnfigures.php') {             add_meta_box('facts_n_figures-meta', 'Amount Raised', 'facts_n_figures', 'page', 'normal', 'low');         } elseif ($template_file == 'template-page-fundraising.php') {             add_meta_box('fundraising_ideas-meta', 'Fundraising Ideas', 'fundraising_ideas', 'page', 'side', 'low');         } elseif($template_file == 'template-page-news.php') {             $hideeditor = true;             $savemeta = false;         } else {             $savemeta = false;           }         if($savemeta == true) {             add_action('save_post','my_meta_save');         }         if($hideeditor == true) {             add_action('admin_print_styles', 'admin_no_editor_style');         }     }     function admin_no_editor_style() {         echo "<style>#postdivrich{display:none;}</style>";     }


title: Delete associated thumbnails when calling wp_delete_attachment

text:
I have a somewhat straightforward script that allows users to upload their own avatar from the front-end. Another script allows them to delete their avatar, before uploading another. The image/attachment ID for each avatar is stored as user meta. When the user chooses to delete their avatar, I call wp_delete_attachment() like so                   //DELETE AVATAR         if( $_POST['explorer_delete_avatar'] == 'on' ) {             $attachmentID = get_field('explorer_profile_custom_avatar', 'user_'.$userID);             if( wp_delete_attachment($attachmentID, true) !== false ) {                 $user_meta['explorer_profile_custom_avatar'] = '';             }             else {                 $errors[] = 'Could not delete your profile portrait.';             }         }      This properly deletes the original file that was uploaded, but not any of the thumbnails that were generated. I'm seeking the most efficient way to also delete the thumbnails. A few searches didn't reveal anything in the Codex or readily apparent on Google. Something tells me this should be fairly straight-forward. Any suggestions for a fellow hacker? **Here's a bit more on my script's workflow**               <?php     //FORM NOT SUBMITTED, ALLOW UPLOAD     if( !$_POST ) {         echo '<form action="'.get_permalink($post->ID).'" method="post" enctype="multipart/form-data" id="explorerAvatarUpload">';         echo 'Please choose a file for your portrait.';         echo '<input type="file" name="explorer_avatar_src" />';         echo '<input type="submit" name="explorer_portrait_upload_submit" value="Upload Portrait" />';         echo '</form>';     }          if( $_POST['explorer_portrait_upload_submit'] ) {     //UPLOAD SUBMITTED, ADD AS ATTACHMENT     //HANDLE THE UPLOAD         require_once(ABSPATH . 'wp-admin/includes/image.php');         require_once(ABSPATH . 'wp-admin/includes/file.php');         require_once(ABSPATH . 'wp-admin/includes/media.php');         $imgID = media_handle_upload('explorer_avatar_src', 0); //Passed to the crop form as a hidden field              //SHOW THE CROPPER         // Basic implementation of jCrop, ManifestCrop class handles showing the appropriate JS and hidden form fields         echo '
Crop your profile portrait
';         echo 'Drag and drop over the large image to crop.';         $crop = new ManifestCrop($imgID, 110, 110);         $crop->showCropper();     }          //The crop has been designated and dimensions are available     if( $_POST['crop_submit'] ) {         $src_path = get_attached_file($_POST['imgID']);              //Instantiate WP_Image_Editor class for cropping         $img = wp_get_image_editor($src_path);         $img->crop($_POST['crop_x'], $_POST['crop_y'], $_POST['crop_w'], $_POST['crop_h'], 110, 110);         $saved = $img->save($src_path); //We've saved a new image, but it's unattached              //Delete the original upload (uncropped source image)         wp_delete_attachment($_POST['imgID'], true);              //Attach the new image (cropped down to 110x110)         $args = array(         'guid' => $saved['path'],         'post_mime_type' => $saved['mime-type'],         'post_title' => basename($filename),         'post_content' => '',         'post_status' => 'inherit'         );         $imgID = wp_insert_attachment($args, $saved['path'], 0);              //Regenerate the attachment's metadata (for the cropped image)         require_once( ABSPATH . 'wp-admin/includes/image.php' );         $attachment_metadata = wp_generate_attachment_metadata($imgID, $saved['path']);         wp_update_attachment_metadata($imgID, $attachment_metadata);              //UPDATE THE USER META         $prev_avatar = get_user_meta($userID, 'explorer_profile_custom_avatar', true);         $prev_avatar = $prev_avatar ? $prev_avatar : '';         update_field('explorer_profile_custom_avatar', $_POST['imgID'], 'user_'.$userID);     }     ?>


title: What is the best way to store a few fields?

text: I'm researching what it would take to develop a custom Wordpress plugin. The plugin is a pretty small one. We just need to persist 2 fields of integer information. It's a pretty basic progress bar with current progress (int) and goal (int). Is there a simple way of storing that amount of information in Wordpress? Is there a simple API for storing things like this in the db? Or, should I just persist by writing to a basic xml or json file on disk? Thanks for any help.


title: How to: Update live sites theme from version control repo via plugin or library?

text: Maybe someone knows how i could update my live sites theme from a version control*) project repository. Point is that it's really time consuming if you got your theme hosted with version control _(as an open source project)_ , have a live site that uses the theme and maybe also make it available else where. Normally that means half an hour until you got everything running after you wrote an update/commited something. I've seen it once that a server got a "live" update via a git project, but so far couldn't find out how this would be done. Nice would be if there's a plugin out there that does this already. Libraries or similar are also ok. *) The Q is about Github, Bitbucket, etc. and it also doesn't matter if the solution is git or svn based. Thank you!


title: Comment reporting for Multisite

text: I'm trying out the 2 comment reporting plugins that I know about in a multisite installation.   * AJAX Report Comments   * Safe Report Comments Both don't work - various javascript errors and (I assume) not taking into account the differences between single and multisite WP. Does anyone know of a working comment reporting plugin for Multisite, or has anyone run into issues with the above plugins before? [Update] Using Ajax Report Comments   * Clicking on the "Report comment" link correctly opens a textbox.   * Clicking on the "Report comment" button (which should fire off the report) raises the following error in chrome's javascript console              Uncaught SyntaxError: Unexpected token       mysack.onCompletion       runAJAX.xmlhttp.onreadystatechange      The inserted javascript is as follows:


title: Can a user find a child page?

text: When editing a page, instead of the expected content, all the user sees is this:               [child-pages depth="1" sort_column="post_title"]      How can the user find that page in order to edit it?


title: wp_nav_menu remove class and id from li

text:
I'm new to wordpress and trying to learn my way through from making a theme. Right now I am using wp_nav_menu to generate my menu My menu consists of pages and categories However, the default generation of the menu looks like

      I want to remove all the class and id from li and ul. I have been googling for awhile now. Tried different methods and no luck. Any help would be much appreciated. I'm currently using Wordpress 3.1 Thank you in advance!


title: Widget redirecting to home page

text:
Am trying to create a widget that searches for names. The searching and all that is fine, but when I hit submit, I get returned to the front page. I tried messing with the action="", but no matter what I change it to, the widget still redirects to the home page. Am sure it's simple, I just can't figure out what am doing wrong. Any help is appreciated!                   <?php         require_once('include/functions.php');              if( !defined( 'ABSPATH' ) ) { exit;}             class HNDomainSearchWidget extends WP_Widget         {     function HNDomainSearchWidget()      {         $widget_ops = array(             'classname' => 'HNDomainSearchWidget',             'description' => 'Search for domains on your site.'         );         $this->WP_Widget('HNDomainSearchWidget', 'HobiNom Domain Search', $widget_ops);     }          // admin form, in the widget page     function form($instance)     {         global $wpdb;         (isset($wpdb->base_prefix) ? $_prefix = $wpdb->base_prefix : $_prefix = $wpdb->prefix);           $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );     $title = $instance['title'];         // allow for updating the widget name         ?>
             <label for="<?php echo $this->get_field_id('title'); ?>">Title:              <input class="wide" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" />
         <?php         }          function widget($args, $instance)      {          global $wpdb;         global $post;              $referrer = $_SERVER['HTTP_REFERER'];              // widget sidebar output         extract( $args );         // these are the widget options         $title = apply_filters('widget_title', $instance['title']);         $text = $instance['text'];         echo $before_widget;              // Display the widget         echo '
';              // Check if title is set         if ( $title ) { echo $before_title . $title . $after_title;}              // the actual search get_permalink( $post->ID );          $pid = (isset($post->ID)) ? get_permalink($post->ID) : '';         //echo '<form role="search" method="get" id="domainsearch" action="' . esc_url( home_url( '/' ) ) . '?search_for_domain" >';         echo '<form role="search" method="get" id="domainsearch" action="'. $pid .'" >';         echo '<input type="text" name="domain" value="Domain.com" onfocus="this.value = \'\';" />';         echo '<input type="submit" value="' . __( 'Search' ) . '" name="search_domain" />
';         echo '
</form>';              $this->search_for_domain($_GET['domain'], get_permalink( $post->ID ));              echo $after_widget;     }          // update widget options     function update($new_instance, $old_instance)      {         $instance = $old_instance;         // Fields         $instance['title'] = strip_tags($new_instance['title']);         return $instance;     }          function deactivate()     {          delete_option('HNDomainSearchWidget');         }               // process the widget input and search for domain using     function search_for_domain($search_domain, $permalink)     {         $referrer = $_SERVER['HTTP_REFERER'];              if(isset($search_domain))         {             // get details to access             $hobinom = new hobinom_db();                   $current_user_id = get_current_user_id();             $details = $hobinom->get_details($current_user_id);                  $username = $details['username'];               $password = $details['password'];                   // separate the data from domain and tld             // explode makes each subsequent . a new array, so domain.co.uk is [0],[1],[2] while domain.co is [0][1]             $root_domain = explode(".", $search_domain);             $domain = $root_domain[0];              $tld = substr($search_domain, strrpos($search_domain, ".")+1);                  // access enom api             $url =  '/interface.asp?command=check&sld='.$domain.'&tld='.$tld.                     '&responsetype=xml&uid='.$username.'&w='.$password;                  // Load the API results into a SimpleXML object             $xml = simplexml_load_file($url);                  if(isset($xml->errors))              {                 // print all errors                 function recursive_print($item, $key)                 {                     echo '
'.$item.'

';                 }                 array_walk_recursive($xml->errors, 'recursive_print');             }             else             {                 // Read the results                 $rrpCode = $xml->RRPCode;                 $rrpText = $xml->RRPText;                      // Perform actions based on results                 switch ($rrpCode)                  {                     case 210:                         echo '
'. $xml->DomainName.' is available
';                         break;                     case 211:                         echo '
'.$xml->DomainName.' is not available
';                         break;                     default:                         echo '
Code: '. $rrpCode . ' ' . $rrpText . '
';                         break;                 }             }                    //$this->hobinom_redirect($referrer);         }     }          function hobinom_redirect($permalink)      {         wp_redirect($permalink);     }         }           add_action('widgets_init', array($HNDomainSearchWidget, 'hobinom_redirect'));     ?>


title: Undefined function error when creating Custom Meta Box

text: Following this tutorial, I am trying to create a custom Meta Box on my theme by adding following codes to the `function.php` file:               enter code here     add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );     add_action( 'add_meta_boxes', 'cd_meta_box_add' );          function cd_meta_box_add()     {       add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'cd_meta_box_cb', 'post', 'normal', 'high' );     }          function cd_meta_box_cb()       {         echo 'What you put here, show\'s up in the meta box';          }        but I am getting following error : ![fatal error](http://i.stack.imgur.com/OSagi.png)               ( ! ) Fatal error: Call to undefined function add_meta_box() in C:\wamp\www\TMPress\wp-content\themes\twentytwelve\cpt.php on line 94     Call Stack     #   Time    Memory  Function    Location     1   0.0012  865440  {main}( )   ..\edit.php:0     2   0.0018  982824  require_once( 'C:\wamp\www\TMPress\wp-admin\admin.php' )    ..\edit.php:10     3   0.0021  1008744 require_once( 'C:\wamp\www\TMPress\wp-load.php' )   ..\admin.php:30     4   0.0023  1026872 require_once( 'C:\wamp\www\TMPress\wp-config.php' ) ..\wp-load.php:29     5   0.0029  1158248 require_once( 'C:\wamp\www\TMPress\wp-settings.php' )   ..\wp-config.php:90     6   0.3251  32951888    include( 'C:\wamp\www\TMPress\wp-content\themes\twentytwelve\functions.php' )   ..\wp-settings.php:291     7   0.3255  32979176    include_once( 'C:\wamp\www\TMPress\wp-content\themes\twentytwelve\cpt.php' )    ..\functions.php:2      Can you please let me know why this is happening? is there any better way to add a meta box containing a field and dropdown select box? I know there are some plugins out there for doing this but I really like to learn it on my own.


title: Taxonomy term archive default loop returns 1 record instead of 8

text: I have a Custom Post Type called "book" and a custom taxonomy for this CPT called "books". One term's slug of this taxonomy is "accepting-yourself". Here's the code of the "accepting-yourself" archive page (URL: my_site/books/accepting-yourself/):               if ( have_posts() ) :          while ( have_posts() ) : the_post();          echo get_the_title();         endwhile;     endif;      This should return all the "book" posts in custom taxonomy "books", that's 8 posts. Instead it returns only one. Just in case here's the code defining my custom post type and custon taxonomy:               /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------      CUSTOM POST TYPE : BOOK     -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/          function my_custom_post_book() {         $labels = array(             'name'               => _x( 'Books', 'post type general name' ),             'singular_name'      => _x( 'Book', 'post type singular name' ),             'add_new'            => _x( 'Add New', 'book' ),             'add_new_item'       => __( 'Add New Book' ),             'edit_item'          => __( 'Edit Book' ),             'new_item'           => __( 'New Book' ),             'all_items'          => __( 'All Book' ),             'view_item'          => __( 'View Book' ),             'search_items'       => __( 'Search Book' ),             'not_found'          => __( 'No books found' ),             'not_found_in_trash' => __( 'No books found in the Trash' ),              'parent_item_colon'  => '',             'menu_name'          => 'Books'         );         $args = array(             'labels'        => $labels,             'description'   => 'Holds our books specific data',             'public'        => true,             'menu_position' => 4,             'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields'),             'has_archive'   => true,         );         register_post_type( 'book', $args );         }     add_action( 'init', 'my_custom_post_book' );          function my_updated_messages_book( $messages ) {         global $post, $post_ID;         $messages['book'] = array(             0 => '',              1 => sprintf( __('Book updated. View book'), esc_url( get_permalink($post_ID) ) ),             2 => __('Custom field updated.'),             3 => __('Custom field deleted.'),             4 => __('Book updated.'),             5 => isset($_GET['revision']) ? sprintf( __('Book restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,             6 => sprintf( __('Book published. View book'), esc_url( get_permalink($post_ID) ) ),             7 => __('Book saved.'),             8 => sprintf( __('Book submitted. Preview book'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),             9 => sprintf( __('Book scheduled for: %1$s. Preview book'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),             10 => sprintf( __('Book draft updated. Preview book'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),         );         return $messages;     }     add_filter( 'post_updated_messages', 'my_updated_messages_book' );               /*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------      CUSTOM BOOK TAXONOMY     -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/          $labels = array(         'name'                          => 'Books',         'singular_name'                 => 'Book',         'search_items'                  => 'Search Books',         'popular_items'                 => 'Popular Books',         'all_items'                     => 'All Books',         'parent_item'                   => 'Parent Book',         'edit_item'                     => 'Edit Book',         'update_item'                   => 'Update Book',         'add_new_item'                  => 'Add New Book',         'new_item_name'                 => 'New Book',         'separate_items_with_commas'    => 'Separate Books with commas',         'add_or_remove_items'           => 'Add or remove Books',         'choose_from_most_used'         => 'Choose from most used Books'         );          $args = array(         'label'                         => 'Books',         'labels'                        => $labels,         'public'                        => true,         'hierarchical'                  => true,         'show_ui'                       => true,         'show_in_nav_menus'             => true,         'args'                          => array( 'orderby' => 'term_order' ),         'rewrite'                       => array( 'slug' => 'books', 'with_front' => false ),         'query_var'                     => true     );          register_taxonomy( 'books', 'book', $args );


title: Custom Meta Data is not being saved

text: I have created a custom meta box using following link in wordpress 3.0:   http://farinspace.com/how-to-create-custom-wordpress-meta-box/ I am using same code and custom meta data is not being saved. I get blank textbox in custom meta box each time. Please let me know what to do.


title: I can't modify the 'Continue reading...' link of the_excerpt

text: I just placed this in my `functions.php` (I'm using Wordpress 3.0.4):               function new_excerpt_more($more) {            global $post;         return 'ID) . '">Read the Rest...';     }     add_filter('excerpt_more', 'new_excerpt_more');      But my post is still displaying `… Continue reading` Any suggestions?


title: Page Templates automatically showing index page contents?

text: So I'm taking my first foray into creating a wordpress page template. I created a .php file with the following contents:               <?php     /*     Template Name: Download Page Template     */     ?>      Then I created a page in the page editor and assigned it to use the "download page template". However, when I preview this page, all I see is the home/index page ... I tried a few of the samples from the codex, but all that happened is that my content from the wp editor showed up at the very bottom of the index page. Am I missing something obvious?


title: WP 3.0.5 - Custom posts matching 2 taxonomies

text: I'm running a WP 3.0.5 website and here is my problem: I define a custom post type with 2 custom taxonomies and I've got to develop a search engine based upon these taxonomies. Until there, no problem :               $args = array(              'my_post_type' => 'post_type_name',              'my_taxo_1' => 'taxo-1-slug',              'my_taxo_2' => 'taxo-2-slug'     );          query_posts( $args );      Working like a charm! But... What I want is to retrieve only custom posts matching both taxonomies whereas here, only 1 is sufficient. I saw WP 3.1 is introducing a new way dealing with taxonomies (http://codex.wordpress.org/Function_Reference/query_posts#Taxonomy_Parameters) which will absolutely solve my problem but WP 3.1 is still in beta and I can't take risk for my customer. Thanks for your help !


title: the_excerpt is not limiting my post page to 55 words?

text:
Wordpress states the following: > An excerpt is a condensed description of your blog post and refers to the > summary entered in the Excerpt field of the Administration > Posts > Add New > SubPanel. The excerpt is used to describe your post in RSS feeds and is > typically used in displaying search results. The excerpt is sometimes used > in displaying the Archives and Category views of your posts. Use the > Template Tag the_excerpt() to display the contents of this field. Note that > if you do not enter information into the Excerpt field when writing a post, > and you use the_excerpt() in your theme template files, WordPress will > automatically display the first 55 words of the post's content. I wrote a post of 164 words. And placed this into my posts page:
                 <?php // Create custom loop                 $custom_posts = get_posts('post_type=page_content&page_sections=Content (Front Page)'); ?>                 <?php foreach( $custom_posts as $post ) : setup_postdata( $post ); ?>

<?php the_title(); ?>
                         <?php the_excerpt(); ?>
                 <?php endforeach; ?>                 <?php wp_reset_query(); ?>
      I'm still seeing 164 words in that post. EDIT: This is what I've written in the post:               Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.          Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat      . I tried exceeding 55 words in other post and it is the same story. Any suggestions?


title: How to debug | Some times the "Save Draft" button seems to spin but does not actually save

text: I am using wordpress 3.5.1 and lately there seems to be a recurring problem with the save draft function where it seems like the draft was saved (i.e the wheel finishes spinning without an error message) but alas, all edits are lost. This happens both in the regular editor as well as in the distraction free wring space (where it is extremely frustrating, as all edits are lost when returning to the regular editing mode). I couldn't find a discussion about this problem in the other forums or any instructions on how to debug this or find the source of the problem. Any help will be much appreciated.


title: How to establish site-wide fields with my theme?

text: I have been searching high and low and cannot seem to find a plugin/implementation for wordpress which allows for site wide values to be set and used (in places such as header/footer). Any help much appreciated **EDIT** Sorry I might not have been clear enough. What I am wanting to do is have fields which can be set in the backend and displayed site wide such as a phone number in the footer. Thanks


title: Forum-esque Post Count User Ranks (Without Buddypress)

text: My client is looking for a ranking system similar to a forum. As your post count goes up, your "title" changes. I think Buddypress offers something along these lines but we're at the end stage and he doesn't want to take the extra time to let me convert it to a buddypress system. Are there other plugins that can do this? Or maybe someone can suggest some code to use with User Role Editor? Thanks


title: Permalinks not working using wordPress Networking with custom post types

text: Hay All, I've setup a WordPress network and have a couple of websites. Within these 'sub-websites' have a created a new custom post type called 'courses'. When i create a new 'course' a sample permalink would be www.mysite.com/site1/course/my-course-name However, this doesn't link to the article in the question. Is this a normal error with wordpress? How, can i fix this? I think there's an issue with the .htaccess file WP generated for me.


title: Debugging WP routing

text: For some posts, I see 404 page, even though posts exist, where is the place in WP where using permalink is decided what object needs to rendered? Thanks!


title: Plugin for custom sort order for categories?

text: I'd like to employ a sort order option in my theme to allow categories to be sorted similar to pages. Can anyone recommend a plugin that does this?


title: And/Or Category Query

text: I'm having a lot of trouble using php query_posts(array('category__and'=>array(1,3))) - it seems to be pulling anything that's in category 1 regardless of whether it's also in category 3 and I only want the posts if they exist in both categories. And ultimately, I need a bunch of OR statements anyway, so is there a better way than query_posts to do this? I want a page of posts that exist in a variety of multiple categories -- i.e: categories 1 AND 3 OR categories 1 AND 5 OR categories 1 AND 6 But not categories 1 AND 4 Any help would be greatly appreciated. Thanks.


title: wp_redirect and current_user_can issues

text: Put simply, I'm trying to redirect the user after clicking a 'Save Changes' button. The plugin uses custom capabilities, and so I want to check the current user has the correct capabilities before progressing with the save and redirect afterwards. However, bit of a dilemma. I have tried loading the function that carries out what is mentioned above using 'admin_init' and 'admin_menu'. Using 'admin_init', throws an undefined function error for the 'current_user_can' function, which makes sense since it hasn't been loaded yet (and is well documented in other help topics). The redirect works fine (using wp_safe_redirect). On the other hand, using 'admin_menu' allows the 'current_user_can' function to work, but the redirect doesn't. This is because the headers have already been sent. Is there a way to have both functions working in either actions 'admin_init' or 'admin_menu'? Thanks in advance.


title: Pagination: Keep prev and next link even on the first/ last page

text:
On my `index.php` I'm using 'paginate links'. I want to make a pagination where you have a button for previous, than the page numbers and then a button for next, like:               < PREVIOUS  1  2  3  4  [5]  6  7  8  9  NEXT >      When the user is on the first page the button for 'previous' must be unclickable and must have another background color than normal. The problem here is that, when I'm on the first page the whole 'previous' button disappears(same on the next page), so that makes it impossible for me to look if it has a different class so I can give it a different styling... So what I'm wondering is:   1. How to make the Previous and Next button appear on every page (even on the first and last page)?   2. If they appear, how do I remove the link from the previous button when I'm on the first page (and from the next button on the last page of course) My pagination code is:               <?php echo paginate_links( array(         'base' => str_replace( 999, '%#%', get_pagenum_link( 999 ) ),         'format' => '?paged=%#%',         'current' => max( 1, get_query_var('paged') ),         'total' => $wp_query->max_num_pages,         'prev_text'    => __('
vorige
'),         'next_text'    => __('
volgende
')     ) );     ?>


title: Custom Post Type Archive Page: Set Posts Per Page, Paginate

text: I have a custom post type called `video`. Would like to paginate its archive page, showing **only 3 posts** on each page. There is also a custom loop on the archive page that outputs **all** the video posts (for a thumbnail gallery). This is the `archive-video.php`:               <?php while( have_posts() ) : the_post(); ?>         MAIN LOOP...     <?php endwhile; wp_reset_query(); ?>          <?php next_posts_link(); previous_posts_link(); >          <?php $custom_loop = new WP_Query( array('post_type' => 'video', 'posts_per_page' => '-1' ) );     <?php while ( $custom_loop->have_posts() ) : $custom_loop->the_post(); ?>         CUSTOM LOOP...     <?php endwhile; ?>      I've tried to set the `posts_per_page` to 3 using `pre_get_posts` (code here). The pagination would work perfectly, but the custom loop now outputs only 3 posts and not all the posts! Anyone with a hard-coded/non-plugin solution? Have been googling to no avail... Any advice/help would be most appreciated!!!


title: How do you categorize pages?

text: I am an experienced Drupal developer who is just getting stuck into Wordpress. For a selected number of pages on a new wordpress build, I need to add them into a category, then add this category block to a page that shows the different categories (selecting them will act as a filter). In drupal this would involve create a custom content type, a taxonomy and a views block etc. How can the same be achieved in wordpress? I know that I can create a sidebar and drop a widget into it. But I am struggling to workout how to create the block to drop into there and categorize these pages.


title: WordPress function that makes HTML safe to be sent via AJAX request

text: What is correct way to send HTML back to an AJAX request in WordPress? I currently have this:               add_action( 'wp_ajax_nopriv_get-location-info', 'sc_locations_get_location_info' );     add_action( 'wp_ajax_get-location-info', 'sc_locations_get_location_info' );     function sc_locations_get_location_info() {         $nonce = $_POST['nonce'];         if ( ! wp_verify_nonce( $nonce, 'get-location-info-nonce' ) ) {             $response = json_encode( array( 'success' => false, 'error' => "Failed nonce check" ) );         } else {             $response = json_encode( array( 'success' => true, 'HTML' => '...LOTS OF WONDERFUL HTML...' ) );         }         header( "Content-Type: application/json" );         echo $response;         exit;     }      Now I'm currently just using `json_encode()` but should I be doing anything else to the HTML? The HTML generated can be trusted so no stripping would need to take place.


title: wp E-commerce featured product plugin with muliple option?

text: I'm Using E-commerce featured product plugin.in this plugin we have a options to select a single product from product list but not able to select multiple options at same time. * * * so any suggest to improve this plugin?


title: How to loop through each user id?

text: The functions that I am aware of:               WP_User      and               wp_get_current_user      seem to only get the user object of the current user. As an administrator, if I want to display certain profile information in a table from each user, how can I loop through the ids? Can this be done with WP template tags or should I resort to SQL? Thanks in advance


title: 2nd button row from WP Super Edit or TinyMCE Advanced doesn't show to 2nd admin

text: I'm currently using WP Super Edit. But the same problem persists with TinyMCE Advanced. This is how it is configured: http://i.imgur.com/4PyXi.png http://i.imgur.com/YniBi.png http://i.imgur.com/7MytG.png This is how I (admin) see it: http://i.imgur.com/OAdnF.png This is how my friend (2nd admin) sees it: http://i.imgur.com/mfUMq.png I'm getting desperate figuring out why the hell the 2nd button bar doesn't show.


title: Conditionally Loading JavaScript/CSS for Shortcodes

text: I released a plugin that creates a shortcode and requires a JavaScript file and a CSS file to load on any page that contains that shortcode. I could just make the script/style load on all pages, but that's not the best practice. I only want to load the files on pages that call the shortcode. I've found two methods of doing this, but both have problems. Method 1 sets a flag to true inside the shortcode handler function, and then checks that value inside a `wp_footer` callback. If it's true, it uses `wp_print_scripts()` to load the JavaScript. The problem with this is that it only works for JavaScript and not CSS, because CSS should be declared inside `<head>`, which you can only do during an early hook like `init` or `wp_head`. Method 2 fires early and "peeks ahead" to see if the shortcode exists in the current page content. I like this method much better than the first, but the problem with it it won't detect if the template calls `do_shortcode()`. So, I'm leaning towards using the second method and then trying to detect if a template is assigned, and if so, parse it for the shortcode. Before I do that, though, I wanted to check if anyone knows of a better method. **Update:** I've integrated the solution into my plugin. If anyone is curious to see it fleshed out in a live environment you can download it or browse it. **Update 2:** As of WordPress 3.3, it's now possible to call `wp_enqueue_script()` directly inside a shortcode callback, and the JavaScript file will be called within the document's footer. That's technically possible for CSS files as well, but should be considered a bad practice because outputting CSS outside the `<head>` tag violates W3C specs, can case FOUC, and may force the browser to re-render the page.


title: Complex widget form UI - examples and best practices

text: I'm contemplating a widget with quite a number of options, which will make for a lengthy widget form. To improve the user experience with this form, I'd like to divide it into sections. I don't feel like re-inventing the wheel, so what are some examples of widgets that have fairly complex forms (especially those which are divided into multiple sections) **all the while remaining usable and easy to parse visually**? I should add that I'm looking for examples that could be considered "best practices", _not messy kitchen sink forms that are difficult to use_. I realize this is probably subjective. Thanks for your input!


title: Customizing the wordpress tag-cloud output

text:
I'm using a little function below to list out the post_terms. The function is outputting very specific markup for the grouping, filter, and href attributes (this is a term selector for the jQuery isotope plugin).               $terms = get_terms("post_tag");     $count = count($terms);      if($count > 0){         echo '
';         echo '
Post Tags
';         echo '
';         echo '
any';         foreach ($terms as $term) {             echo '
slug.'" data-group="tag" data-filter=".tag-'.$term->slug.'">'.$term->name.'';                 }         echo '
';         echo '
';      }      Question: Given the requirements above where each term has it's own custom href, data- group, data-filter, how would I go about changing this list format into a tag cloud with my requirements? (an ordered list of terms is way to long for use within a sidebar, hence a tag cloud would work much better when using terms as a selector) I did look through the codex, but didn't see any examples on how to modify the output of the tag cloud. thanks


title: Conditonal statement for iPad

text: I need to hide the branding section of my blog, but only when someone is viewing it from the iPad. I am not sure how to attack this. EDIT: the function `remove_access` currently works in my template, but I need to add the iPad function. So would this look correct for trying to hide the area:               <?php      function remove_access() {      if(is_page(array(63, 386, 391, 405, 'forums'))) {         remove_action('thematic_header','thematic_blogtitle',3);         remove_action('thematic_header', 'thematic_blogdescription',5);         remove_action('thematic_header', 'thematic_brandingclosing',7);         remove_action('thematic_header','thematic_access',9);         remove_action('thematic_footer','thematic_siteinfoopen',20);         remove_action('thematic_footer','thematic_siteinfo',30);       }     }     if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT']) ){         add_action('template_redirect', 'remove_access');     }      EDIT-3: the complete function changed the condition to: if (it's an iPad AND page is blog) OR (if it's one of the pages in array), then remove items.               <?php     function remove_access() {         if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT']) && is_page('blog') || is_page(array(63, 386, 391, 405, 'forums')) ){             remove_action('thematic_header','thematic_blogtitle',3);             remove_action('thematic_header', 'thematic_blogdescription',5);             remove_action('thematic_header', 'thematic_brandingclosing',7);             remove_action('thematic_header','thematic_access',9);             remove_action('thematic_footer','thematic_siteinfoopen',20);             remove_action('thematic_footer','thematic_siteinfo',30);         }     }          add_action('template_redirect', 'remove_access');      EDIT-4: Add a function to remove from child pages as well. I tried this, but it doesn't seem to work:               function remove_access() {     if( preg_match('/ipad/i',$_SERVER['HTTP_USER_AGENT']) && is_page('blog') && ($post->post_parent == 'blog') || is_page(array(63, 386, 391, 405, 'forums')) && ($post->post_parent == (63, 386, 391, 405, 'forums')) ){         remove_action('thematic_header','thematic_blogtitle',3);         remove_action('thematic_header', 'thematic_blogdescription',5);         remove_action('thematic_header', 'thematic_brandingclosing',7);         remove_action('thematic_header','thematic_access',9);         remove_action('thematic_footer','thematic_siteinfoopen',20);         remove_action('thematic_footer','thematic_siteinfo',30);       }     }          add_action('template_redirect', 'remove_access');


title: What are the differences between custom post type and custom page templates?

text: What is the difference between custom taxonomies and page templates and custom post types? I think I understand that taxonomy is used to organize data. CPTs are used to give your data a different design. but can't a template be used instead of CPT? or are they used in combination? and can't categories be used instead of creating additional taxonomies? i guess are CPT's and custom taxonomies just tools to make life easier or do they serve a purpose that could not be achieved without them? I have been creating new templates for any page the needs a different look or any page that uses a specific category. have i been doing this wrong or poorly? instead of having 7 templates should i have 7 CPT's or something like that?


title: What is the most secure way to store post meta data in WP?

text: Sony's recent security "holes" showed how unsafe it can be to store data unencrypted. As some of you may know, I 'm working on re-releasing the free CRM theme Driftwood. What is the most secure way to store sensitive (ie non-public information) post meta in the database?


title: Using <!--more--> tag to output text in Genesis?

text:
here's what i'm trying to achieve! HTML:               some text          some text      when post is loaded:               some text     MY TEXT WHICH WAS ADDED TO THE MORE TAG     some text      on my old WP site, i used this to have a banner displayed on posts exactly where the tag was inserted. unfortunately, i can't get this to work in Genesis. here's the code which was added to functions.php on my old website:               function adsense_added_at_more_tag($text) {     if( is_single() ) :     $ads_text = 'BANNER GOES HERE';     $pos1 = strpos($text, '<span id="more-');     $pos2 = strpos($text, '', $pos1);     $text1 = substr($text, 0, $pos2);     $text2 = substr($text, $pos2);     $text = $text1 . $ads_text . $text2;     endif;     return $text;     }      any ideas on how to get this to work in Genesis? i got some great tips from Brad who suggested the following code:               add_filter( 'the_content_more_link', 'read_more_link' );     function read_more_link() {     if ( is_single() ) {     echo '
Add Your Banner HTML Here
';         }     }      i've tried adding this to functions.php in Genesis, but nothing happens. the "Add Your Banner HTML Here" text doesn't appear in the post. i've explored various code examples online and tried tweaking the code pasted above with my (it's safe to say) non-existant PHP skills without success. can anyone figure out how to modify the code to show text in a single post in Genesis?


title: Retrieve the template directory URI via global or get_template_directory_uri() every time?

text: One Wordpress function I happen to use frequently is `get_template_directory_uri()`. While I tried to minimize or avoid its use where I can, I still happen to have more than one call to this function in certain pages across my theme. Most of the time in a series of href or inside other functions (for which I normally put the URI resulting from `get_template_directory_uri()` in a `$variable` - however I still find that I might have to store again that variable in a different php file). I wonder, would it be best if I store the returning value (my theme URI) in a global and use echo the global when I need it in different parts of my theme php files? I'm still learning my way to best practices and uses of variables and globals. Thank you


title: Filter Shortcodes when using get_page

text: I'm using the following line to show content from one page on another. This line outputs the content's raw text of a shortcode:               <?php $id=3934; $post = get_page($id); $content = apply_filters('the_content', $post->post_content); echo $content;  ?>      How can I add to or filter this snippet to allow the shortcodes from said page to fully display, rather than outputting raw [/tab] text?


title: Formatting error while publishing theblog from Microsoft Word

text: I am trying to publish a blog post into wordpress based website from Microsoft Word. Here is the sample text that I added in Microsoft which I published as well. > " Temporary Blog Post > > I am adding a temporary blog post here Let’s see how it goes > > Thanks" However, when I published the post, this is how it looked > /pI am adding a temporary blog post here > > /ppLet’s see how it goes > > /ppThanks Any idea the reason behind the formatting error. I thought, when you publish from Microsofot word or Microsoft Live Writer, I was thinking, when published it looks the same as in the Microsoft Word. Thanks Kiran


title: Installing jQuery plugin to wordpress theme (Incredible)

text: Ok so here is the plugin in question  I'm trying to integrate it on the homepage of my wordpress theme (incredible bought from themeforest) After reading up on wordpress enqueue script and all that stuff i want to do it the right way from the start. **functions.php snippet:** i just added 2 lines here, one to register my script "contenthover" the other to enqueue. Also i tried adding `array('jquery'));` to make sure its dependent on jquery but that only produced a parse/syntax php error               if (!function_exists('pp_scripts')) {         function pp_scripts() {                  wp_register_script('flexslider', get_template_directory_uri() . '/js/flexslider.js');             wp_register_script('isotope', get_template_directory_uri() . '/js/jquery.isotope.min.js');             wp_register_script('ender', get_template_directory_uri() . '/js/ender.min.js');             wp_register_script('carousel', get_template_directory_uri() . '/js/carousel.js');             wp_register_script('tooltip', get_template_directory_uri() . '/js/tooltip.js');             wp_register_script('popover', get_template_directory_uri() . '/js/popover.js');             wp_register_script('effects', get_template_directory_uri() . '/js/effects.js');             wp_register_script('twitter', get_template_directory_uri() . '/js/twitter.js');             wp_register_script('imagebox', get_template_directory_uri() . '/js/imagebox.min.js');             wp_register_script('contenthover', get_template_directory_uri() . '/js/jquery.contenthover.js');             wp_register_script('custom', get_template_directory_uri() . '/js/custom.js');                  wp_enqueue_script('flexslider');             wp_enqueue_script('custom');             wp_enqueue_script('isotope');             wp_enqueue_script('ender');             wp_enqueue_script('imagebox');             wp_enqueue_script('carousel');             wp_enqueue_script('twitter');             wp_enqueue_script('tooltip');             wp_enqueue_script('popover');             wp_enqueue_script('effects');             wp_enqueue_script('contenthover');              }         add_action('wp_enqueue_scripts', 'pp_scripts');     }      Next is the initialization code where i experimented with to make work, it didn't work when inserted in the _header.php_ or _footer.php_ or _template- homepage-xxx.php_ . Although as far as i know, it should work if its included in any of those files, its just not the "best practice" way of doing things to keep things clean. The theme already has a custom.js file loaded so i thought the best way would be to initialize it from there **so here is the custom.js snippet:** it already contains many small snippets of code for carousels/effects..etc.etc. I've tried using the standard $(), as well as jQuery()               var $j = jQuery.noConflict();     $j(document).ready(function () {     $j('.d1').contenthover({         effect:'slide',         slide_speed:300,         overlay_background:'#000',         overlay_opacity:0.8     });     });      **Errors and outputs:**   1. With $() i get is undefined error in firebug console.   2. With jQuery() and $j()i get Error: Permission denied to access property 'toString' on firebug console. not sure if thats related.   3. Ive experimented with the sequence of scripts hoping that maybe its an issue related to the scripts being loaded in the wrong sequence, but no luck there.    4. My last consideration would have to be lookin into the jquery.contenthover.js file it self to see if there are any conflicts that could arise with wordpress? would that be a wise thing to try and wrestle with?   5. I'm sure this effect can be done vanilla and maybe with some clever CSS3 but i'm new to wordpress and want to figure the ins and outs so i can install custom scripts later on.  So thanks in advance, if there is anything thats unclear, or scripts you'd like to see. or perhaps a live example, just let me know. I would appreciate anything just a push in the right direction. Thanks all for your time.


title: Any disadvandages if I style the wordpress align classes without img and .wp-caption prefix

text: In various WordPress themes the margins are only applied to elements when they are images or captions               /* Images */     .alignleft {         float: left;     }          .alignright {         float: right;     }          .aligncenter {         display: block;         margin-left: auto;         margin-right: auto;     }          img.alignleft {         margin: 5px 20px 5px 0;     }          .wp-caption.alignleft {         margin: 5px 10px 5px 0;     }          img.alignright {         margin: 5px 0 5px 20px;     }          .wp-caption.alignright {         margin: 5px 0 5px 10px;     }          img.aligncenter {         margin: 5px auto;     }          img.alignnone {         margin: 5px 0;     }      This is taken from the 2013 Theme. I coded a plugin and used this align classes to float the content. Now It looks ugly because the margins are only applied to images and wp-captions. So I have to add my own margins. My question is now why they to it this way. Why do they not give the bases classes some base margins? What elements do they want to float without margins? I am asking for theme purposes, I use bootstrap which comes with `.pull-left` and `.pull-right` already that do nothing but float. So I not really need this classes for floating without margins. But maybe there is a good reason I should do it the way they do? I mean base margins could still be overwritten if needed so why?


title: How can i list current author's categories?

text:
My Code getting authors written post categories but just 2 ID has author lists category.. I replace `$current_user->ID` but it is not worked.               <?php         $categories = $wpdb->get_results("             SELECT DISTINCT(terms.term_id) as ID, terms.name, terms.slug             FROM $wpdb->posts as posts             LEFT JOIN $wpdb->term_relationships as relationships ON posts.ID = relationships.object_ID             LEFT JOIN $wpdb->term_taxonomy as tax ON relationships.term_taxonomy_id = tax.term_taxonomy_id             LEFT JOIN $wpdb->terms as terms ON tax.term_id = terms.term_id             WHERE 1=1 AND (                 posts.post_status = 'publish' AND                 posts.post_author = '2' AND                 tax.taxonomy = 'category' )             ORDER BY terms.name ASC         ");         ?>
             <?php foreach($categories as $category) : ?>
                 <a href="<?php echo get_category_link( $category->ID ); ?>" title="<?php echo $category->name ?>"><?php echo $category->name ?>
             <?php endforeach; ?>


title: Cloudflare's Rocket Loader + Wordpress -> Ignore scripts?

text: I'm trying to make Cloudflare's Rocket Loader work on my WP site. Everything works fine except for the WP Visual Editor. I followed the advice here but it doesn't work: How do I add custom attributes to javascript tags in Wordpress? Cloudflare says that in order to make Rocket Loader ignore a javascript file I need to add the data-cfasync="false" tag before my script:               <script data-cfasync="false" src="/javascript.js"></script>          https://support.cloudflare.com/entries/22063443--How-can-I-have-Rocket-Loader- ignore-my-script-s-in-Automatic-Mode- Rocket loader doesn't ignore my JS files. Here's my code:               function rocket_loader_attributes( $url )     {     $ignore = array (          'http://www.mysite.com/wp-includes/js/tinymce/tiny_mce.js?ver=349-21274',     'http://www.mysite.com/wp-admin/js/editor.js?ver=3.4.2'          );     if ( in_array( $url, $ignore ) )     { // this will be ignored     return "$url' data-cfasync='false";     }          return $url;     }     add_filter( 'clean_url', 'rocket_loader_attributes', 11, 1 );      What is wrong with my code? I'm currently using Rocket Loader on Automatic mode. Can anyone help? @toscho if you see this maybe you can point me in the right direction. Thank you.


title: Disable Link to Post from Showing Up in Post's Comments?

text: When I link to a another post in one of mine, is there a way for it not to show up in that entry's comments? Very small, new blog at the moment... I honestly just don't want all the exposure from being in a big blog's comments


title: how to display page title only for child category pages

text: I apologize if this is a dumb question, but I am just learning PHP and Wordpress. It's probably very simple. I have a site where the top-level nav is all parent categories, with the child categories as dropdowns. The pages are all pulling from category.php. On the child category pages, I would like to display the current child category page title (single_cat_title, I think) for styling, but I want to exclude this feature on the parent category pages. I've been trying to write this very simply using get_the_category() as per this example in the codex: `$category = get_the_category(); echo $category[0]->cat_name;` Any help is greatly appreciated.


title: Open Source replacement for WPML?

text: Since WPML is not free anymore and still one of the most used Wordpress Translation Plugins, is there an open source project that keeps development going? Or something similar that replaces it? I know there are other alternatives out there, but most have different approaches or features. I for example like the fact, that every translation is in it's own post.


title: Template plugin for blog posts?

text: can someone recommend a plugin to do the following? My wordpress CMS has two types of users: administrator and editor, both of whom are not technologically savvy, so they need things to be super simple. The administrator wants to be able to create a re-useable template in the CMS that editors can use for their posts. As an example, an administrator can create a template along the lines of               Welcome to the ________.     We are hosting our event at __________.     Buy your tickets for ______ dollars.      The editor can then login to the CMS, create a new blog post and import the template above and fill out the 3 underlined areas. We want things to be a little more complex by giving the administrator the ability to add images, styling, and fields to record form registrations (form submissions get recorded to wordpress database). What wordpress plugin comes closes to achieving the above results?


title: Editing the loop for Author pages

text: I was wondering if anyone can help me out. I am looking to remove the_content part of the loop on **my author pages only**. So basically, I just want a list of the author posts with only the title and meta instead of the full post. When I went to the author.php file, I found this, which I believe is the code that is generating the posts on the Author Pages.               /* Run the loop for the author archive page to output the authors posts      * If you want to overload this in a child theme then include a file      * called loop-author.php and that will be used instead.      */          get_template_part( 'loop', 'author' );      I'm pretty new at this, so please bare with me. My question is, how I do I remove the content from the loop for only the Author pages. I wouldn't think that I should remove the function that generates the content from the loop.php file because that would remove it from all posts on my site. The comments above say, If I want to overload this in a child theme, the include a file called loop-author.php. Can I simply copy all the code from the loop.php file into a new loop-author file, remove the function that generates content from there? Would i have to change any of the parameters in the get_template_part() function? Again, really new at doing this, so any advice would be greatly appreciated. Thanks a lot.


title: Morris.js for Wordpress?

text: I found Morris.js to be a delightfully implemented charting script, and wanted to include it in my Wordpress installation. But I have never included a js file with my blog before, and would appreciate if someone can guide me on this:   1. How do I include the javascript file?   2. Where do I upload it on the server?   3. Anything else I need to know to use it? Thanks.