Resizing image into thumbnail, small, medium and large options greyed out

I am working with WordPress 3.3.1 and cannot resize the image I am trying to add to the page as the thumbnail, small, medium and large options are greyed out. the size of the image in question is 276x354. I have created my own theme and have added `<?php the_post_thumbnail(); ?>` template tag but to no avail. Does deactivating the visual editor have anything to do with this. I have not come across this problem before and would appreciate any pointers on what could be causing this problem. Thanks in advance. nav


post_content not parsed using save_post action hook

A site I'm building for a client has to be able to download Vine's to a server when they've been posted using a shortcode (`[vine id="..."]`). This works fine for my local install (it's a Multisite install if that helps). I post the shortcode, save the post, the Vine .mp4 file (format `vine-<post ID>.mp4`) is saved to my uploads directory (with correct post ID) and when I view the post, the correct file is shown. However, on the online site, something seems to go wrong: when the post is saved, and then I view the post, the file seems to exist but with no content (i.e the correct data was not passed to the functions to download the video file). I have narrowed this down to what I think it's very likely that it is: for some reason, the online site has a problem getting the content of the post after it's been saved to the database. Hopefully this will be a bit clearer after I show my code:               function vineDL() {         global $post;         $vinePostContent = $post->post_content; // retrieve post content         if (in_category("Vines")) { // check it's in correct category             preg_match_all('/\[vine.+id=[\'"](.+?)[\'"]\]/i', $vinePostContent, $matches); // match the [vine id=""] shortcode             $vineID = $matches[1][0]; // get the actual ID from the matched array             downloadVine(vine($vineID)); // some other functions which are involved in downloading the Video file (from prior investigation, I believe these are not at fault)         }     }          add_action('save_post', 'vineDL'); // add post actions     add_action('draft_to_publish', 'vineDL');     add_action('new_to_publish', 'vineDL');     add_action('pending_to_publish', 'vineDL');     add_action('future_to_publish', 'vineDL');      As you can see, the shortcode needs to be matched so the ID can be taken and passed into the other functions (which are quite big and I'd rather not show them). I think the problem is, that the online install of WP seems to think that the post content is empty when the post is saved and therefore nothing is matched, so the ID cannot be passed to the other functions which do the actual downloading. To back this up, when I enable `WP_DEBUG`, and go to 'Add New Post', there are two messages at the top of the page, telling me that `$post->post_content` is not a proper object. also, this occurs on my local install as well as the online install. If someone has a better way of retrieving the ID, which is a shortcode attribute defined in another function (and works perfectly), then I'd be very interested to hear as I know this is a flaky method of getting data from a post. Hope someone can help me out, thanks very much :)


Help with overloading the limits of CPU/RAM issue in a resseler account with wp sites

The server that I am on has these characteristics:   * Intel(R) Xeon(R) CPU E5506 @ 2.13GHz/24GB ddr3   * CloudLinux Server release 5.7 64 bit/litespeed webserver   * And overall are 800 clients (in whois.domaintools.com that I am looking right now the Shared IP Address of the server that I am is the "Reverse IP: 1,195 websites use this address.") And the limits are 1gb of memory and 25 concurrent connections In the reseller account that I have I created two accounts:   1. WordPress Multisite with 3 sites in under contraction/coming soon message with 2 gb ram and 30 concurrent connections (I don't know why, I am waiting for an answer from my host provider). The last 7 days from Resource Usage Details   2. A WordPress eZine blog with 4000-6000 monthly unique visitors/150-200 a day visits with 2 gb ram and 20 concurrent connections (I don't know why, I am waiting for an anwser from my host provider). The last 7 days from Resource Usage Details The eZine blog has 25 Active Plugins:   * Admin Locale   * AdRotate   * All in One SEO Pack - Pro Version   * Calendar Posts   * CloudFlare   * Contact Form 7   * Easy Mashable Social Bar   * FeedBurner FeedSmith   * Google Analytics for WordPress   * Google XML Sitemaps   * JW Player Plugin for WordPress   * NextGEN Gallery   * Really Simple CAPTCHA   * registration-login   * TentBlogger SEO Categories   * Top 10   * Twitter Embed   * W3 Total Cache   * WP-DownloadManager   * WP-Optimize   * WP-PageNavi   * WP-reCAPTCHA   * WP-UserOnline   * WP Smush.it   * WP Smush.it NextGEN Gallery Integration My problem is when am going to apply or save the setting of a plug in or when am going to publish or save as a draft a post I get same message: > 503 Service Unavailable > > The server is temporarily busy, try again later! Powered By LiteSpeed Web > Server LiteSpeed Technologies is not responsible for administration and > contents of this web site! Also it takes a lot of time for my site load. It doesn't load the virtual editor of the post. And the only thing that my hosting provider suggests to optimize my site(But, I already use plug ins (CloudFlare,W3 Total Cache, WP Smush.it & WP Smush.it NextGEN Gallery Integrationor) in order to optimize my site) to move to a Cloud server. What do you think about that? Should I move to a Cloud server or use CDN to my current reseller account or in a new host provider? Also, does the problem really starts from me or my hosting has done a lot of overselling? Please suggest me anything that will be useful for my problem and if it's necessary to give you some information(That I might have forgot to mention) to help you understand.


Custom taxonomy list in Worpdress

I just registered following code in my function               add_action( 'init', 'create_resources_taxonomies', 0 );          function create_resources_taxonomies() {         $labels = array(             'name'              => _x( 'cat2', 'taxonomy general name' ),             'singular_name'     => _x( 'cat2', 'taxonomy singular name' ),             'search_items'      => __( 'Search category' ),             'all_items'         => __( 'All category' ),             'parent_item'       => __( 'Parent category' ),             'parent_item_colon' => __( 'Parent category:' ),             'edit_item'         => __( 'Edit category' ),             'update_item'       => __( 'Update Category' ),             'add_new_item'      => __( 'Add New Category' ),             'new_item_name'     => __( 'New category Name' ),             'menu_name'         => __( 'genre' ),         );              $args = array(             'hierarchical'      => true,             'labels'            => $labels,             'show_ui'           => true,             'show_admin_column' => true,             'query_var'         => true,             'rewrite'           => array( 'slug' => 'genre' ),         );              register_taxonomy( 'genre', array( 'resources' ), $args );     }      and i want to get category list in my sidebar, so i added following code in my sidebar               <?php         $taxonomy     = 'genre';     $orderby      = 'name';      $show_count   = 0;      // 1 for yes, 0 for no     $pad_counts   = 0;      // 1 for yes, 0 for no     $hierarchical = 1;      // 1 for yes, 0 for no     $title        = '';          $args = array(       'taxonomy'     => $taxonomy,       'orderby'      => $orderby,       'show_count'   => $show_count,       'pad_counts'   => $pad_counts,       'hierarchical' => $hierarchical,       'title_li'     => $title     );     ?>          <ul>     <?php wp_list_categories( $args ); ?>     </ul>      But i just get "No categories" text. What is wrong with my code?


Sorting custom post types by taxonomy (So close)

I have a custom post type called 'requests' that has a custom taxonomy 'request-categories'. I've created a template with a modified loop that allows me to view my custom post type in a certain 'request-category' for instance 'electronics-requests'. The loop works if I manually change the args for post type and taxonomy but, in order for it to be usable, I need to figure out how to deal with the urls so that `mysite.com/requests/request-category/electronics-request` will modify the loop in such a way that will provide the expected results. The way I see it, `mysite.com/requests` will be an actual page, while the `request-category` and `electronics-request` portions of the url would be assigned to the appropriate variables in the loop. WHich seems easy enough but I don't know how to keep wordpress from 404ing. I'm trying to do exactly what wordpress already does with posts and categories. I'm very close to having this working but I'm running in to a wall here. It seems to me that this should be a standard feature and this is critical to full functionality of custom post types.


Help building array hierarchically with taxonomies (to get posts)

What I need to do is to : -+ Retrieve all terms assigned to a page -+ Get all posts assigned to each term -+ Organize the output in the hierarchic way as in the admin I'm OK with the first two items, but I cannot seems to find a way to organize my output in the correct hierarchical manner (probably because i'm not good with arrays and probably PHP in general). This is what I got for now :               public function return_all_tax_objects() {              $obj_term_posts = array();              foreach ( $this->return_object_terms() as $obj_term ) {                  if ( $obj_term->parent ) {                 unset( $key );                 $ancestors = array_reverse( get_ancestors( $obj_term->term_id, $obj_term->taxonomy ) );                 foreach ( $ancestors as $ancestor ) {                     $ancestor_term = get_term( $ancestor, $obj_term->taxonomy );                     $key .= "[$ancestor_term->slug]";                 }                 $key .= "[$obj_term->slug]";             }                  if ( array_key_exists( $key, $obj_term_posts ) ) {                       $get_term_posts = $this->get_posts_for_term( $obj_term );                  array_push ( $obj_term_posts[ $key ], $this->get_posts_for_term( $obj_term ) );                  } else {                      $obj_term_posts[ $key ] = $this->get_posts_for_term( $obj_term );                  }              }         return $obj_term_posts;     }      And `$this->return_object_terms()` corresponds to a function to returns all terms for a `ID` for all Custom Post Types I have set up, in a flat array :               public function return_object_terms() {              return wp_get_object_terms( $this->object_id, $this->return_object_taxonomies(), array ( 'orderby' => 'term_id', 'order' => 'ASC', 'fields' => 'all' ) );     }      As you will see in my snapshot for the returned values, I'm close, but : **Edit :** Changed code for a better option. Still, not working. Somehow, I got it all but mixed up. I have the correct posts, but I'm not updating the correct index somwhere. Essentially, what I need is a way to nest child terms into parent term, so I could structure my output :               -+ Direction générale des services     --+ (posts)     ---+ Services Techniques     ---+ (posts)     ----+ Directeur des Services Techniques     ----+ (posts)     ---+ Services Administratifs     ---+ (posts)     ...      ![Firebug capture of returned array $obj_term_posts](http://i.stack.imgur.com/RRSul.jpg)


Adding custom code to a WordPress site

I have coded a small calculator in 3 files, HTML/JS/CSS + 1 image, and I need to integrate it in the main column of a WordPress site. It's a standard calculator tool, a div with 2 dropdown, and a result appearing when options are selected. The tool needs to appear just as an article would, taking all the main column of a 3 columns layout. Maybe it could be a shortcode but not a sidebar widget. I just need this piece of custom code to display in a page. No other requirements. I'm a software coder and have no WP experience. What's the best way to do that, do I need to make a plugin?


Allow access to stand-alone php file Wordpress

I am developing a wordpress theme and I want to use `jQuery.load()` to load data from a PHP file in my theme directory called `process.php` to a div in a wordpress page template. I haven't had any issues with `load()` in the past but Wordpress is preventing me from loading the data or even accessing the process.php file in the browser. When I navigate to the full path of the file (eg: http://[site]/[theme]/functions/process.php) I get the following error in Chrome > Internal Server Error. The server encountered an internal error or > misconfiguration and was unable to complete your request. Please contact the > server administrator, **@gmial.com and inform them of the time the error > occurred, and anything you might have done that may have caused the error. > More information about this error may be available in the server error log.` I've read similar questions but they involve modifying the `.htaccess` file. Does anyone know how to do this from a theme perspective ie: using `$wp_rewrite`. ## EDIT > Linux Server error log states                   [Mon Mar 12 14:00:52 2012] [error] [client 121.98.81.237] SoftException in Application.cpp:245: File "/var/www/vhosts/****.co.nz/httpdocs/npr/wp-content/themes/_s_2/functions/process.php" is writeable by group [Mon Mar 12 14:00:52 2012] [error] [client 121.98.81.237] Premature end of script headers: process.php      and this is process.php               <?php      echo "hello from php";     ?>


How to include own css on wordpress tinymce editor?

I have added some text on tinymce editor on load.   (Every time you click on Add new the tinymce editor load with this text.) but problem is how to enable css class which are using in default text. Thanks


Multi site problem. Redirecting to signup and sub-sites not working

I'm having a nightmare of a time with a multisite setup I'm working on. I've worked on plenty of MS installations before and never come across anything like this. Basically http://www.energyhair.com.php54-1.dfw1-2.websitetestlink.com/ is the primary domain (It's a test domain, obviously) but everytime I, or anyone else, tries to access it they get redirected to the signup page regardless of what page they try and access. I've tried editing .htaccess and also adding the noblogredirect bit to wp- config to no avail. The other issue is the sub-site, http://shop.energyhair.com.php54-1.dfw1-2.websitetestlink.com/ that just doesn't seem to be working at all. The site exists, it's in the database and you can also see it's information in the network super-admin area. Could it possibly be down to the test domain my client is using? Any help would be most appreciated.


Custom WP_Query breaks default behaviour of viewing right post associated with tax-term!

I have a custom-taxonomy for a custom-post-type just like categories. I've used the standard loop in my `taxonomy-event_type.php` template so far …               if ( have_posts() ) : while ( have_posts() ) : the_post();       This meant that the template only showed the posts associated with the current term (category) the post was in. So on `url/event_type/workshops` only all posts that were set to "workshops" in the backend would appear. Now i've changed that standard loop to a custom loop where I'm passing some args so I can sort the posts by a meta-value (the event date)               $args = array(         "post_type" => "wr_event",         "meta_key" => "_wr_event_date",         "orderby" => "meta_value_num",         "order" => "ASC"         //"terms" =>          );              $wr_events = new WP_Query( $args );              if ( $wr_events->have_posts() ) : while ( $wr_events->have_posts() ) : $wr_events->the_post();      This works perfect. Only thing. It breaks the standard behaviour for the term (category) I'm currently viewing. So with this custom loop when viewing `url/event_type/workshops` or `url/event_type/lectures` always the same posts appear! How can I again view only the posts associated with the current term "workshops" or "lectures"? Thank you for your help! edit: if I do …               $current_cat = get_query_var( 'event_type' );     echo $current_cat;          $args = array( …      The `$current_cat` holds the right term (category) I'm currently in. Only problem is that the posts in the loop are always the same. How can I filter by this term?


How do I fix my 'Path' field when editing pages via the Dashboard?

I am encountering the same problem described here: Unable to set path. In every module where I can edit a page, a `p` appears after the word 'Path'. I can click on it; clicking on it highlights some of the text. How do I fix this issue? ![enter image description here](http://i.stack.imgur.com/FuB1n.jpg)


meta tag placement for google verification

Please tell me in simple terms starting from the dashboard of a 3.3.1 webpage how to get to the place where I put this meta tag google is requiring in order to verify my site. If you start with on the main page--Please explain how to get there. My main page is just a post. then I have other pages. I've placed this meta tag all over my pages and google has not been able verify from any of them.


Image Upload Form is Disabling Comment Addition

I have an image upload form that is being added to `the_content` using a filter. However, the existence of this image upload form makes it so that comments cannot be added. Because there are two submit buttons, the comment submit button seems like it's actually submitting the image upload form. Here is the form:               <form method="post" action="" enctype="multipart/form-data" >
<input type="file" accept="image/*" name="uploaded_attachment" id="uploaded-attachment">

<input type="submit" value="Upload">
     <form>      Is there an easy way to make it so the comment submit only submits comments and this form only submits the image upload? Thanks in advance.


WordPress cache feeds

I would like to implement a custom cache for all the feeds in my site. The rss requests are very intensive and I have a big db load. Do anyone know of a good action before running the rss query so I can cache it? I'm using memcahed and all the feeds should be cached for 1 hour.


Show Subpage in Author Slug Address

I changed author slug to "profile" then i created a page named "profile" and a subpage named "edit" for showing profile editing page. Now profile edit page link is "mysite.com/profile/edit" but author slug think the edit page is a user and show 404 page instant my page. My question is how to show edit page under author slug? Sorry for my bad english. Thanks


Exclude images from "inserted into post" when trying to get attachments

I have here the coin-slider which takes all pictures from the gallery. I get the attachments through the following code:               $attachments = get_posts(array('post_type' => 'attachment', 'post_parent' => $post->ID));      But this function also gives me pictures, which were posted inline on a page. If I look to article image I can see the picture in the tab gallery. The picture is also shown in the editor. How can I exclude pictures which where inserted into the editor? I've seen that there is an `exclude` option for `get_posts`, but neither `get_the_post_thumbnail();` nor `get_post_thumbnail_id();` does work for me. The image is still included in the slider and the post. **Edit:** It seems that it impossible to place a picture in a post without putting it in the gallery. If it is in the gallery it is also in the result of `get_posts`. Now I have uploaded a file per FTP on the webserver and placed the image by using an URL. Now it seems to work, but it isn't an acceptable solution ...


Numberposts 1 not cooperating in 3.5

Trying to fix my custom gallery after the 3.5 upgrade, and using the code below I'm trying to get the first image of the gallery in "large" size above the content output followed by the remaining images in the corresponding gallery in "thumbnail" size...but 'numberposts' => 1 isn't liking what I'm doing for some reason. And, what's the trick to completely stripping the gallery shortcode [and it's contents] out?               single.php          <?php //GETS THE FIRST IMAGE     $args = array(     'order'          => 'ASC',     'orderby'        => 'menu_order',     'post_type'      => 'attachment',     'post_parent'    => $post->ID,     'post_mime_type' => 'image',     'post_status'    => null,     'numberposts'    => 1,     );     $attachments = get_posts($args);         if ($attachments) {                  foreach ($attachments as $attachment) {                  echo wp_get_attachment_link($attachment->ID, 'thumbnail', false, false);     }     } else {        $post_content = $post->post_content;     preg_match('/\[gallery.*ids=.(.*).\]/', $post_content, $ids);     $attachment_ids = explode(",", $ids[1]);     foreach ($attachment_ids as $attachment_id) {             echo wp_get_attachment_link($attachment_id, 'medium', false, false);     }} ?>          <?php the_content(); ?>           <?php //GETS REMAINING IMAGES     $args = array(     'order'          => 'ASC',     'orderby'        => 'menu_order',     'post_type'      => 'attachment',     'post_parent'    => $post->ID,     'post_mime_type' => 'image',     'post_status'    => null,     'numberposts'    => -1,     );     $attachments = get_posts($args);         if ($attachments) {     $no_show=true;             foreach ($attachments as $attachment) {     if($no_show) {$no_show=false; continue; }             echo wp_get_attachment_link($attachment->ID, 'thumbnail', false, false);     }     }  else {        $post_content = $post->post_content;     preg_match('/\[gallery.*ids=.(.*).\]/', $post_content, $ids);     $attachment_ids = explode(",", $ids[1]);     foreach ($attachment_ids as $attachment_id) {             echo wp_get_attachment_link($attachment_id, 'thumbnail', false, false);     }}?>


How do I display a full post, not just an excerpt?

I am a newbie, so apologies in advance if my terminology is off. I have purchased a theme (WP SmartStart) and I would like the posts in the blog to display fully, not just as excerpts. I read previous questions and answers, and found comments that said to exchange `the_excerpt` with `the_content`. I searched through all the php files, but the only thing that seemed relevant was in the Functions.php file. I will paste it below, but I don't know how to change it so that the full post will display as I have not yet learned php. Any help you can offer would be greatly appreciated. Here is the code that I think needs to be changed:               if ( !function_exists('ss_framework_excerpt_length') ) {          // Sets the post excerpt length to 40 words (or 20 words if post carousel)     function ss_framework_excerpt_length( $length ) {              if( isset( $GLOBALS['post-carousel'] ) )             return 20;              return 40;          }     add_filter('excerpt_length', 'ss_framework_excerpt_length');          }          if ( !function_exists('ss_framework_auto_excerpt_more') ) {          // Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis     function ss_framework_auto_excerpt_more( $more ) {              return '…';          }     add_filter('excerpt_more', 'ss_framework_auto_excerpt_more');


All pages showing up as homepage on Wordpress website

Why would this be happening? Every link I click on on my site results in the homepage again. You can check it out here: http://www.whatamidoingonline.com What is going on here? This just started all of a sudden this morning. I have tried deactivating all plugins (changing plugin directory name), tried publishing new posts and pages, etc.. The problem was caused by a plugin that was supposed to fix a permalink problem, so I deactivated the plugin and the old problem still persisted. Go to my site and click on any of the blog posts, you'll see they result in a 404 error. When I first saw this, I tried yout method. I changed the permalink structure and they worked! but changing them back broke them again. I can't change the permalink structure permanently because of link building and social media stuff I have already done.


Is there a plugin that provides a stackoverflow style editor for wordpress?

I am tired of the tinymce editor in wordpress and I really love the stackoverflow editor which allows me to write with markdown grammar. So I want to write blog with markdown in wordpress. Now I am using this plugin in my wordpress: > Plugin Name: Markdown QuickTags   >  Plugin URI: http://brettterpstra.com/code/markdown-quicktags   >  Description: Replaces the WordPress QuickTags with Markdown-compatible ones   >  Version: 0.8.2   >  Author: Brett Terpstra   >  Author URI: http://brettterpstra.com   >  License: GPLv2 It replaces the original editor of wordpress and provides a light-weight interface for me to write with markdown. However, compared with Stackoverflow's editor, it lacks:   1. The SO editor have auto syntax highlighting. I don't need to specify which kind of language I am typing in. The Markdown QuickTags plugin do not provide the ability for syntax highlighting, and plugins like Wp-markdown-syntax-highlight requires me to manually add a tag to indicate the type of language. Also, I have no idea if the two plugins could work together.   2. The SO editor provides live preview, which is the most cool part of SO. Is there any wordpress plugin(s), or combination of plugins that can meet my requirement? I personally could do some development but I know little about php and js, so it's really hard for me to write one from scratch (or from the two plugins I mentioned above). **Point 1 above is the most important.** And I **don't care** if the plugin auto-converts markdown to html, or requires me to click a button like "render" before publishing.


Gettext Loads slightly different text

@ all single post pages the text to indicate one needs to be logged on to leave a comment is not displayed as expected I have this gettext:               msgid "You must be %1$slogged in%2$s to post a comment."     msgstr "U moet %1$singelogd%2$s zijn  om een reactie achter te laten op dit artikel."      Which is loaded on single.post via comments.php there using:               <?php printf(__('You must be %1$slogged in%2$s to post a comment.', 'framework'), '', '') ?>      The language file is loaded via the parent theme's functions.php using `load_theme_textdomain( 'framework', TEMPLATEPATH.'/lang' ); ` which should load the language file from the parent or child theme I think. But the text I see is `U moet iingelogd zijn op om een reactie achter te laten op dit artikel.` How does this exta i get there? Does TEMPLATEPATH only look for the lang file in the child theme? I do not think so otherwise I would have had no text getting translated as the child has no language file And second, if one is not true, why do I get this odd text?


Regenerate auto excerpts after updating many posts

I had around 100 posts that I imported into my blog. Many of the special characters (e.g. apostrophes, etc) were mangled upon import. I finally went through and fixed them all manually by editing each post and updating it. My theme displays the automatic excerpt of each post on the front page and these have NOT updated. My question is: How can I get WordPress to regenerate the automatic excerpts for all the posts? I'm using 3.5.2 and my theme is using "the_excerpt();" template tag to display these. I haven't used the manual excerpt field to make any of these excerpts.


Displaying the errors from my BuddyPress script

I have a .csv file with hundreds of rows and 2 columns. First column is the group name, and the second is the group description. I need forum to be active on all of the groups. I was told to use this code:               <?php          include "../../../wp-load.php";          $groups = array();          if (($handle = fopen("groupData.csv", "r")) !== FALSE) {         while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {             $group = array('group_id'    => 'SOME ID',                      'name'        => $data[0],                      'description' => $data[1],                      'slug' => groups_check_slug(sanitize_title(esc_attr($data[2]))),                      'date_created' => gmdate( "Y-m-d H:i:s" ),                      'status' => 'public'       );             $groups[] = $group;         }            fclose($handle);     }          foreach ($groups as $group) {         groups_create_group($group);     }           ?>      So I created a php file with this code and opened the file in the browser, and I got a blank screen. And it didn't create the groups. I have no idea what to do from here. What should I do?


How can I assign widgets from WP to appear in bbpress?

The usual set-up: www.domain.com - wordpress installation with sidebars and widgets; www.domain.com/forum - bbpress. BBpress is integrated via bbpress- integration plugin. The question is - how can I assign one sidebar with it's widgets to appear on bbpress' sidebar and be fully functional? Widgets contain contents of wordpress. It would be very tedious to write these specific widgets as custom functions to be inserted in bbpress.


How to add href="" custom post type?

I am trying to modify the CPT Bootstrap Carousel plugin, so that I can add a link button to the carousel items. The plugin creates a custom post type called cptbc_post_type, this post type is basically a gallery which you can display by adding a shortcode. What I want to do is to add a button with a href value that can be set from the backend. The post already supports the title and an excerpt to be set from the backend. I kind of understand where I need to add the code but I can´t figure it out. Any help would be appreciated. The code:               <?php          // Custom Post Type Setup     add_action( 'init', 'cptbc_post_type' );     function cptbc_post_type() {     $labels = array(         'name' => 'Carousel Images',         'singular_name' => 'Carousel Image',         'add_new' => 'Add New',         'add_new_item' => 'Add New Carousel Image',         'edit_item' => 'Edit Carousel Image',         'new_item' => 'New Carousel Image',         'view_item' => 'View Carousel Image',         'search_items' => 'Search Carousel Images',         'not_found' =>  'No Carousel Image',         'not_found_in_trash' => 'No Carousel Images found in Trash',          'parent_item_colon' => '',         'menu_name' => 'Carousel'     );     $args = array(         'labels' => $labels,         'public' => true,         'exclude_from_search' => true,         'publicly_queryable' => false,         'show_ui' => true,          'show_in_menu' => true,         'query_var' => true,         'rewrite' => true,         'capability_type' => 'page',         'has_archive' => true,          'hierarchical' => false,         'menu_position' => 21,         'supports' => array('title','excerpt','thumbnail', 'page-attributes')     );      register_post_type('cptbc', $args);     }               // Add theme support for featured images if not already present     // http://wordpress.stackexchange.com/questions/23839/using-add-theme-support-inside-a-plugin     function cptbc_addFeaturedImageSupport() {     $supportedTypes = get_theme_support( 'post-thumbnails' );     if( $supportedTypes === false )         add_theme_support( 'post-thumbnails', array( 'cptbc' ) );                    elseif( is_array( $supportedTypes ) ) {         $supportedTypes[0][] = 'cptbc';             add_theme_support( 'post-thumbnails', $supportedTypes[0] );     }     }     add_action( 'after_setup_theme', 'cptbc_addFeaturedImageSupport');          // FRONT END          // Shortcode     function cptbc_shortcode($atts, $content = null) {         // Set default shortcode attributes         $defaults = array(         'interval' => '5000',         'showcaption' => 'true',         'showcontrols' => 'true'     );          // Parse incomming $atts into an array and merge it with $defaults     $atts = shortcode_atts($defaults, $atts);          return cptbc_frontend($atts);     }     add_shortcode('image-carousel', 'cptbc_shortcode');          // Display latest WftC     function cptbc_frontend($atts){     $id = rand(0, 999); // use a random ID so that the CSS IDs work with multiple on one page     $args = array( 'post_type' => 'cptbc', 'orderby' => 'menu_order', 'order' => 'ASC');     $loop = new WP_Query( $args );     $images = array();     while ( $loop->have_posts() ) {         $loop->the_post();         if ( '' != get_the_post_thumbnail() ) {             $title = get_the_title();             $content = get_the_excerpt();             $image = get_the_post_thumbnail( get_the_ID(), 'full' );             $images[] = array('title' => $title, 'content' => $content, 'image' => $image);         }     }     if(count($images) > 0){         ob_start();         ?>         <div id="cptbc_<?php echo $id; ?>" class="carousel slide">
             <?php foreach ($images as $key => $image) { ?>                 <li data-target="#cptbc_<?php echo $id; ?>" data-slide-to="<?php echo $key; ?>" data-interval="<?php echo $atts['interval']; ?>" <?php echo $key == 0 ? 'class="active"' : ''; ?>>
             <?php } ?>

             <?php foreach ($images as $key => $image) { ?>                 <div class="item <?php echo $key == 0 ? 'active' : ''; ?>">                     <?php echo $image['image']; ?>                     <?php if($atts['showcaption'] === 'true') { ?>

<?php echo $image['title']; ?>

<?php echo $image['content']; ?>

                     <?php } ?>
             <?php } ?>
             <?php if($atts['showcontrols'] === 'true') { ?>                 <a class="left carousel-control" href="#cptbc_<?php echo $id; ?>" data-slide="prev">‹                 <a class="right carousel-control" href="#cptbc_<?phpecho $id; ?>" data-slide="next">›             <?php } ?>
     <?php }     $output = ob_get_contents();     ob_end_clean();          // Restore original Post Data     wp_reset_postdata();              return $output;     }          // Call the carousel in javascript, else it won't start scrolling on its own     function cptbc_footer_js() {     ?>          <?php     }     add_action('wp_footer', 'cptbc_footer_js');          ?>


Query Number of Loaded Posts in Loop

I'm loading posts via a query of a custom taxonomy called 'band':               $args = array(     'tax_query' => array(         array(             'taxonomy' => 'band',             'field' => 'slug',             'terms' => array('learn', 'trade', 'invest', 'spend')             )         ),     'post_type' => 'post',     'showposts' => 50 );      Because some bands feature less content than others, by the end of the loop I'm left with lots of one kind and only a couple of another so in order to balance the content I want to get to the end of my loop and ask something like:               if( number of posts in band 'learn' <= 6 ) {         #load more learn posts     }      With this method I hope to get my most recent 50 posts but then ensure that I have a minimum of six in each band. I'm using Isotope to filter the Masonry layup so if the user hits the 'Learn' filter button I want to guarantee that the filtered results will find a minimum number of posts in any 'band'.


Testing Multisites with vagrant or Can I use multisite with only an IP address (without domain name)

I'm testing multisite on a vm spun up by using Vagrant. I seem to be having trouble accessing multisite URLs. I've added them as such... ![enter image description here](http://i.stack.imgur.com/hUmIi.png) But when I attempt to visit them in the browser, I unfortunately see a 404 as such... ![enter image description here](http://i.stack.imgur.com/MxIhL.png) As directed, the contents of the .htaccess file are:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]      And I've added the following block of code to `wp-config.php`:               /**      * For developers: WordPress debugging mode.      *      * Change this to true to enable the display of notices during development.      * It is strongly recommended that plugin and theme developers use WP_DEBUG      * in their development environments.      */     define('WP_DEBUG', true);     define('WP_ALLOW_MULTISITE', true);          define('MULTISITE', true);     define('SUBDOMAIN_INSTALL', false);     define('DOMAIN_CURRENT_SITE', '192.168.33.10');     define('PATH_CURRENT_SITE', '/');     define('SITE_ID_CURRENT_SITE', 1);     define('BLOG_ID_CURRENT_SITE', 1);          /* That's all, stop editing! Happy blogging. */      If curious, the only options in my Vagrant file being used are:               [vagrant@vagrant-centos64 vagrant]$ cat Vagrantfile  | grep -v \#          Vagrant.configure("2") do |config|          config.vm.box = "centos64-x86_64-20131030"     vm.network :private_network, ip: "192.168.33.10"      Did I over look something? Is multisite possible with using a IP address and subdomains?


Using wp-cli to Update WP Networks / Multisite from 3.5.1 to 3.8

I've been handed a WP Networks site that is running WP (Networks) 3.5.1 on RHEL 5.8 with about 40 sites attached to it. I see the need to update to 3.8. By background, I'm more familiar with maintaining Drupal sites with `Drush`. My first hunch here is to use `wp-cli` to run the update. Is this the preferred update method in the WP community or am I better swapping out php files from the tar ball? That is, can I depend on `wp-cli` to run a clean update from 3.5.1 to 3.8? Many thanks!


Why are simple updates to wp_postmeta's "_edit_lock" so slow?

In our MySQL slow query log, the cumulatively slowest query is a simple update to wp_postmeta. Here's an example:               UPDATE `wp_postmeta`       SET `meta_value` = '1392835505:386'       WHERE `post_id` = 94705 AND `meta_key` = '_edit_lock';      Relevant details on our setup:   * MySQL slow query time set to 1s   * wp_postmeta's storage engine is InnoDB   * Running within a large Multisite installation with tens of thousands of posts on the main WP blog (where these slow queries are occurring)   * High activity in the WP admin area (lots of writers/editors working concurrently, but generally on their own (not others') content)   * Low activity on the public side of WP (not actually serving up content from the main blog)   * The slow queries seem to all be using the "_edit_lock" key; queries of the same format (that use a key other than "_edit_lock") do not seem to be slow. Why is it that this is the slowest query on our system? Does it have something to do with WP's specific use of "edit locks"? Thanks! :) * * * Update: Output from mysqlsla below:               ______________________________________________________________________ 001 ___     Count         : 606  (16.83%)     Time          : 2257.760468 s total, 3.725677 s avg, 1.00512 s to 84.645869 s max  (20.60%)       95% of Time : 1355.289277 s total, 2.357025 s avg, 1.00512 s to 12.343604 s max     Lock Time (s) : 182.502 ms total, 301 μs avg, 29 μs to 157.542 ms max  (0.21%)       95% of Lock : 22.882 ms total, 40 μs avg, 29 μs to 57 μs max     Rows sent     : 0 avg, 0 to 0 max  (0.00%)     Rows examined : 1 avg, 1 to 2 max  (0.00%)     Database      : xxx_wp     Users         :             xxx_wp@localhost  : 98.84% (599) of query, 51.03% (1837) of all users             yyy_wp@localhost  : 1.16% (7) of query, 0.94% (34) of all users          Query abstract:     SET timestamp=N; UPDATE wp_postmeta SET meta_value = 'S' WHERE post_id = N AND meta_key = 'S';          Query sample:     SET timestamp=1392835506;     UPDATE `wp_postmeta` SET `meta_value` = '1392835505:386' WHERE `post_id` = 94705 AND `meta_key` = '_edit_lock';


How can I load certain JavaScripts only on blog pages?

Here's the situation I'm having. I am developing a site and on the single post pages of the site I am using various social sharing buttons (i.e. Google+, Facebook, LinkedIn, Twitter, etc). I am following the official developer documentation for each of these buttons and most of them require inserting JavaScript before the closing tag. This is all fine and dandy and I've got it working perfectly. However, my only issue is that since these social icons are ONLY on the single post blog pages I don't want that JavaScript being loaded on other pages as it will only add unnecessary resources to be loaded and I'd like to keep my page speed as fast as possible. For the life of me I can't figure out how to go about doing this. I thought at first about writing some conditional PHP code that detected if you were on a single post page and if so it loaded the scripts in the footer. However, I realized that I don't think there's a realistic way to do that since each single post URL doesn't have a consistent part of the URL in it (i.e. /blog/). I could add the JavaScripts to the single.php template for single post pages but that wouldn't work either since it's calling the footer in those pages via and I would like these scripts to be loaded in the footer, not the template itself. Anyways, any input would be appreciated. I'm sure there is a way to do it, I'm just racking my brain and can't figure it out.


Removing Title Tag from Thumbnails

I'm currently adding thumbnails to my page with: `<?php the_post_thumbnail( 'category-thumb' ); ?>` and this in the fuctions.php:               if ( function_exists( 'add_image_size' ) ) {         add_image_size( 'category-thumb', 200, 142 );     }      How do i stop the title tag from being added?


Admin comments and user restrictions

I have set a bunch of roles within wordpress with the help of the "members" plugin. But the capabilities regarding the comments moderation are very limited ("manage_others_comments" or not) What I need to do is: "If my user is level1, only show the comments of category A,B,C, but if my user is level2, only show comments from category B,D,E" I would need that for the "Admin dashboard", for the "Admin post edit", and, if possible, for the "admin search form". I'm struggling with the code to find where I can find the scripts making the related db queries in order to filter them by categories but I just can't find them. PS: I only need this feature for the Admin panel, no the front-end. Any idea?


Display the popular tags by default in the backend post edit page (without having to click on the link that displays them)

I know there should be a way to call the AJAX function by page load but I've been looking at how to do this for hours and can't figure it out. Any help is appreciated.


Wordpress capability_type arguments

I don't know how to figured out what's wrong with my code, Why Custom Post Types "Book" doesn't show on my dashboard, I logged as Admin and I use latest WordPress installed 3.4.1 Here with my code               function codex_custom_init() {            $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 Books'),         'view_item' => __('View Book'),         'search_items' => __('Search Books'),         'not_found' =>  __('No books found'),         'not_found_in_trash' => __('No books found in Trash'),          'parent_item_colon' => '',         'menu_name' => __('Books')            );              $capabilities = array(         'publish_posts' => 'publish_books',         'edit_posts' => 'edit_books',         'edit_others_posts' => 'edit_others_books',         'delete_posts' => 'delete_books',         'delete_others_posts' => 'delete_others_books',         'read_private_posts' => 'read_private_books',         'edit_post' => 'edit_book',         'delete_post' => 'delete_book',         'read_post' => 'read_book'         );                 $args = array(         'labels' => $labels,         'public' => true,         'publicly_queryable' => true,         'show_ui' => true,          'show_in_menu' => true,          'query_var' => true,         'rewrite' => true,         'capability_type' => 'book',         'capabilities' => $capabilities,         'has_archive' => true,          'hierarchical' => false,         'menu_position' => null,         'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )       );             register_post_type('book',$args);          }          add_action( 'init', 'codex_custom_init' );      My code is to add new custom post with custom capabilities for usage of members plugin.


Child theme functions.php do I use php open and close tags?

I setup a child theme which works fine. It's importing the main style.css and has custom css styles along with custom header.php and footer.php files When using functions.php in a child theme it's going to append the child themes functions.php to the main theme. Do I need to wrap my functions in opening and closing php tags or can I just add the following without php tags `add_image_size( 'related-thumbnail', 130, 130, true );`


Incrementally add or substract from usermeta field

I'm trying to create a system to add credits to a user account and then later subtract from the credits when the user submits a post. I have the functions I need to trigger the adding credits and the removing of credits, I just need help with the actual code to get that part done. This is what I want to do: ## Adding credit   1. Set a variable called "`add_credit_amount`" with amount of credit to be added.   2. Get the current user's `ID`   3. Get current `users meta field value` stored in the "`my_user_credit`" field   4. Add the "`add_credit_amount`" variable to the "`my_user_credit`" amount   5. Update the users "my_user_credit" field with the new amount. ## Removing credit   1. Create a variable called "`remove_credit_amount`" and set the amount of credit to be removed.   2. Get the current user's `ID`   3. Get current `users meta field value` stored in the "`my_user_credit`" field   4. Check to see if the value in the "`my_user_credit`" field is greater than or equal to the "`remove_credit_amount`".   5. If it is then subtract the "`remove_credit_amount`" variable from the "`my_user_credit`" field amount and update the users "`my_user_credit`" field with the new amount.   6. If it is not then `echo` this message: "You do not have enough credits to post." * * * Thanks in advance to anyone who can help. UPDATE @JoshuaAbenazer I'm trying to get this to work. I don't want to show the form if they don't have enough credits. Can you see why it does not work right? It does not seem to return the value for the meta field. Thanks               <?php      global $user_ID;     $user_ID = wp_get_current_user();     $creditcount = get_user_meta( $user_ID, 'my_user_credit', true );     if($creditcount <= 4){     echo 'please get more credits';     } else {     echo do_shortcode('[gravityform id=2 title=false description=false]');     }          ?>      Thanks


Hiding an added admin page menu using css

I have added an admin page in wordpress but i needed it to be hidden.I added the page successfully like this               function add_admin_page()     {     $themename = 'Cesaro';     $page_function = 'admin_page';     add_menu_page($themename." Options", $themename, 'edit_themes', $page_function, 'admin_page');     }     add_action('admin_menu', 'add_admin_page');      To hide it,i looked at its css using firebug and discovered a pattern or so it seems.Pages added in the format i demonstrated have a css id that starts with #toplevel_page_{page_added} so the css id to the page i added is #toplevel_page_admin_page. I went ahead and did               #toplevel_page_admin_page{     display:none !important;     }      Is this format #toplevel_page_{page added} consistent with all wordpress installations?.


Posts published last 10 minutes

i have a "featured" section on home page. i want to hide this section after 10 minutes of post publish time. here is the code, i am using. problem is that it hide the "featured" section after 12 hours of post publish time ------- index.php -------                <?php $args = array(         'posts_per_page' => 1, // We are showing only one post         'category_name' => 'featured_post' // showing form category prime                             );          add_filter( 'posts_where', 'filter_where' );     $the_query = new WP_Query( $args );     remove_filter( 'posts_where', 'filter_where' ); ?>          <?php     if ($the_query->have_posts()) :?>      <?php while ($the_query->have_posts()) : $the_query->the_post(); ?>     <?php endwhile; ?>
     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php endif; ?>      ------- Function.php -------                function filter_where( $where = '' ) {      // posts published last 30 minutes      $where .= " AND post_date > '" . date('Y-m-d H:i:s', strtotime('-10 minutes')) . "'";      return $where;      }      * * * please guide me.


Add Class to Specific Link in Custom Menu

I know you can add a class in the custom menu options, but it adds it to the LI before the A. I want to apply the class directly to this specific A rather then the whole LI. So instead of the output being
Link
      I want it too be like this.
Link
      Any ideas?


Conditional statement not working in function

Why doesnt this work ? I am trying to selectively load scripts but the second if statement is not loading them where it should.               function my_init() {         if (!is_admin()) {                  wp_deregister_script('jquery');             wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js', false, '1.5');             wp_enqueue_script('jquery');                      if (in_category('41') )  {                 wp_register_script('validator', '/wp-content/themes/myTheme/library/jquery.validationEngine.js', array('jquery'), '2.0', false);                 wp_enqueue_script('validator');                      wp_register_script('vEngine', '/wp-content/themes/myTheme/library/jquery.validationEngine-en.js', array('validator'), '2.0', false);                 wp_enqueue_script('vEngine');                 }              }                  }     add_action('init', 'my_init');      If I remove the second if statement for that category it works but I want to restrict it to a single category or even an is_single('123') What am I doing wrong?


Multiple plugins using the same OAuth class issues

I just updated a plugin that needed to be updated. The issue is they added support for OAuth, the problem this plugin and another are using the same OAuth classes. Is there a easy way to fix this? I've never messed with OAuth or classes in PHP, I'm not a programmer. Error:               PHP Fatal error:  Cannot redeclare class OAuthSignatureMethod_HMAC_SHA1


WP Insert Post function - Insert Post Thumbnail

Whilst performing wp_insert_post, how would one insert the post thumbnail. I tried the code below to no avail.               $postit = array(         'post_title' => $itemtitle,         'post_content' => '',         'post_status' => 'publish',         'post_type' => 'items',         'post_author' => $user_ID,         'tags_input' => $the_post_id,         'post_thumbnail' => $itemimage,          );      $the_post_idit = wp_insert_post( $postit);      Any ideas, Marvellous


Apply different Class for each element in a foreach()

sorry for the silly question, but I am really lost. I want to apply the following CSS to the even elements of my foreach. **CSS**               .blogArticles a {         float: left;         max-width: 250px;         width: 25%;         color: #333;     }          .blogArticles a:nth-child(even) {         margin: 30px 0 -30px 0;     }      **PHP** **UPDATED (I used snap.svg to render the SVG)**
              <?php                  $page = (isset($_GET['paged'])) ? $_GET['paged'] : 1;                  $args = array(                         'paged'          => $paged,                         'orderby' => 'id',                         'order' => 'DESC',                         'cat' => 50,                         'posts_per_page'    => 20,                         'post_status'      => 'publish',                         'suppress_filters' => true                         );                                        $blogPosts = query_posts( $args );                  if ( have_posts() ) : while ( have_posts() ) : the_post();                  $categories = get_the_category();                  $count = 0;             if ($categories) {                 foreach($categories as $category) {                     $class = ($count%2 == 0) ? "even" : "";         ?>                          <a href="#" class="mix <?php echo $category->name; ?> <?php echo $class; ?>" target="_self" onclick="return false;" data-path-hover="m 0,0 0,100 c 24.580441,3.12569 55.897012,-8.199417 90,-8.199417 34.10299,0 65.41956,11.325107 90,8.199417 L 180,0 z">
                             <?php if ( has_post_thumbnail()) : // Check if Thumbnail exists ?>                                           <?php the_post_thumbnail(); // Fullsize image for the single post ?>                             <?php endif; ?>                             <svg viewBox="0 0 180 320" preserveAspectRatio="none"><path d="m 0,0 0,171.14385 c 24.580441,15.47138 55.897012,24.75772 90,24.75772 34.10299,0 65.41956,-9.28634 90,-24.75772 L 180,0 0,0 z"/></svg>

<?php the_title(); ?>
                                 <p class="label <?php echo $category->name; ?>"><?php echo $category->name; ?>
                                 <button>View</button>

                                       <?php                      $count++;                 }              }              ?>              <?php endwhile; ?>

         <?php html5wp_pagination(); ?>
      **function.php**               function html5wp_pagination()     {         global $wp_query;         $big = 999999999;         echo paginate_links(array(             'base' => str_replace($big, '%#%', get_pagenum_link($big)),             'format' => '?paged=%#%',             'current' => max(1, get_query_var('paged')),             'total' => $wp_query->max_num_pages         ));     }      The problem is that in the foreach every printed `$class` is even! Any hint on where it is my mistake? Thank you in advance! * * * **_If you have problem, as me, displaying the suggested great pagination function, here is the code fixed for the pagination of @Pieter Goosen_**               <?php $count = 1; ?>         <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;             $args = array('paged' => $paged,........);             $blogPosts = new WP_Query( $args );                  if ( $blogPosts->have_posts() ) : ....... while ( $blogPosts->have_posts() ) : $blogPosts->the_post();                 ........                 ........                 ........             }      ?>         <?php $count = $count+1; ?>         <?php endwhile; ?>              <?php wp_reset_postdata(); ?>

          <?php custom_pagination($blogPosts->max_num_pages); ?>


Exclude most recent posts from specific category in wp_query()

I have a featured posts slider, which uses the 'featured' tag. I have a query for this which grabs the 3 most recent posts with this tag and shows them in the slider. Below this, I have a list of 10 or so most recent posts across all categories. How would I write a query to exclude the 3 most recent posts with the 'featured' tag, as these are already in the slider (don't want post duplication), but then when they drop off the slider (i.e they're now the 4th most recent 'featured' post etc), they appear in the post list? EDIT: Here is my code - I've written a shortcode so I can drop it into any page/widget/etc I want but the query for getting the 3 most recent 'featured' posts is here:               posts_per_page=3&post_type=post&tag=featured      and the query which grabs the 10 most recent posts across all categories is:               posts_per_page=10&post_type=post      Hope that's helpful :) Thanks :) EDIT #2: Used @Chip Bennet's answer, inside my short code which almost works but it only excludes one of the featured posts (most recent I think), not all 3 that are on the slider. Here is the code:               function loopShortcode($atts) {              $excludeFeaturedPosts  = array(             'tag' => 'featured',             'posts_per_page' => 3         );              $featured_posts = new WP_Query($excludeFeaturedPosts);              $featured_post_ids = array();         foreach ( $featured_posts as $featured_post ) {             $featured_post_ids[] = $featured_post->ID;         }              wp_reset_query();              // Defaults         extract(shortcode_atts(array(             "posts_per_page" => '', // query parameters are defined by the user when you add the shortcode into the page             "post_type" => ''         ), $atts));              $query_args = array(             "posts_per_page" => $posts_per_page,             "post_type" => $post_type,             "post__not_in" => $featured_post_ids         );              $listedPosts = new WP_Query($query_args);              // rest of short code content, e.g loop, output etc              return $output;         wp_reset_query();     } // end shortcode function


WordPress Custom URLs

Based on the link maioman posted, below I have revised this question: I am having trouble getting a custom post type/taxonomy to work. I want a custom post type of Episodes, and the taxonomy for the custom post type to be Episodes with terms that are generated by the user. I was able to get episodes/custom-term-name/ to work. If you go here, it shows all of the posts that are tied to this term. However if you go to a single post at episodes/custom-term-name/post-title it gives me a 404 page.               function episodes() {          $labels = array(         'name'                => _x( 'Episodes', 'Post Type General Name', 'text_domain' ),         'singular_name'       => _x( 'Episodes', 'Post Type Singular Name', 'text_domain' ),         'menu_name'           => __( 'Episodes', 'text_domain' ),         'parent_item_colon'   => __( 'Parent Item:', 'text_domain' ),         'all_items'           => __( 'All Episodes', 'text_domain' ),         'view_item'           => __( 'View Item', 'text_domain' ),         'add_new_item'        => __( 'Add New Item', 'text_domain' ),         'add_new'             => __( 'Add new episode', 'text_domain' ),         'edit_item'           => __( 'Edit Item', 'text_domain' ),         'update_item'         => __( 'Update Item', 'text_domain' ),         'search_items'        => __( 'Search Item', 'text_domain' ),         'not_found'           => __( 'Not found', 'text_domain' ),         'not_found_in_trash'  => __( 'Not found in Trash', 'text_domain' )     );     $rewrite = array(         'slug'                => 'episodes/%episode_cat%',         'with_front'          => false,         'pages'               => true,         'feeds'               => true     );     $args = array(         'label'               => __( 'episodes', 'text_domain' ),         'description'         => __( 'All episodes', 'text_domain' ),         'labels'              => $labels,         'supports'            => array('title' ),         'hierarchical'        => true,         'public'              => true,         'show_ui'             => true,         'show_in_menu'        => true,         'show_in_nav_menus'   => true,         'show_in_admin_bar'   => true,         'menu_position'       => 5,         'can_export'          => true,         'has_archive'         => true,         'exclude_from_search' => false,         'publicly_queryable'  => true,         'rewrite'             => $rewrite,         'capability_type'     => 'page',         'query_var'           => true,         '_builtin'            => false     );     register_post_type( 'episodes_listing', $args );           }          add_action( 'init', 'episodes', 0 );          function episodes_taxomony() {          $labels = array(         'name'                       => _x( 'Episodes Categories', 'Taxonomy General Name', 'text_domain' ),         'singular_name'              => _x( 'Episodes', 'Taxonomy Singular Name', 'text_domain' ),         'menu_name'                  => __( 'Episode Categories', 'text_domain' ),         'all_items'                  => __( 'All Items', 'text_domain' ),         'parent_item'                => __( 'Parent Item', 'text_domain' ),         'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),         'new_item_name'              => __( 'New Item Name', 'text_domain' ),         'add_new_item'               => __( 'Add new episode', 'text_domain' ),         'edit_item'                  => __( 'Edit Item', 'text_domain' ),         'update_item'                => __( 'Update Item', 'text_domain' ),         'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),         'search_items'               => __( 'Search Items', 'text_domain' ),         'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),         'choose_from_most_used'      => __( 'Choose from the most used items', 'text_domain' ),         'not_found'                  => __( 'Not Found', 'text_domain' )     );     $rewrite = array(         'slug'                       => 'episodes',         'with_front'                 => false,         'hierarchical'               => true          );     $args = array(         'labels'                     => $labels,         'hierarchical'               => true,         'public'                     => true,         'show_ui'                    => true,         'show_admin_column'          => true,         'show_in_nav_menus'          => true,         'show_tagcloud'              => true,         'query_var'                  => true,         'rewrite'                    => $rewrite     );     register_taxonomy( 'episodes_category', array('episodes_listing'), $args );          }               add_action( 'init', 'episodes_taxomony', 0 );          function filter_post_type_link($link, $post)     {     if ($post->post_type != 'episodes_listing')         return $link;          if ($cats = get_the_terms($post->ID, 'episodes_category')) {              //echo 'This is the '. $link;         $link = str_replace('%episode_cat%', array_pop($cats)->slug, $link);     return $link;     }     }     add_filter('post_type_link', 'filter_post_type_link', 10, 2);      In attempts to solve the above issue, I then added in               add_filter('rewrite_rules_array', 'mmp_rewrite_rules');      function mmp_rewrite_rules($rules) {       $newRules  = array();       $newRules['episodes/(.+)/(.+)/(.+)/(.+)/?$'] = 'index.php?custom_post_type_name=$matches[3]'; // my custom structure will always have the post name as the 5th uri segment     $newRules['episodes/(.+)/?$']                = 'index.php?taxonomy_name=$matches[1]';           return array_merge($newRules, $rules);     }      But now /episodes/custom-term-name brings me to homepage /episodes/custom- term-name/post-title brings me to homepage So, nothing works. I've tried changing the $matches array number. Note: in my WP reading settings, I have it set to a static page. This static page is what is showing when I call the mmp_rewrite_rules function.


Interested in redirection techniques for one-page themes

One page themes have become increasingly popular this year, and I'm just working on my first. Although the site's navigation doesn't offer any direct links to the individual pages that make up my one-page presentation, I know it's always possible that someone will try to access them directly, or that they may appear in search engine results. So I'm interested in your ideas on best practices for forcing users back to where I want them. Example, my one-page site is comprised of About, Gallery and Contact. These are built as pages so that the user can easily update them, but they are pulled into one single page for display, and are accessed via anchor IDs. So `mysite.com/#about` etc. But if someone types `mysite.com/about`, I want to force them back to the main page and the anchor point rather than having a single page view of that content. (maybe I'm wrong about this, and if you think so, tell me why) I suppose the easy answer is just to do a rewrite rule to precede any reference to a direct page with the hashtag. But imagine that down the road I'd like to add a blog section that is not contained on the page but that opens a new one? So far my Google searches haven't turned up much discussion on the subject. Maybe it's my search terms that are amiss - so I'd love to hear your ideas, and if you've read any good articles that discuss this, please pass them along!


Plugins folder broken-No website functionality

After some plugin updates caused me to receive a database error, I was unable to access my dashboard. I changed the name of the plugins folder in FTP and it came back online. I then deleted my plugins from the server so that I could individually re- upload the backed up plugins to see which had caused the issue. However, whilst in FTP my plugins seem to upload fine, they do not display on the server, and when I try to upload new plugins on the server, i get this error. "Could not create directory. /home/sites/tbdowenholland.com/public_html/wp-content/plugins/wp-super-cache/ Plugin install failed." This basically means that I have lost all functionalities on the website. It has been suggested that it is a permissions issue. My Public HTML, WP- Content are set to 755 and Plugins to 777. These by knowledge are general settings so I cannot see where a permission error would lie. Any ideas? I'm getting pretty panicky since I installed a back up that did not fix the issue!


Change the search results header from plugin

Hi I'm writing a plugin to include custom search results. I'm not really allowed to edit any theme pages, but the search results page in twentyfourteen's search.php seem hardcoded to me:
<?php printf( __( 'Search Results for: %s', 'twentyfourteen' ), get_search_query() ); ?>
                 <?php if (function_exists("getGlossarySearchResults")) { echo getGlossarySearchResults(); }  ?>                   I have to display the results before the normal search results. So is there any way modify the results output header from code?


Sort Custom Taxonomy Terms in admin by custom order

This question was discussed on here and I believe here as well, but I was wondering if anyone knew of any updates to this since then? To clarify, I currently have a custom taxonomy called 'Days of Week' so I only use seven terms (Monday, Tuesday, Wednesday etc.) but under `hiearchical=>true`, WordPress lists them in an alphabetical order instead.   1. Friday   2. Monday   3. Saturday   4. Sunday   5. Thursday   6. Tuesday   7. Wednesday Normally this wouldn't be an issue, but given that some users of the site might find it confusing, I thought I'd ask to see if anyone had any ideas? Thanks in advance!


ACF Plugin - Dropdown menu of Posts based on Date Picker range

I am building a website with a Custom Post Type, "Events". I would like to use the Advanced Custom Fields (ACF) Plugin to provide custom fields for this post type, 2 of which will be ACF Date Picker Fields - for a start date and end date. I am wondering if it is possible to show a drop down menu (to the front end user) of all of the dates for which their is a post entered? This would include the start dates, end dates, and any dates in between. The end goal being that a clicked date, in the drop down, would load any posts with that date attached to them. For example:   * **Event Post 1**     * starts: Thursday, May 22     * ends: Sunday, May 25   * **Event Post 2**     * starts: Friday, May 23     * ends: Sunday, May 25   * **Movie Post 3**     * starts: Sunday, May 25     * ends: Monday, May 26 The drop down menu would show:   * Thursday, May 22   * Friday, May 23   * Saturday, May 24   * Sunday, May 25   * Monday, May 26 And if **Saturday, May 23** was clicked, in the drop down menu, it would return:   * Event Post 1   * Event Post 2 Any help would be greatly appreciated. I don't really know where to start, aside from assuming this is a probably a job for the query posts function.


Display page of custom posts?

I have a custom post type, "design_asset". I am displaying them on a page template, with the loop               <?php     rewind_posts();     $paged = ( get_query_var( 'paged' ) ) ? get_query_var('paged') : 1;     $args = array( 'post_type' => 'design_asset', 'posts_per_page' => 100, 'orderby' => 'title', 'order' => 'ASC'  );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post();     ?>

             <?php the_post_thumbnail( 'thumbnail', array('class' => 'img-responsive') ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

<?php the_excerpt(); ?>

     <?php    endwhile;   ?>      Also on this page, I am listing the categories with `wp_list_categories` When you click a category in this list, it goes to archive.php and displays the category there, thanks to this post's reply, e.g.`/category/components/` I don't fully understand why Wordpress uses `archive.php` instead of `category.php`, but let's go with it for now. Now, I am trying to re-purpose this loop on `archive.php`. I moved it into `loop-assetThumbs.php` and call it with `<?php get_template_part('loop', 'assetThumbs'); ?>` Of course, it calls ALL of the posts or the post type, I can't figure out how to display only the "active" category in the URL, `/category/components/` How do I modify the loop to do this? Or is there a better way to display categories of custom post types via `wp_list_categories`? Note: I'm also not sure why it's showing 2 empty iterations of the loop here. ![enter image description here](http://i.stack.imgur.com/nUqh6.png)


How to display page excerpt with readmore link inside an enhanced widget?

I'm trying to display an excerpt of a page inside an enhanced widget. I have tried the following but it doesn't work:               <?php     $id = 2550;     $post = get_post($id);     $content = apply_filters('the_content', $post->post_excerpt);     return  $content;     ?>


how to disable inner links in wordpress

i have used jquery accordion menu plugin for site navigation in my wordpress website. in that i like to disable secondary level links for specific main links. i have disabled third level links by > display:none; properties in css, same as i need tricks for hide the secondary level links in navigation for particular main links. if any one have ideas kindly hell me...


WP Infinite loop

It is not working.               add_action( 'save_post', 'jdev_save_custom_meta_box', 13, 2 );          function jdev_save_custom_meta_box(){              global $post;              // Get our form field         if( $_POST ) :              if ( ! wp_is_post_revision( $post->ID ) ) {                  // Update post meta                  $authorTitle = esc_attr($_POST['authorTitle']);                  $authorID = esc_attr( $_POST['book_author_field'] );                  $sectionTitle = esc_attr($_POST['sectionTitle']);                  $sectionID = esc_attr( $_POST['section'] );                       if(strlen($authorTitle) > 0) {                      /*$authors = query_posts(array(                         'post_type' => 'book_author',                         'showposts' => -1,                         's' => $authorTitle                      ));*/                           if(!empty($authorID)) {                          update_post_meta($post->ID, 'book_author_field', $authorID);                      } else {                          remove_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          $insertPostID = wp_insert_post(array(                              'post_status' => 'publish',                              'post_type' => 'book_author',                              'post_title' => $authorTitle,                              'post_content' => ''                          ));                          add_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          update_post_meta($post->ID, 'book_author_field', $insertPostID);                      }                       } else {                     delete_post_meta($post->ID, 'book_author_field');                  }                       if(strlen($sectionTitle) > 0) {                      /*$sections = query_posts(array(                         'post_type' => 'section',                         'showposts' => -1,                         's' => $sectionTitle                      ));*/                           if(!empty($sectionID)) {                          update_post_meta($post->ID, 'section', $sectionID);                      } else {                          remove_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          $insertPostID = wp_insert_post(array(                              'post_status' => 'publish',                              'post_type' => 'section',                              'post_title' => $sectionTitle,                              'post_content' => ''                          ));                          add_action('save_post', 'jdev_save_custom_meta_box', 13, 2 );                          update_post_meta($post->ID, 'section', $insertPostID);                      }                       } else {                     delete_post_meta($post->ID, 'section');                  }              }              endif;          }


How to change a certain text or term of WordPress into a custom into the whole site?

In my WordPess site for client, I used Posts as Products, Comments as Customer Review, Subscribers as Registered Customers and so on. For client's I used Admin Menu Editor to edit the `wp-admin` menu item's titles, i.e.:   * Posts > Products,   * Add New > Add New Product;   * Pages > Web Pages etc. But scenario is:   When someone clicks on the menu "Products", the page appears with "Posts". That's a bit fishy! :( If it is possible I want to make a change in the visualization into the whole site that makes the _word_ "Post" into "Product", "Page" into "Web Page" etc. and relative plurals (i.e. "Posts" into "Products" etc.). - perhaps a kind of filtering... **Awareness:** But I want no conflict with the WordPress keyword "Post" (the post type), or the WordPress keyword "Contributor" (the user role) etc.


How to get meta box values - WP tuts tutorial

I did these tree tutorials to create custom metaboxes.   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-1-intro-and-basic-fields/   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-2-advanced-fields/   * wp.tutsplus.com/tutorials/reusable-custom-meta-boxes-part-3-extra-fields/ but i don't know how to call values from individual fields. I used this php script               $meta = get_post_meta($post->ID, $field['id'], true);     echo $meta;      but id doesn't work. Does someone know what I do wrong. here is my function.php http://www.4shared.com/file/8jmKqGFY/functions.html? and here is my index.php http://www.4shared.com/file/iAWwZim7/index.html?


How to point a public URL to internal (hidden) server with all links following.

I know that you all will be mad with a simple question like this, but I was unable to find a clear answer, therefore I risk to bother :) Yes, I have read Changing_The_Site_URL, but could not find what I need... **In simple terms:** I would like to have a wordpress installation on a bitnami server, sitting on my local (linux) machine, which would be linked transparently for the user to the company intranet (personal) website. **In detail:** What I have running is a bitnami installation on _http://mymachine:8080/wordpress_. I can place a .htaccess on the intranet website (but not much, e.g. no wordpress itself): say _http://intranet/user_. I would like the user to type in the intranet address (http://intranet/user) and get to the wordpress on mymachine:8080/wordpress. **Now to the trouble:** I have set up a HTTP 301 redirection and that works, however, the address in the browser and all the wordpress addresses (RSS,etc) point to the mymachine address. This is not what I want, as I need to be able to replace the local machine and the user should not see any change. I have tried setting the "WP_HOME"/"WP_SITEURL" of the wordpress and a making a 301 redirect in the intranet .htaccess, but the site is then either not visible or it still points to the mymachine. Is there something more I should set up? Thanks a lot!


Post types - Normal Post - Image

I use the ios app to administer my blog. On occasion I also post life pictures up. Question is that when I post an image up from my iPhone the type (image) is shown in the list of post titles. I can't see where this is set? When I go into edit the above post or even create a new post. Is this down to the current theme I am using or am I missing something? Thanks


Cannot edit posts after moving WP site

Just moved a 3.8.1 site to a new hosting service. Copied all files (checking all permissions afterword) as well as a complete copy of the db. Uploaded db on new server, and updated the config file with new credentials. URL did not change. WP loads and displays ok, but when we try to add or edit a post, /wp- admin/post.php returns an unformatted page that says: > Thank you for creating with WordPress. > > Version 3.8.1 > > [animation]Saving revision... Your latest changes were saved as a revision. > > All Posts There's a little "working" animation in from of "Saving..." and the page never updates from there. Any ideas?


Only default permalink is working

I'm getting **trouble** with **another permalink setting then the default permalink setting**. I want to use the post name of a page/article but when I activate "the post name", all of my pages, except the home page, is not working. (all 404-pages). **Steps taken:**   1. Clean install   2. clean twenty x theme I think it is again a **_server issue_** like in my other post: `http://wordpress.stackexchange.com/questions/84151/unable-to-search-install- plugins-via-loged-in-admin` Does somebody knows what I can do about this problem. Btw, I'm not working in the root directory on my server. I copy the **wordpress folder** into the HTTPdocs folder on my server.


Custom height/width for thickbox in WP Backend

I use thickbox in the WP backend for preview or other content. On own pages in the backend works my script very fine and a can use custom width and height for the thickbox. below my code:                                 Now to my problem and question. I will use a thickbox on the page wp- admin/plugins.php and here dont work the script. WP set the height and width always to the core-values and this is to small for my request. Maybe other readers have an idea or a solution. Many thanks!


Why is home (a lot) slower than other pages?

I'm trying to tune a wordpress website which suffers slow loading times, and I found out that the home page seems to take a lot more time to load. It's not due to content because I'm just considering the time it takes for the base request to end (viewable via firebug in firefox). Also I tried copying the index.php code in a custom page, and the same exact code loads in about 1 sec while the main home loads in about 7. I noticed that single pages loaded faster, and at first I thought it was due to the difference in content, but after this test I'm not sure what's causing this. Is there much stuff that wordpress does behind the scenes only for the main index? Is there any other way to explain this situation and, more importantly, fix it so that the home page loads faster? **UPDATE -- DIRTY SOLUTION** After a lot of blind tries, I created a new page called home which uses `index.php` as custom template (not a copy, the same file). I redirected any call to the base path to it (via wordpress' internal rewrite) and I have the same homepage as before, just loaded in 1/6th of the time. While I'm happy with the result, I'd really like to understand what's going on. **ANOTHER UPDATE** So the point seems to be that I cannot use a dynamic (in wordpress' sense) page with this site, it only works fine with a custom "static" page where I insert content via various functions, the normal Loop makes the home either very slow (with high memory limit) or just blank (low memory limit, script fails). As suggested in this question, I created a static home linked to a custom page and it works fine. I also created a blog page (again with a custom template) which also works fine (where "fine" means it shows my empty test page containing just one word and no code) **unless** I specify it as "Posts page" in admin -> Reading settings. In other words it looks like as soon as wordpress sees a dynamic page (the one that's supposed to hold The main Loop) it does something very heavy which eats up a lot of ram. Still looking for the cause of this, I can work around it but I'd really like to understand what the problem is. Edit: added bounty More info: I tried disabling all plugins, wordpress is updated to the latest version. **FURTHER EDIT: TABLE INDEXES** wp_posts:               PRIMARY KEY  (`ID`),     KEY `type_status_date` (`post_type`,`post_status`(1),`post_date`,`ID`),     KEY `post_status_date_gmt` (`post_status`(1),`post_date_gmt`),     KEY `post_date` (`post_date`),     KEY `post_date_gmt` (`post_date_gmt`),     KEY `post_parent` (`post_parent`),     KEY `post_name` (`post_name`),     KEY `post_status` (`post_status`),     KEY `post_author` (`post_author`),     FULLTEXT KEY `post_related` (`post_name`,`post_content`),     FULLTEXT KEY `post_content` (`post_content`,`post_title`),      wp_term_relationships:               PRIMARY KEY  (`object_id`,`term_taxonomy_id`),     KEY `term_taxonomy_id` (`term_taxonomy_id`)      wp_term_taxonomy:               PRIMARY KEY  (`term_taxonomy_id`),     UNIQUE KEY `term_id_taxonomy` (`term_id`,`taxonomy`),     KEY `taxonomy` (`taxonomy`)


How can I save repeatable fields with one value inside an array?

**Introduce** I am currently working on a slider plugin to learn a lot of PHP and WordPress. I have create some repeatable field with javascript. **Some functional details:**   * When the user is clicking on a button, the last row will cloned and all values will reset.    * Add an increase to the javascript code for create unique ids for my input names and id's.   * Add an unique id for my rows that are cloned. **The problem:** I wrote this topic, because I have some issues with saving values from one variable in an array. When I save the post or page, the first field will overwritten. This is because I loop through one image and one caption, not through the `$_POST` variable. **Question:** My question now is how I can resolve this problem? I have also looked at the source code that @brasofilo has recommended at Github - Gist. Brasofilo has only used one meta, but I would like to use a multidimensional array to create my fields. And save the values in one row in the database as an array. I know that I can make use of several other plugins, but as I said before I would like to learn a lot of WordPress and PHP scripting language. **Script PHP:** > Here you can see my used code for now, as I said before, it only saves one > image and one caption.               <?php          // Add meta box support     // This registers a function to be called when the WordPress admin interface is visited     add_action("admin_init", "dsslider_manager_add_meta");     function dsslider_manager_add_meta(){              // Create this cool new meta box for Portfolio Options         add_meta_box("dsslider-meta", "Brandbox Options", "dsslider_manager_meta_options", "brandbox-slider", "normal", "high");     }          // Create the fields array     $prefix = 'dsmeta_';     $custom_meta_fields = array(         array(             'label' => 'Image',             'desc' => '',             'id' => $prefix . 'image',             'type' => 'image',             'repeatable' => true,         ),         array(             'label' => 'Image caption',             'desc' => '',             'id' => $prefix . 'image_caption',             'type' => 'text',             'repeatable' => true,         )     );          // Callback unctions for setting up Brandbox Options     function dsslider_manager_meta_options(){              global $custom_meta_fields, $post;         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )             // (integer) (optional) The post ID whose custom fields will be retrieved.              // Default: Current post             return $post_id;          echo '
';              // Markup for table head         echo '
';         echo '
';                   // Use nonce for verification         echo '<input type="hidden" name="dsmeta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';              // Begin a table row         echo '
';         echo '1	';              foreach ($custom_meta_fields as $field) {             // Get value of this field if it exists for this post             $meta = get_post_meta($post->ID, $field['id'], true);             $type = $field['type'];                  // Each $meta in an table data             echo '';                  // Check if value repeatable is set             if ($field['repeatable']) {                      switch ($type) {                     // Image case                     case 'image':                              $image = get_template_directory_uri() . '/assets/images/default.jpg'; // Default image for the preview                         echo '' . $image . '';                              // If $meta == (equal to) true                         if ($meta) {                             $image = wp_get_attachment_image_src($meta, 'thumbnail');                             $image = $image[0]; // Get the first key of the array - url                         } // End if                              echo '<input type="hidden" name="' . $field['id'] . '" class="upload_image" value="' . $meta . '" />'; // Save the image ID                         echo ''; // Preview uploaded image                         echo '<input type="button" class="button add-image" value="Add image" rel="' . get_the_ID() . '" />'; // Add image                         echo 'Remove image'; // Delete image                          break;                          // Text case                     case 'text':                         echo '<input type="text" name="' . $field['id'] . '[]' . '" id="' . $field['id'] . '" value="' . $meta . '" size="30" /> ';                     break;                      } // End switch statement                  } // End if                  echo '	';              } // End foreach loop              echo '-	';         echo '
'; // End .row                   echo '
'; // End tbody         echo '
'; // End tbody              echo '

';         echo 'Add New Slide';         echo '

';          echo '
'; // End .dsslider_manager_extras     }          // Save the data     add_action('save_post', 'dsslider_manager_save_extras');     function dsslider_manager_save_extras($post_id) {              global $custom_meta_fields;              // Check autosave function         if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {             return $post_id;         } // End if statement              // Check permissions         if ('page' == 'post_type') {             if (!current_user_can('edit_page', $post_id)) {                 return $post_id;             }             elseif (!current_user_can('edit_post', $post_id)) {                 return $post_id;             }         } // End if statement              // Loop through fields and save the data           foreach ($custom_meta_fields as $field) {             if (isset($_POST[$field['id']])) {                 $old = get_post_meta($post_id, $field['id'], true);                 $new = $_POST[$field['id']];                      if ($new && $new != $old) {                     update_post_meta($post_id, $field['id'], $new);                 }                 elseif ('' == $new && $old) {                     delete_post_meta($post_id, $field['id'], $old);                 }             } // End if statement         } // End foreach loop     }


Display posts links from a category group by year

I want to display posts links from a category group by year. Group by year becouse by default wordpress repeat the date for each post. I try use a code but I got all post in current year. How can I do it? Example I want to do: 2010   * post link 20    * post link 19    * post link 18   * ...    * post link 8 2009   * post link 7    * post link 6    * ... The code:               <?php     query_posts(array('nopaging' => 1, /* desabilitar a paginacao pata obter todos os pots. O padrao e ordenado pela data */));     $prev_year = null;          query_posts('cat=27');          if ( have_posts() ) {        while ( have_posts() ) {           $this_year = get_the_date('Y');           if ($prev_year != $this_year) {               // Year boundary               if (!is_null($prev_year)) {                  // A list is already open, close it first                  echo '
';               }               echo '
'. $this_year . '
';        echo '

';                   echo '
';               }           echo '
';                // Imprimi o link do post.       the_post(); ?>
       <h2 id="post-<?php the_ID(); ?>">       <a href="<?php the_permalink(the_title()) ?>"><?php the_title(); ?>

            <?php                 echo '
';           $prev_year = $this_year;             }        echo '
';          }          ?>


How to show a featured image as current?

On the right rail here: http://www.julianamaeberger.com/soma/sample- testimonial-3/ I am showing a random post "Testimonial". Below that I am showing all featured images for the category "Testimonial" so that you can flip through the images and choose where you want to go next. I want to highlight the image that is related to the content above, but can't figure out how to do it. This is my first time building templates, so I may be going about it the wrong way. Any help in the right direction would be much appreciated. Here is the code for the right rail:

Testimonials
          <?php      $postslist = get_posts('category_name=testimonial&numberposts=1&orderby=rand');      foreach ($postslist as $post) :          setup_postdata($post);      ?>          <?php the_content(); ?>          <?php endforeach; ?>

               <?php      $postslist = get_posts('category_name=testimonial&numberposts=-1&order=DES');      foreach ($postslist as $post) :          setup_postdata($post);      ?>
                  <?php the_post_thumbnail( 'nav' ); ?>
               <?php endforeach; ?>


How to create and set a separate template file for articles in Genesis framework? (Wordpress)

I am working in a website which uses Genesis framework (Wordpress). I would like to have different menus for Homepage and articles, how do i create a template in Genesis and use it accordingly? Any suggestions would be helpful. Thanks, Balan


Remove Personal Options section from Profile

I want to hide/remove the Personal Options in the **Your Profile** (`wp- admin/profile.php`) admin page. I am aware that solutions for this exist, but I they use jQuery to do hide this section. This works, but when a user has JavaScript disabled in their browser, it will show up again. Therefore it is not a proper way to remove Personal Options. Is there a way to remove the Personal Options section from the HTML source of the page? This means no jQuery or CSS hacks, or core file modification.


WP Query Wordpress Post Type with the same Taxonomy name

This is what I have:   * Custom Post type "Books" with Taxononies/Categories "Genre" and "Author"   * Another Custom Post Type "Authors" which have all author pictures and bios. This is what I want to do:   * On the single "Book" page, have a sidebar with the books "Author" picture and bio. I know how to get the "Author" Taxonomy of a "Book" post, but the information I need is from the "Author" Custom Post Type with the same name. The only thing i can think of is that the slug for both would be the same (i.e. if the books author was "John Smith", the taxonomy would be "john-smith" and the post that I need to query from my "Authors" Custom Post Type would also be "john- smith"). I just don't know how to go about getting it or if there is another way of doing it. I think it should be something like this:                  $bookauthor = wp_get_post_terms($post->ID, 'author', array("fields" => "slug"));        $custom_query = new WP_Query(array(        'post_type' => 'authors',        'name' => $bookauthor      or this:                  $bookauthor = wp_get_post_terms($post->ID, 'author');        $bookauthorslug = $bookauthor[0]->slug;        $custom_query = new WP_Query(array(        'post_type' => 'author',        'name' => $bookauthorslug      But neither works.


Changing 'rewrite' argument after custom post type is registered

I'm am attempting to change the rewrite argument after it has been defined and passed as an argument for 'register_post_type' in a plugin. My issue is that I am utilizing a plugin that defines a custom post type. I can manually edit the rewrite argument in the plugin; however, doing so will mean that I have to do this every time the plugin updates. I was wondering if there is a way that I can change this with some code in another plugin or functions.php file. I was thinking there might be a function that would allow me to alter these arguments or a way in which I could unregister and reregister the custom post type. Any ideas?


White screen when saving changes

I just migrated a WordPress Multisite and Database locally and have successfully setup everything using MAMP Pro. The website and back-end load great and the subdomains work as expected once added the the hosts file. I am having a strange issue however when I try to make any updates to the back-end. For instance: When going to a page, making updates and then clicking the "update" button, it submits the update but then displays just a white screen. Seems like when I navigate back to that page the update has been added to the database but I can't figure out why only a white page is being displayed instead of redirecting back to the updated page. I've spent hours trying to figure this out with no success. Below are the error messages I receive: Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp-includes/wp- db.php on line 1142 Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/functions.php on line2905 Notice: automatic_feed_links is deprecated since version 3.0! Use add_theme_support( 'automatic-feed-links' ) instead. in /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/functions.php on line 2900 Warning: Cannot modify header information - headers already sent by (output started at /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/wp-db.php:1142) in/Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- admin/post.php on line 222 Warning: Cannot modify header information - headers already sent by (output started at /Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/wp-db.php:1142) in/Users/myname/Desktop/Dropbox/Development/Websites/website.com/wp- includes/pluggable.php on line 875


Any way to sync mailing list members with a WP role?

I was able to do this in Drupal, where people could be added to a mailing list (ie Mailchimp, etc) when registering for a site. I'd like to figure out how to do this in WordPress. I'd like to offer a free course on a site for people who sign up for my mailing list. I'm thinking it's less likely that I can sync a mailing list to WP - perhaps there's a way to require subscription to a mailing list when someone registers?


Populate a ACF Select Dropdown from Custom Post Type

Is it possible to populate an Advanced Custom Fields (ACF) Select Dropdown - options - with all the posts within a specific Custom Post Type (PCT)? Thanks in advance, Ian.


How to make a posts page display only intros of posts?

My blog, the Posts page here: http://richardclunan.com/blog - displays full blog posts. I'd like it to display only the intros to the posts, and users click into a post to read the full post -- because users will then be able to more easily scroll through the posts to decide which ones to read. How do I make the page richardclunan.com/blog display only post intros? ......... Edit: I found a 'category.php' file in my 'twentyeleven' folder. But not in 'twentyeleven-child'. So I guess it's the one in 'twentyeleven'. I couldn't find:               the_content();      But I found the following 7 lines of code in different places -- each has the the word 'content' in -- is it any of these lines I need to change?:
          <?php twentyeleven_content_nav( 'nav-above' ); ?>          get_template_part( 'content', get_post_format() );          <?php twentyeleven_content_nav( 'nav-below' ); ?>