Updated WordPress, now Navigation is Messed Up

I recently updated the WP of a friend's site that I'm working on. Now his navigation bar is messed up and I'm new to WP so I'm not sure where to go to fix it. Here's the site: http://www.millermusiclessons.com/ Here's what the nav should look like: http://www.millermusicllc.com/ Thanks


How to Catch Last Widget box From Same Widget Area?

is there any Way to Catch Last widget box or div from same widget area?? i mean i have 4 widgets in footer widget area but due to design issue my 3rd widget box style+width is different.so i want to add extra class to 3rd box container using php.is there any way to do that? please reply. Thanks in advance. :)


Can I use a form in a dashboard widget?

I'm building a plugin and would like to add a dashboard widget with a custom form. In this form, users should be able to edit a list of strings (add, edit and remove items). Is there a WordPress API to do something like that? I already know how to add a dashboard widget, but I don't know how to make a form in a dashboard widget / how to process the data. The only thing I can think of is to redirect the user to my options page - there must be a neater way. Is there any?


Force pdf download not working when include blog-header.php

I have this code which works in a file called downloads/download.php:               <?php     header('Content-type: application/octet-stream');     header('Content-Disposition: attachment; filename="file.pdf"');     readfile('file.pdf');     ?>      It correctly prompts to download file.pdf. I need to track downloads so I want to make use of various WP functions. To bring the page inside WP I added blog-header.php like so:               <?php     define('WP_USE_THEMES', false);     require('../wp-blog-header.php');     header('Content-type: application/octet-stream');     header('Content-Disposition: attachment; filename="file.pdf"');     readfile('file.pdf');     ?>      This returns a 404. Does anyone know why bringing the page inside WP would cause this?


Gravity forms multiple posts generated by one form

**THE GOAL** _Example 1: Job Applicant + Mailing List_ Wondering if this could be possible, I have a simple form of 30 fields of Curricullum Vitae of some Job Applicant (custom post type: job_applicant) and I would like to use let's say 5 fields from this form to automaticaly create a new user for custom post type ("mailing_list") _Example 2: Event + Club listings_ Another example is to generate the form using custom post type "EVENT" with club location fields and then after submission in the background create a new custom post type "club_listings" info. Is it hard to create in the background e new custom post type CLUB entry with some 3-5 fields one per line? **Purpose**   1. Time saving    2. Better categorizing  **Conclusion** Can somebody help me by providing any example here ? All I want is to use one form to generate 2 different custom post type posts. I am able to create the one bigger form, I would like to know if there's some simple hack to generate also another one different little CPT form with 3-5 specific fields. I am trying to understand this issue with the help of documentation on GF pages: http://www.gravityhelp.com/documentation/page/Gform_after_submission Very amateur example below:               01  <?php     02  add_action("gform_after_submission", "set_post_content", 10, 2);     03  function set_post_content($entry, $form){     04        05      //creating NEW custom post type entry     06      $post =      07        08      //creating custom post type content     09      $post->post_content = "Club Info: "
 " . $entry[1] . "
     10   "
 " . $entry[2] . "
     11   "
 " . $entry[3] . "
     12   "
 " . $entry[4] . "
     13   "
 " . $entry[5] . "
     14        15      //updating post     16      wp_update_post($post);     17  }     18  ?>


Adding tables to the WordPress Editor

I tried this fix: http://www.paulund.co.uk/display-full-tinymce-editor-in- wordpress But I see no change in my editor. So how do I enable tables in the wordpress editor. MY function is:               function tinyMCETables($args)     {      $args['theme_advanced_blockformats'] = 'p,address,pre,code,h1,h2,h3,h4,h5,h6';      $args['wordpress_adv_hidden'] = false;      return $args;     }     add_filter('tiny_mce_before_init', 'tinyMCETables' );      And yes, I know about the tincMCE Advanced plugin but I want to build the feature into my theme. Is there another way to enable tables?


How to remove a class

Is it possible to remove classes from a plugin and add theme into to theme? I need to modify Woocommerce `WP_Checkout` class but I want to move it to my theme folder so if woocommerce will be updated my changes will not be effected. Is theme some way to make an remove and add action/hook? Or maybe unhook page and add my custom page with the class? Thanks in advance Patrick


What are some good resources for teaching end-users how to use WordPress?

As a web designer and developer, I'd love to simply point out my clients to some YouTube videos or articles that explain from the ground up what WordPress is without blowing their mind. Some of my clients are fairly well versed in internet, email and Word, but that's about their remit. Does anyone know of some good tutorials, resources, articles or videos that are good to show my clients?


Adding a theme option to the admin that lets me turn on/off a javascript file

I want to add a theme option to the Wordpress admin so that I don't need to commit code every time I need to "activate" (or deactivate by commenting out) an Optimizely javascript snippet I only want run occasionally. I googled this question, but most of the posts I saw were related to to running CSS or JS on the admin page, and weren't related to adding a theme option. I'm not sure how to get started. Do I have to register a setting (http://codex.wordpress.org/Settings_API#Adding_Setting_Fields)? If so, in which file do I add add_settings_field function? Functions.php?


Transients vs CRON +Custom Fields: Caching Data Per Post

Wanted some opinions on a solution I'm trying to come up with: I have a fan/enthusiast plugin I'm working on for fans of TV shows. One of the custom post types attached to the plugin is a release type which stores data on dvd releases of a show. Some of the meta data that I weant stored is info from Amazon using their Product Advertising API. I wanted to cache some of the pricing data available there, such as the current price of the dvd. I was thinking of using transients but from what I can tell their nothing more than a layer on WP options; their too global. I'd have to create numerous transients with a naming scheme that would point to a certain post. The other option would be to use custom fields but use the CRON API to update it, I'd either have one Cron job update all the custom fields hourly or create one cron job per post that did so. My question is which solution would be more practical performance and convenience wise?


Slow speed and high CPU usage for my code. How to improve it?

this is my code. It gets the variables from the url. It is very slow and sometimes don't even complete. How can I improve it? Note: Most of the times some of the variables will not have any value. I thought that if I check this and remove it's array from the query it will improve it somehow.               $value1 = $_GET['extra1'];     $value2 = $_GET['extra2'];     $value3 = $_GET['extra3'];     $value4 = $_GET['extra4'];     $value5 = $_GET['extra5'];     $value6 = $_GET['extra6'];     $value7 = $_GET['extra7'];     $value8 = $_GET['extra8'];     $value9 = $_GET['extra9'];     $value10 = $_GET['extra10'];          $args = array(         'meta_query' => array(             array(                 'key' => extra1,                 'value' => $value1,                 'compare' => '='             ),             array(                 'key' => extra2,                 'value' => $value2,                 'compare' => '='             ),             array(                 'key' => extra3,                 'value' => $value3,                 'compare' => '='             ),             array(                 'key' => extra4,                 'value' => $value4,                 'compare' => '='             ),             array(                 'key' => extra5,                 'value' => $value5,                 'compare' => '='             ),             array(                 'key' => extra6,                 'value' => $value6,                 'compare' => '='             ),             array(                 'key' => extra7,                 'value' => $value7,                 'compare' => '='             ),             array(                 'key' => extra8,                 'value' => $value8,                 'compare' => '='             ),             array(                 'key' => extra9,                 'value' => $value9,                 'compare' => '='             ),             array(                 'key' => extra10,                 'value' => $value10,                 'compare' => '='             )         )      );     $query = new WP_Query( $args );          if ( $query->have_posts() ) :          while ( $query->have_posts() ) : $query->the_post();             the_title();         endwhile;     endif;


Cookie free site

I have followed directions to make my wordpress cookie free. I've made my subdomain, pointed to my php folder and now I'm stuck. What am I suppose to do with this:               bloginfo ('template _directory')      There is no real help or a tutorial to show this anywhere. Like, where am I suppose to even put this code, and what am I suppose to replace the wording with. Along with any additional strings to make my site cookie free. Unless there is some kind of plugin that I can use for WP to skip all this. I am not web savvy at all, and know nothing about coding. Some kind of help here would be great.


Rolling your own WordPress Themes

I am looking to build my own WordPress theme to house my artwork. Can someone point me to the best tutorials for doing so and also give me some pointers on the best approach to building an image gallary? For example Should I build a custom gallery? Is there a suitable plugin that will simplify things? For background I have a reasonably high level of experience in PHP, HTML5 and CSS3 so have no issues with rolling my own, however I have never built a WordPress theme before.


Grouping categories by genre

My wordpress video blog have several categories. Lets say the category can belong to several genres e.g actions,horror,mystery and another category belong to actions,horror,romance How do I group categories into genres? Cause in the most basic structure, we group posts into category. Now i want group categories into genres Then be able to display the category in the genre by a url such as http://www.domain.com/genre/actions and it will list all categories in it. Here's an example site that has this feature http://www.anime44.com/anime- genre/Fantasy


Share user table from WP with Drupal

I'm developing a sister website to a well-established private site that is already built in Wordpress. I can't use Wordpress to create what I need and I am therefore using Drupal. The owners of the Wordpress site do not want their users to have to go through a separate login process to get into the Drupal site and would like their users to be able to click a link to the Drupal site and automatically be logged into the Drupal site, based on their Wordpress credentials. I know this must be possible, but where should I start, what do I need to know/learn in order to do this?


using images in next/previous_post_link

In my blog's pagination section, I've used `<?php previous_post_link(); ?>` and `<?php next_post_link(); ?>` to generate the newer and older posts links. Within that action, though, I've included an empty span that I insert an image in with CSS. While no errors have been generated by the code, the images don't show up. I'm wondering why this is, and if there is an easier/better what to achieve the desired effect?

<?php previous_post_link(' older posts'); ?>

<?php next_post_link(' newer posts'); ?>

          #blog .pagination {         background: url('img/dots_large.png') no-repeat;         height: 169px;         width: 635px;         float: right;         margin-right: 14px;         padding-bottom: 20px;         text-align:center;     }          #blog .pagination ul {          display:inline;         margin: 0 auto;     }          #blog .pagination ul li {         display: inline;         margin: 0 auto;         width: 290px;     }          #blog .pagination .left-arrow {         padding-right: 20px;     }          #blog .pagination .right-arrow {         padding-left: 20px;     }               #blog .pagination span.left-arrow {         background: url('arrow_left.png') no-repeat;     }          #blog .pagination span.right-arrow {         background: url('arrow_right.png') no-repeat;     }      live site


Custom blog settings

What is the best way to add new custom blog settings to the Wordpress general settings (or some other settings page for that matter), such that these settings are available to the theme to use? For example I would like simple settings like the Twitter URL and Facebook Page URL to be configurable, rather than hardcoded in the theme. It would be nice if I could then access them via the `bloginfo()` function, but any other function will do just the same.


Show 'add comment' link for status updates in Twenty Thirteen

I have WP 3.6 running on my server. After playing around with it, I noticed that it's not very intuitive to add comments to a status update; ![enter image description here](http://i.stack.imgur.com/So5Iz.png) Guess how? After some thought, I have decided I would like for it to look more like this: ![enter image description here](http://i.stack.imgur.com/2gJmk.png) Or some variation thereof The `click to show/leave comments` text is simply appended on the end of the existing `Status on...` link. I've dug around in the PHP files, but can't seem to figure out how to make this simple change. Is there a file somewhere that dictates what strings to display? Any ideas?


Minimal wordpress load for only `get_option` to work (because ajax...)

In a plugin I use ajax to `get_option()` which takes much longer than it has to because entire wp gets loaded. How do I set things up so that it (my ajax) loads only what is needed? (`get_option()`)


Only Display a Featured Image on First Post Page

In WordPress a single post can be divided into multiple pages using page- links. Currently, I use featured images on my post pages and call them by size, as shown below. If an image is larger than 500 pixels it is displayed as the top- post thumbnail and if it is smaller than that it displays as the standard thumbnail.               <?php $image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),  'full' );     if ( $image_data[1] >= 500 ) { the_post_thumbnail('top-post');     } ?>          <?php $image_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),  'full' );     if ( $image_data[1] < 500 ) { the_post_thumbnail();     } ?>      The problem is when I include this in my single-post.php it shows up on every page of a post, even when that post is divided by page-links. How do I make these images only show on the first page?


Page Navigation for list of post

After getting help from ghost toast... I am almost seeing the light of day with this issue. Using this code I have been able to have a query of post show. However I am unable to figure out how to code it to work with the navigation. Thanks Ghost!               <?php while (have_posts()) : the_post(); ?>              <div class="post" id="post-<?php the_ID(); ?>">
                 <?php the_time('j') ?>                 <?php the_time('M') ?>

<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>

                 <?php the_excerpt(); ?>

Posted by <?php the_author() ?>.<?php edit_post_link('Edit', ' |          ', ''); ?>

               <?php endwhile; endif; ?>                <?php     global $wp_query;          $query = new WP_Query( 'cat=1' );           $big = 999999999; // need an unlikely integer           echo paginate_links( array(     'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),     'format' => '?paged=%#%',     'current' => max( 1, get_query_var('paged') ),     'total' => $wp_query->max_num_pages     ) );     ?>


How do I programmatically add items to a custom post type?

I have a custom post type to which I'd like to programmatically import data. I have followed these instructions and these, and I can easily do it for WP typical pages and posts. However, my custom post type has fields for longitude and latitude, for example. How do I figure how how those names (array keys) should be referred to in the post array?               $defaults = array(                 'comment_status' => 'closed',                 'ping_status' => 'closed',                 'post_author' => $author_id,                 'post_name' => $slug,                 'post_title' => $title,                 'post_status' => 'publish',                 'post_type' => 'ait-dir-item',            longitude => $my_long,   // <- what's the key here?            latitude  => $my_lat     // <- what's the key here?                 );      Note I did not create the custom post type. There are about 40 extra fields I have to add data to.


Why is this custom post type defaulting to archive.php?

Working with a plugin (SermonManager) and noticed that, for the custom type defined here (wpfc_sermon), the default archive.php page is being used to render the content _instead_ of the archive-wpfc_sermon.php ... and I'd like to know why and how to fix? Here is the relevant code:               <?php     /*      * Creation of Sermon Post Types and Taxonomies      * Also all meta boxes      */          // Determine the correct slug name based on options     function generate_wpfc_slug($slug_name = NULL) {         $sermon_settings = get_option('wpfc_options');         $archive_slug = $sermon_settings['archive_slug'];         if(empty($archive_slug)) {             $archive_slug = 'sermons';         }              if (!isset($slug_name)) {             return array ('slug' => $archive_slug, 'with_front' => false);         }              if (isset($sermon_settings['common_base_slug']) == '1') {             return array ('slug' => $archive_slug."/".$slug_name, 'with_front' => false);         } else {             return array ('slug' => $slug_name, 'with_front' => false);         }     }           // Create sermon Custom Post Type     add_action('init', 'create_wpfc_sermon_types');     function create_wpfc_sermon_types() {            $labels = array(         'name'                  => __( 'Sermons',                   'sermon-manager' ),         'singular_name'         => __( 'Sermon',                    'sermon-manager' ),         'add_new'               => __( 'Add New',                   'sermon-manager' ),         'add_new_item'          => __( 'Add New Sermon',            'sermon-manager' ),         'edit_item'             => __( 'Edit Sermon',               'sermon-manager' ),         'new_item'              => __( 'New Sermon',                'sermon-manager' ),         'view_item'             => __( 'View Sermon',               'sermon-manager' ),         'search_items'          => __( 'Search Sermons',            'sermon-manager' ),         'not_found'             => __( 'No sermons found',          'sermon-manager' ),         'not_found_in_trash'    => __( 'No sermons found in Trash', 'sermon-manager' ),         'menu_name'             => __( 'Sermons',                   'sermon-manager' ),       );            $args = array(         'labels'                => $labels,         'public'                => true,         'publicly_queryable'    => true,         'show_ui'               => true,         'show_in_menu'          => true,         'query_var'             => true,         'menu_icon'             => SM_PLUGIN_URL.'includes/img/book-open-bookmark.png',         'capability_type'       => 'post',         'has_archive'           => true,         'rewrite'               => generate_wpfc_slug(),         'hierarchical'          => false,         'supports'              => array( 'title', 'comments', 'thumbnail', 'entry-views' )       );        register_post_type('wpfc_sermon',$args);     }          //create new taxonomies: preachers, sermon series, bible books & topics     add_action( 'init', 'create_wpfc_sermon_taxonomies', 0 );     function create_wpfc_sermon_taxonomies() {          //Preachers     $labels = array(             'name'                          => __( 'Preachers',                                 'sermon-manager' ),         'singular_name'                 => __( 'Preacher',                                  'sermon-manager' ),         'menu_name'                     => __( 'Preachers',                                 'sermon-manager' ),         'search_items'                  => __( 'Search preachers',                          'sermon-manager' ),         'popular_items'                 => __( 'Most frequent preachers',                   'sermon-manager' ),         'all_items'                     => __( 'All preachers',                             'sermon-manager' ),         'edit_item'                     => __( 'Edit preachers',                            'sermon-manager' ),         'update_item'                   => __( 'Update preachers',                          'sermon-manager' ),         'add_new_item'                  => __( 'Add new preacher',                          'sermon-manager' ),         'new_item_name'                 => __( 'New preacher name',                         'sermon-manager' ),         'separate_items_with_commas'    => __( 'Separate multiple preachers with commas',   'sermon-manager' ),         'add_or_remove_items'           => __( 'Add or remove preachers',                   'sermon-manager' ),         'choose_from_most_used'         => __( 'Choose from most frequent preachers',       'sermon-manager' ),         'parent_item'                   => null,         'parent_item_colon'             => null,     );          register_taxonomy('wpfc_preacher','wpfc_sermon', array(         'hierarchical'  => false,         'labels'        => $labels,         'show_ui'       => true,         'query_var'     => true,         'rewrite'       => generate_wpfc_slug('preacher'),     ));          //Sermon Series     $labels = array(             'name'                          => __( 'Sermon Series',                         'sermon-manager' ),         'singular_name'                 => __( 'Sermon Series',                         'sermon-manager' ),         'menu_name'                     => __( 'Sermon Series',                         'sermon-manager' ),         'search_items'                  => __( 'Search sermon series',                  'sermon-manager' ),         'popular_items'                 => __( 'Most frequent sermon series',           'sermon-manager' ),         'all_items'                     => __( 'All sermon series',                     'sermon-manager' ),         'edit_item'                     => __( 'Edit sermon series',                    'sermon-manager' ),         'update_item'                   => __( 'Update sermon series',                  'sermon-manager' ),         'add_new_item'                  => __( 'Add new sermon series',                 'sermon-manager' ),         'new_item_name'                 => __( 'New sermon series name',                'sermon-manager' ),         'separate_items_with_commas'    => __( 'Separate sermon series with commas',    'sermon-manager' ),         'add_or_remove_items'           => __( 'Add or remove sermon series',           'sermon-manager' ),         'choose_from_most_used'         => __( 'Choose from most used sermon series',   'sermon-manager' ),         'parent_item'                   => null,         'parent_item_colon'             => null,     );          register_taxonomy('wpfc_sermon_series','wpfc_sermon', array(         'hierarchical'  => false,         'labels'        => $labels,         'show_ui'       => true,         'query_var'     => true,         'rewrite'       => generate_wpfc_slug('series'),     ));          //Sermon Topics     $labels = array(             'name'                          => __( 'Sermon Topics',                         'sermon-manager' ),         'singular_name'                 => __( 'Sermon Topics',                         'sermon-manager' ),         'menu_name'                     => __( 'Sermon Topics',                         'sermon-manager' ),         'search_items'                  => __( 'Search sermon topics',                  'sermon-manager' ),         'popular_items'                 => __( 'Most popular sermon topics',            'sermon-manager' ),         'all_items'                     => __( 'All sermon topics',                     'sermon-manager' ),         'edit_item'                     => __( 'Edit sermon topic',                     'sermon-manager' ),         'update_item'                   => __( 'Update sermon topic',                   'sermon-manager' ),         'add_new_item'                  => __( 'Add new sermon topic',                  'sermon-manager' ),         'new_item_name'                 => __( 'New sermon topic',                      'sermon-manager' ),         'separate_items_with_commas'    => __( 'Separate sermon topics with commas',    'sermon-manager' ),         'add_or_remove_items'           => __( 'Add or remove sermon topics',           'sermon-manager' ),         'choose_from_most_used'         => __( 'Choose from most used sermon topics',   'sermon-manager' ),         'parent_item'                   => null,         'parent_item_colon'             => null,     );          register_taxonomy('wpfc_sermon_topics','wpfc_sermon', array(         'hierarchical'  => false,         'labels'        => $labels,         'show_ui'       => true,         'query_var'     => true,         'rewrite'       => generate_wpfc_slug('topics'),     ));          //Books of the Bible     $labels = array(             'name'                          => __( 'Book of the Bible',                         'sermon-manager' ),         'singular_name'                 => __( 'Book of the Bible',                         'sermon-manager' ),         'menu_name'                     => __( 'Book of the Bible',                         'sermon-manager' ),         'search_items'                  => __( 'Search books of the Bible',                 'sermon-manager' ),         'popular_items'                 => __( 'Most popular books of the Bible',           'sermon-manager' ),         'all_items'                     => __( 'All books of the Bible',                    'sermon-manager' ),         'edit_item'                     => __( 'Edit book of the Bible',                    'sermon-manager' ),         'update_item'                   => __( 'Update book of the Bible',                  'sermon-manager' ),         'add_new_item'                  => __( 'Add new books of the Bible',                'sermon-manager' ),         'new_item_name'                 => __( 'New book of the Bible',                     'sermon-manager' ),         'separate_items_with_commas'    => __( 'Separate books of the Bible with commas',   'sermon-manager' ),         'add_or_remove_items'           => __( 'Add or remove books of the Bible',          'sermon-manager' ),         'choose_from_most_used'         => __( 'Choose from most used books of the Bible',  'sermon-manager' ),         'parent_item'                   => null,         'parent_item_colon'             => null,     );          register_taxonomy('wpfc_bible_book','wpfc_sermon', array(         'hierarchical'  => false,         'labels'        => $labels,         'show_ui'       => true,         'query_var'     => true,         'rewrite'       => generate_wpfc_slug('book'),     ));          //Service Type     $labels = array(             'name'                          => __( 'Service Type',                          'sermon-manager' ),         'singular_name'                 => __( 'Service Type',                          'sermon-manager' ),         'menu_name'                     => __( 'Service Type',                          'sermon-manager' ),         'search_items'                  => __( 'Search service types',                  'sermon-manager' ),         'popular_items'                 => __( 'Most popular service types',            'sermon-manager' ),         'all_items'                     => __( 'All service types',                     'sermon-manager' ),         'edit_item'                     => __( 'Edit service type',                     'sermon-manager' ),         'update_item'                   => __( 'Update service type',                   'sermon-manager' ),         'add_new_item'                  => __( 'Add new service types',                 'sermon-manager' ),         'new_item_name'                 => __( 'New Service Type',                      'sermon-manager' ),         'separate_items_with_commas'    => __( 'Separate service types with commas',    'sermon-manager' ),         'add_or_remove_items'           => __( 'Add or remove service types',           'sermon-manager' ),         'choose_from_most_used'         => __( 'Choose from most used service types',   'sermon-manager' ),         'parent_item'                   => null,         'parent_item_colon'             => null,     );          register_taxonomy('wpfc_service_type','wpfc_sermon', array(         'hierarchical'  => false,         'labels'        => $labels,         'show_ui'       => true,         'query_var'     => true,         'rewrite'       => generate_wpfc_slug('service-type'),     ));     }          // Initialize the metabox class.     add_action( 'init', 'initialize_wpfc_sermon_meta_boxes', 9999 );     function initialize_wpfc_sermon_meta_boxes() {         require_once plugin_dir_path( __FILE__ ) . '/meta-box/init.php';         }          add_filter( 'wpfc_meta_boxes', 'wpfc_sermon_metaboxes' );     // Define the metabox and field configurations.     function wpfc_sermon_metaboxes( array $meta_boxes ) {              $meta_boxes[] = array(             'id'         => 'wpfc_sermon_details',             'title'      => __('Sermon Details', 'sermon-manager'),             'pages'      => array( 'wpfc_sermon', ), // Post type             'context'    => 'normal',             'priority'   => 'high',             'show_names' => true, // Show field names on the left             'fields'     => array(                 array(                     'name' => __('Date', 'sermon-manager'),                     'desc' => __('Enter the date the sermon was given. NOTE: Each sermon must have a date!', 'sermon-manager'),                     'id'   => 'sermon_date',                     'type' => 'text_date_timestamp',                 ),                 array(                     'name'    => __('Service Type', 'sermon-manager'),                     'desc'    => __('Select the type of service. Modify service types in Sermons -> Service Types.', 'sermon-manager'),                     'id'      => 'wpfc_service_type_select',                     'type'    => 'taxonomy_select',                     'taxonomy' => 'wpfc_service_type',                 ),                 array(                     'name' => __('Main Bible Passage', 'sermon-manager'),                     'desc' => __('Enter the Bible passage with the full book names,e.g. "John 3:16-18".', 'sermon-manager'),                     'id'   => 'bible_passage',                     'type' => 'text',                 ),                 array(                     'name' => __('Description', 'sermon-manager'),                     'desc' => __('Type a brief description about this sermon, an outline, or a full manuscript', 'sermon-manager'),                     'id'   => 'sermon_description',                     'type' => 'wysiwyg',                     'options' => array( 'textarea_rows' => 7, 'media_buttons' => false,),                 ),             ),         );              $meta_boxes[] = array(             'id'         => 'wpfc_sermon_files',             'title'      => __('Sermon Files', 'sermon-manager'),             'pages'      => array( 'wpfc_sermon', ), // Post type             'context'    => 'normal',             'priority'   => 'high',             'show_names' => true, // Show field names on the left             'fields'     => array(                 array(                     'name' => __('Location of MP3', 'sermon-manager'),                     'desc' => __('Upload an audio file or enter an URL.', 'sermon-manager'),                     'id'   => 'sermon_audio',                     'type' => 'file',                 ),                 /* just testing for duration and file size fields _wpfc_sermon_duration & _wpfc_sermon_size                 array(                     'name' => __('MP3 Duration', 'sermon-manager'),                     'desc' => __('Length in minutes (will be automatically determined by Sermon Manager when you save)', 'sermon-manager'),                     'id'   => '_wpfc_sermon_duration',                     'type' => 'text',                 ),                 array(                     'name' => __('MP3 File size', 'sermon-manager'),                     'desc' => __('File size in bytes (will be automatically determined by Sermon Manager when you save)', 'sermon-manager'),                     'id'   => '_wpfc_sermon_size',                     'type' => 'text',                 ),*/                 array(                     'name' => __('Video Embed Code', 'sermon-manager'),                     'desc' => __('Paste your embed code for Vimeo, Youtube, or other service here', 'sermon-manager'),                     'id'   => 'sermon_video',                     'type' => 'textarea',                 ),                 array(                     'name' => __('Sermon Notes', 'sermon-manager'),                     'desc' => __('Upload a pdf file or enter an URL.', 'sermon-manager'),                     'id'   => 'sermon_notes',                     'type' => 'file',                 ),             ),         );              return $meta_boxes;     }          /**      * Get podcast file info on save and store in custom fields.      * Using meta boxes validation filter.      * Added by T Hyde 9 Oct 2013      *      * @param $new      * @param $post_id      * @param $field      * @return $new unchanged      */     function wpfc_sermon_audio_validate( $new, $post_id, $field ) {              // only for sermon audio         if ( $field['id'] != 'sermon_audio' )             return $new;              $current = get_post_meta($post_id, 'sermon_audio', 'true');         $currentsize = get_post_meta($post_id, '_wpfc_sermon_size', 'true');              // only grab if different (getting data from dropbox can be a bit slow)         if ( $new != '' && ( $new != $current || empty($currentsize) ) ) {                  // get file data             $size =  wpfc_get_filesize( $new );             $duration = wpfc_mp3_duration( $new );                  // store in hidden custom fields             update_post_meta( $post_id, '_wpfc_sermon_duration', $duration );             update_post_meta( $post_id, '_wpfc_sermon_size', $size );              } elseif ($new == '') {                  // clean up if file removed             delete_post_meta( $post_id, '_wpfc_sermon_duration');             delete_post_meta( $post_id, '_wpfc_sermon_size' );              }              return $new;     }     add_filter('wpfc_validate_file','wpfc_sermon_audio_validate', 10, 3);          //Remove service type box (since we already have a method for selecting it)     function remove_service_type_taxonomy() {         $custom_taxonomy_slug = 'wpfc_service_type';         $custom_post_type = 'wpfc_sermon';         remove_meta_box('tagsdiv-wpfc_service_type', 'wpfc_sermon', 'side' );     }     add_action( 'admin_menu', 'remove_service_type_taxonomy' );          //add filter to insure the text Sermon, or sermon, is displayed when user updates a sermon     add_filter('post_updated_messages', 'wpfc_sermon_updated_messages');     function wpfc_sermon_updated_messages( $messages ) {       global $post, $post_ID;            $messages['wpfc_sermon'] = array(         0 => '', // Unused. Messages start at index 1.         1 => sprintf( __('Sermon updated. View sermon', 'sermon-manager'), esc_url( get_permalink($post_ID) ) ),         2 => __('Custom field updated.', 'sermon-manager'),         3 => __('Custom field deleted.', 'sermon-manager'),         4 => __('Sermon updated.', 'sermon-manager'),         /* translators: %s: date and time of the revision */         5 => isset($_GET['revision']) ? sprintf( __('Sermon restored to revision from %s', 'sermon-manager'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,         6 => sprintf( __('Sermon published. View sermon', 'sermon-manager'), esc_url( get_permalink($post_ID) ) ),         7 => __('Sermon saved.', 'sermon-manager'),         8 => sprintf( __('Sermon submitted. Preview sermon', 'sermon-manager'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),         9 => sprintf( __('Sermon scheduled for: %1$s. Preview sermon', 'sermon-manager'),           // translators: Publish box date format, see http://php.net/date           date_i18n( __( 'M j, Y @ G:i', 'sermon-manager' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),         10 => sprintf( __('Sermon draft updated. Preview sermon', 'sermon-manager'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),       );            return $messages;     }          // TO DO: Add more help information     //display contextual help for Sermons     //add_action( 'contextual_help', 'add_wpfc_sermon_help_text', 10, 3 );               //create custom columns when listing sermon details in the Admin     add_action("manage_posts_custom_column", "wpfc_sermon_columns");     add_filter("manage_edit-wpfc_sermon_columns", "wpfc_sermon_edit_columns");          function wpfc_sermon_edit_columns($columns) {         $columns = array(             "cb" => "<input type=\"checkbox\" />",             "title" => __('Sermon Title', 'sermon-manager'),             "preacher" => __('Preacher', 'sermon-manager'),             "series" => __('Sermon Series', 'sermon-manager'),             "topics" => __('Topics', 'sermon-manager'),             "views" => __('Views', 'sermon-manager'),         );         return $columns;     }          function wpfc_sermon_columns($column){         global $post;              switch ($column){             case "preacher":                 echo get_the_term_list($post->ID, 'wpfc_preacher', '', ', ','');                 break;             case "series":                 echo get_the_term_list($post->ID, 'wpfc_sermon_series', '', ', ','');                 break;             case "topics":                 echo get_the_term_list($post->ID, 'wpfc_sermon_topics', '', ', ','');                 break;             case "views":                 echo wpfc_entry_views_get( array( 'post_id' => $post->ID ) );                 break;                   }     }               // Custom taxonomy terms dropdown function     function wpfc_get_term_dropdown($taxonomy) {         $terms = get_terms($taxonomy);         foreach ($terms as $term) {             $term_slug = $term->slug;             $current_preacher = get_query_var('wpfc_preacher');             $current_series = get_query_var('wpfc_sermon_series');             $current_topic = get_query_var('wpfc_sermon_topics');             $current_book = get_query_var('wpfc_bible_book');             if($term_slug == $current_preacher || $term_slug == $current_series || $term_slug == $current_topic || $term_slug == $current_book) {                 echo '<option value="'.$term->slug.'" selected>'.$term->name.'</option>';             } else {                 echo '<option value="'.$term->slug.'">'.$term->name.'</option>';             }         }     }           /*     Taxonomy Short Description     http://wordpress.mfields.org/plugins/taxonomy-short-description/     Shortens the description shown in the administration panels for all categories, tags and custom taxonomies.     V: 1.3.1     Copyright 2011  Michael Fields  michael@mfields.org          This program is free software; you can redistribute it and/or modify     it under the terms of the GNU General Public License version 2 as published by     the Free Software Foundation.          Function names have been modified to prevent conflicts.     */          // Actions.     function wpfc_taxonomy_short_description_actions() {         $taxonomies = get_taxonomies();         foreach ( $taxonomies as $taxonomy ) {             $config = get_taxonomy( $taxonomy );             if ( isset( $config->show_ui ) && true == $config->show_ui ) {                 add_action( 'manage_' . $taxonomy . '_custom_column', 'wpfc_taxonomy_short_description_rows', 10, 3 );                 add_action( 'manage_edit-' . $taxonomy . '_columns',  'wpfc_taxonomy_short_description_columns' );                 add_filter( 'manage_edit-' . $taxonomy . '_sortable_columns', 'wpfc_taxonomy_short_description_columns' );             }         }     }     add_action( 'admin_init', 'wpfc_taxonomy_short_description_actions' );               // Term Columns.     // Remove the default "Description" column. Add a custom "Short Description" column.     function wpfc_taxonomy_short_description_columns( $columns ) {         $position = 0;         $iterator = 1;         foreach( $columns as $column => $display_name ) {             if ( 'name' == $column ) {                 $position = $iterator;             }             $iterator++;         }         if ( 0 < $position ) {             /* Store all columns up to and including "Name". */             $before = $columns;             array_splice( $before, $position );                  /* All of the other columns are stored in $after. */             $after  = $columns;             $after = array_diff ( $columns, $before );                  /* Prepend a custom column for the short description. */             $after = array_reverse( $after, true );             $after['mfields_short_description'] = $after['description'];             $after = array_reverse( $after, true );                  /* Remove the original description column. */             unset( $after['description'] );                  /* Join all columns back together. */             $columns = $before + $after;         }         return $columns;     }               // Term Rows. - Display the shortened description in each row's custom column.     function wpfc_taxonomy_short_description_rows( $string, $column_name, $term ) {         if ( 'mfields_short_description' == $column_name ) {             global $taxonomy;             $string = term_description( $term, $taxonomy );             $string = wpfc_taxonomy_short_description_shorten( $string, apply_filters( 'mfields_taxonomy_short_description_length', 130 ) );         }         return $string;     }          // Shorten a string to a given length.     function wpfc_taxonomy_short_description_shorten( $string, $max_length = 23, $append = '…', $encoding = 'utf8' ) {              /* Sanitize $string. */         $string = strip_tags( $string );         $string = trim( $string );         $string = html_entity_decode( $string, ENT_QUOTES, 'UTF-8' );         $string = rtrim( $string, '-' );              /* Sanitize $max_length */         if ( 0 == abs( (int) $max_length ) ) {             $max_length = 23;         }              /* Return early if the php "mbstring" extension is not installed. */         if ( ! function_exists( 'mb_substr' ) ) {             $length = strlen( $string );             if ( $length > $max_length ) {                 return substr_replace( $string, $append, $max_length );             }             return $string;         }              /* Count how many characters are in the string. */         $length = strlen( utf8_decode( $string ) );              /* String is longer than max-length. It needs to be shortened. */         if ( $length > $max_length ) {                  /* Shorten the string to max-length */             $short = mb_substr( $string, 0, $max_length, $encoding );                  /*              * A word has been cut in half during shortening.              * If the shortened string contains more than one word              * the last word in the string will be removed.              */             if ( 0 !== mb_strpos( $string, $short . ' ', 0, $encoding ) ) {                 $pos = mb_strrpos( $short, ' ', $encoding );                 if ( false !== $pos ) {                     $short = mb_substr( $short, 0, $pos, $encoding );                 }             }                  /* Append shortened string with the value of $append preceeded by a non-breaking space. */             $string = $short . ' ' . $append;         }              return $string;     }     ?>


Appearance->Editor not visible

I'm noticing that the `editor` is not visible from past few weeks. It's working fine on my other WordPress sites but in one site it's not visible. I tried changing theme and deactivating plugins but that didn't work. Also my wp-config.php file doesn't have `define('DISALLOW_FILE_EDIT', true);`.


Too many login attempts

Since a week or two I keep receiving the following automatic email message sent from my WordPress website, and I'd like to know if it indicates any security hole and if there's anything I can do to stop it : "A host, 79.148.238.85(you can check the host at http://ip- adress.com/ip_tracer/79.148.238.85) has been locked out of the WordPress site at http://my_site.com until Friday, February 22nd, 2013 at 9:41:54 am UTC due to too many login attempts. You may login to the site to manually release the lock if necessary."


Multiple WYSIWYG Editor on save redirecting to wp-admin/post.php (Which is page not found)

Hi i'm using custom post types with multiple WYSIWYG fields, on click of update it's redirecting me to wp-admin/post.php (no page found). After making multiple attempts my server blocked my ip and sent me the reason below,               Kindly check the logs and above path with your developer and take necessary action to avoid this in future.           Logs:      ------     [Tue Jan 28 10:46:37 2014] [error] [client 27.7.33.30] Match of "rx ((?:submit(?:\\\\+| )?(request)?(?:\\\\+| )?>+|<<(?:\\\\+| )remove|(?:sign ?in|log ?     (?:in|out)|next|modifier|envoyer|add|continue|weiter|account|results|select)?(?:\\\\+| )?>+)$|^< ?\\\\??(?: |\\\\+)?xml|^<samlp|^>> ?$)" against "ARGS:wpcf[sponsors]" required.     [data "/post.php"] [severity "CRITICAL"] [hostname "site.com"] [uri "/wp-admin/post.php"]      did anyone know what's the issue is ?


PHP echo stripping formatting in Advanced Custom Fields

Using Advanced Custom Fields in Wordpress, I have the following code:               if(the_sub_field('company_name')) {              echo 'Company name:';         echo '
' . the_sub_field('company_name') . '
';     }      When the page renders though, the company name renders (the_sub_field) but the **Company name:** does not. This has also happened in a number of other places in my code when I echo some html out. Is there a reason for this? Does it have to do with ACF? Many thanks **EDIT:** Even if I try it like this the _Company name:_ is stripped compltely:                   <?php if(the_sub_field('company_name')) { ?>             Company name:
<?php the_sub_field('company_name') ?>
;         <?php } ?>      **EDIT:** Placing the Company Name: outside of the IF statement works, but I would like for it to be inside the IF statement as I want it to render out only if that statement is true of course.               <?php              echo 'Company name:';          if(the_sub_field('company_name')) {             echo '
' . the_sub_field('company_name') . '
';         }     ?>


Single template will not show sidebar/bottom-nav and footer

Im using the blankslate template theme and have a sidebar which i would like to use throughout the website. On my sidebar on the homepage i have a widget called latest posts with the latest post snippet and a read-more link. When this is clicked, the user should be able to view the single post on a new page with the header, footer, bottom/top nav and sidebar. At the moment the sidebar/footer and bottom nav are missing. I have deactivated the widget and used Wordpress original and this still does not work (so i know its not a sidebar widget bug). If i move the footer or sidebar tags up in the template say next to the header they show but the post is below so i know its something to do with the single post function? Here is my index template below:               <?php get_header(); ?>     <?php get_template_part( 'nav', 'above' ); ?>     <?php while ( have_posts() ) : the_post() ?>     <?php get_template_part( 'entry' ); ?>     <?php get_sidebar(); ?>     <?php endwhile; ?>     <?php get_template_part( 'nav', 'below' ); ?>     <?php get_footer(); ?>      Which i want the single page template to be like but instead of all the posts the single post... The single post template i have so far is:               <?php get_header(); ?>     <?php get_template_part( 'nav', 'above-single' ); ?>     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>     <?php get_template_part( 'entry' ); ?>     <?php get_sidebar(); ?>     <?php endwhile; endif; ?>     <?php get_template_part( 'nav', 'below-single' ); ?>     <?php get_footer(); ?>      I have moved everything about and still no luck. If anyone could give me any guidance i'd appriciate it. Thanks. Update: I've just realised my tool bar goes when i also access this page - not sure if this will help towards my query.


How can I get archives for specific category without category_base in the url?

I'm using this code to get archives for a specific category:               function extend_date_archives_add_rewrite_rules($wp_rewrite){         $rules = array();         $structures = array(             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_date_permastruct(),             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_month_permastruct(),             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_year_permastruct(),         );         foreach( $structures as $s ){             $rules += $wp_rewrite->generate_rewrite_rules($s);         }         $wp_rewrite->rules = $rules + $wp_rewrite->rules;     }     add_action('generate_rewrite_rules', 'extend_date_archives_add_rewrite_rules');      It works fine and I get an URL like: example.com/category_base/category_name/date/YYYY/MM The problem is that I would like to have an URL without the category_base: example.com/category_name/date/YYYY/MM If I use a plugin to delete de "category_base" (like WP no category base) or simply I use "str_replace" to delete the "category_base", I get a 404 error page in all pages and single pages. What can I do? Thanks. **Added notes:** If I use:               function extend_date_archives_flush_rewrite_rules(){         global $wp_rewrite;         $wp_rewrite->flush_rules();     }     add_action('init', 'extend_date_archives_flush_rewrite_rules');     function extend_date_archives_add_rewrite_rules($wp_rewrite){         $rules = array();         $structures = array(             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_date_permastruct(),             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_month_permastruct(),             $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_year_permastruct(),         );         foreach( $structures as $s ){             $rules += $wp_rewrite->generate_rewrite_rules($s);         }         $wp_rewrite->rules = $rules + $wp_rewrite->rules;     }     add_action('generate_rewrite_rules', 'extend_date_archives_add_rewrite_rules');      example.com/category_name/YYYY works fine, but single and pages go to 404 page. But If I only use:               function extend_date_archives_add_rewrite_rules($wp_rewrite){             $rules = array();             $structures = array(                 $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_date_permastruct(),                 $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_month_permastruct(),                 $wp_rewrite->get_category_permastruct() . $wp_rewrite->get_year_permastruct(),             );             foreach( $structures as $s ){                 $rules += $wp_rewrite->generate_rewrite_rules($s);             }             $wp_rewrite->rules = $rules + $wp_rewrite->rules;         }         add_action('generate_rewrite_rules', 'extend_date_archives_add_rewrite_rules');      Then all single and pages work fine, but example.com/category_name/YYYY goes to 404. Any idea? I refresh permalinks, and I continue with the problem :(


WP Query to set post thumbnail for existing old posts

I found this PHP code that will set the first attached image as the post thumbnail. http://wordpress.stackexchange.com/a/23768 Is it possible to loop through old posts that have attachments using WP_Query() to set the post thumbnail for old posts? If the post has more than 1 attachement, I'd like to set the first attachment as the post thumbnail. I'd like to do this only once to get everything up to date, then I can incorporate the PHP code from the answer above to modify new posts going forward. As requested, here is the code from the aforementioned linked answer.               function myprefix_main_image() {     $attachments = get_children( 'post_parent='.$post->ID.'&post_type=attachment&post_mime_type=image&order=desc' );     if( $attachments ) {         $keys = array_reverse( $attachments );         set_post_thumbnail( $post->ID, $keys[0]->ID );     };       }


Why the slideshow is not shown in my theme?

I am pretty new in WordPress theme developing and I have the following problem. I am trying to create a WordPress theme that used **BootStrap** CSS framework based on this BootStrap demo static website (I have the entire source of this site because it is a downlodable tutorial): http://www.html.it/guide/img/bootstrap/demo/home.html This is my **custom WP theme** : http://onofri.org/WP_BootStrap/ So I have create a basic WP theme and as first stage I want to insert the **slideshow** of the previous demo page in the **header.php** file of my WP theme, so this is my **header.php** code:               DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">     <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>          <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />     <title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>     <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />               <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />          <?php wp_head(); ?>

                <img src="<?php bloginfo('template_url'); ?>/assets/img/flexslider/flex-1.jpg"/>

                        Lorem ipsum
                        sit dolor
                        adipiscing elitur

                <img src="<?php bloginfo('template_url'); ?>/assets/img/flexslider/flex-2.jpg"/>

                        Lorem ipsum
                        sit dolor
                        adipiscing elitur

                <img src="<?php bloginfo('template_url'); ?>/assets/img/flexslider/flex-3.jpg"/>

                        Lorem ipsum
                        sit dolor
                        adipiscing elitur

<a href="<?php echo get_settings('home'); ?>"><?php bloginfo('name'); ?>

<?php bloginfo('description'); ?>

      As you can see I have simply take the ****block of the static demo website and I have put it at the beginning of my **header.php** file. Ok, my WordPress theme is configured to use the BootStrap CSS and the **flexslider.css** and also the **style2.css** file that represent what in the demo website is the **stili-custom.css** (my custom CSS settings that is loaded at last to ovverride the definied properties) As you can see the problem is that at the beginning of my theme the slide show not appear and I have no idea about this issue. Why? Can you help me to solve this problem? UPGRADE 1: In the **functions.php** I put to load all the JavaScripts:               /* Function automatically executed by the hook 'load_java_scripts':      * 1) Load all my JavaScripts      */     function load_java_scripts() {         // Load JQuery:         wp_enqueue_script('jquery');         // Load bootstrap.min.js:         wp_enqueue_script('bootstrap.min-js', get_template_directory_uri() . '/assets/bootstrap/js/bootstrap.min.js', array('jquery'), 'v3.0.3', true);         // Load FlexSlider JavaScript         wp_enqueue_script('flexSlider-js', get_template_directory_uri() . '/assets/plugins/flexslider/jquery.flexslider.js', array('jquery'), 'v2.1', true);         // Load FancyBox:         wp_enqueue_script('fancy-js', get_template_directory_uri() . '/assets/plugins/fancybox/jquery.fancybox.pack.js', array('jquery'), 'v2.1.5', true);         // Load scripts.js:         wp_enqueue_script('fancy-js', get_template_directory_uri() . '/assets/js/scripts.js', array('jquery'), '1.0', true);     }     add_action('wp_enqueue_scripts', 'load_java_scripts');      Tnx Andrea


Remove Share This option from the home page

I have installed the Share this (http://sharethis.com/) plugin in the site http://mytabletguru.com. Now the issue is that it is showing the share button on homepage also. Plz help me to remove it.


Category Posts Code

You may find my `index.php` code below. I'm trying to get posts from categories.               <?php get_header();      $style = gplab_get_option('home_display');     if (isset($_GET['style'])) {         $style = $_GET['style'];     }?>
     <?php     if ( gplab_get_option('breaking_enable') ) {         echo gplab_breaking();     } ?>
     <?php if ( gplab_get_option('slider_enable') ) { ?>
             <?php echo gplab_flexslider(); ?>
     <?php }      if($style == 'custom'){      echo gplab_box_cat();     } elseif($style == 'blog') {         $getPosts = new WP_Query();         $getPosts->query("paged=$paged"); ?>
          <?php if ($getPosts->have_posts()) : while ($getPosts->have_posts()) : $getPosts->the_post();              $metaID = $post->ID; $meta = get_post_meta($post->ID,'gplab_post_meta',TRUE); ?>                 <div id="post-<?php the_ID(); ?>" <?php post_class('page'); ?>>

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" rel="bookmark"><?php the_title(); ?>

<?php _e('Written on ', 'gplab'); the_time('F j, Y'); _e(', by ', 'gplab'); the_author_posts_link(); ?>

                             <?php echo gplab_thumbnail('post'); ?>

                             <?php the_excerpt(__('Read more', 'gplab'));?>

<?php comments_popup_link(__('No Comments', 'gplab'), '1 ' . __('Comment', 'gplab'), '% ' . __('Comments', 'gplab')); ?>

<?php _e('Categories: ', 'gplab'); the_category(', ') ?>

         <?php endwhile; endif; ?>
<?php          if (function_exists("pagination")) {             pagination($getPosts->max_num_pages);         } ?>     <?php } elseif($style == '' || $style == 'box'){?>
 <?php         global $paged;         if(empty($paged)) $paged = 1;              $news_counter_1 = 0;         $two_counter_1 = 0;         $two_counter_2 = 0;         $gPosts = new WP_Query();         $gPosts->query("paged=$paged");         if ($gPosts->have_posts()) : while ($gPosts->have_posts()) : $gPosts->the_post(); $two_counter_1 ++ ;             $metaID = $post->ID;              if($two_counter_1 % 2 != 0) : ?>
 <?php          elseif ($two_counter_1 % 2 == 0): ?>
 <?php          endif; ?>

                         <?php echo gplab_thumbnail('box'); ?>                                <?php if(gplab_get_meta($metaID ,'post_format') == 'review'){ ?>
<img src="<?php echo GPLABIMG . '/stars/star' . gplab_get_meta($metaID ,'overall_rating') . '.png'?>" alt="<?php echo gplab_get_meta($metaID ,'overall_rating'); ?>"/>
                         <?php } elseif(gplab_get_meta($metaID ,'post_format') == '' || gplab_get_meta($metaID ,'post_format') == 'default') { ?>                         <?php } else { ?>
<img src="<?php echo GPLABIMG . '/' . gplab_get_meta($metaID ,'post_format') . '.png'?>" alt="<?php echo gplab_get_meta($metaID ,'post_format'); ?>"/>
                         <?php } ?>
<?php echo gplab_getcomment_count(get_the_ID(), 'index');?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

                                     <?php //the_excerpt();                                     gplab_excerpt_box(); //275 260?>

<?php the_time('F j, Y'); _e(' at ', 'gplab'); the_time(); ?>

<?php _e('Category:', 'gplab'); ?> <?php echo gplab_getCategory(get_the_ID());?>

                                 <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php _e('Read More', 'gplab'); ?>

               <?php endwhile; else:?>

<?php _e('There has been an error.', 'gplab'); ?>

<?php _e('We apologize for any inconvenience, please hit back on your browser or use the search form below.', 'gplab'); ?>
                 <?php get_search_form(); ?>
             <?php endif; ?>

 <?php         wp_reset_query(); ?>
 <?php         if (function_exists("pagination")) {             pagination($gPosts->max_num_pages);         }      } ?>
      What should I change to get posts from categories?


Custom Fields - How can I remove the publish option for certain users

I am trying to set updates to `Pending` vs. `Publish` for a new role I created called **"members"**. Is there a way to remove just the `Publish` option for these users? None of the user plugins I have tried work. They will set it to `Pending` for new posts, but not for editing the post. I need it for editing.


Can't seem to get this CSS to work...any ideas why?

I may be missing something really simple here, but I am trying to style the background to my disqus comments to a white color (like the blog post content area) but for some reason the background of the site is still overriding my styling. I have no idea why. Here is my styles.css...Does any one see what's going on? (Here is a single post where you can see the background is white, although my css should be making it white, unless I'm doing something wrong. http://noahsdad.com/fox-4-interview-noah/ )               /*       Theme Name: Standard-Child-Theme-1     Description: Standard is a meticulously designed and coded theme for professional blogging. It adapts to mobile devices and individual posts can be styled distinctly for words, images, quotes, links, videos, or statuses. It includes a light and dark style sheet and precision, zero-config SEO techniques are built-in. Visitors will love it. Search engines will love it. And you will love it.     Author: 8BIT     Template: Standard     */          @import url("../Standard/style.css");          .dsq-full-comment { color: #F5F5F5 !important; }          #subscribe_dock input[type="submit"] { padding: 5px 2px; font-size:11px; }          /* Social Icons For Top Right Graphic */     #text-25    {position:relative;}     #social         {background:url(http://noahsdad.com/wp-content/uploads/2012/02/down-syndrome-blogs-noahs-dad.jpg) no-repeat; height:300px; width:300px; position:relative;}     .social_icon        {height:32px; width:32px; display:inline-block;}     .social_trans       {height:32px; width:32px;}     #social_dock        {position:absolute; top:70px; left:8px;}     #social_dock a *    {border:0;}     #subscribe_dock     {position:absolute; bottom:-5px; left:8px;}     #social #facebook   {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat;}     #social #twitter    {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat -32px 0px;}     #social #youtube    {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat -64px 0px;}     #social #rss        {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat -96px 0px;}     #social #pintrest   {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat -128px 0px;}     #social #googleplus {background:url(http://noahsdad.com/wp-content/uploads/2012/02/social-sprite-2.png) no-repeat -160px 0px;}          /* Needed In Order To Get Social Icons To Show Up Correctly */     div.social_icon img {background: none;}


How to remove a class from a post_image div?

So for a post i know how to remove a class by using               function remove_class( $classes ) {                 $classes = array_diff($classes, array('hentry'));                return $classes;     }          add_filter('post_class', 'remove_class');      But i need to remove a particular class from a child div of the post div, i.e. a div with class="post_image mb30 blur icon" and i like to remove blur. It turns out the WP theme in use, adds the class by:                   function content_thumbnail_masonry($args = array()) {      global $post;      $args['width'] = '768';      $args['height'] = '';      $args['crop'] = false;      $args['class'] = 'post_image mb15';      if (get_post_format() == 'quote') {      $args['show'] = false;      } elseif (get_post_format() == 'link') {      $args['show'] = false;      }      return $args; }      I also tried this:               function remove_css_please( $content ) {         global $post;          $postid = $post->ID;         if( $postid==5709) {         echo 'yes for this one';         $content = str_replace('
','
', $content);         }          return $content;     }     add_filter('the_content', 'remove_css_please');      But the preg_replace doesn't work, the echo did show up. i like to remove the a href tag as well


How to display data from custom fields I created?

I created an options page to ad gigs as custom posts in my theme. This is in my functions.php                   $config = array(         'id' => 'gigs-info',         'title' => 'Gig Info',         'pages' => array('gig'),         'context' => 'normal',          'priority' => 'high',          'fields' => array(),          'local_images' => false,         'use_with_theme' => false //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).     );     $my_meta = new AT_Meta_Box($config);          //Add fields to your meta box     $my_meta->addText($prefix.'where',array('name'=> 'Where is the Gig '));     $my_meta->addDate($prefix.'when',array('name'=> 'When is the Gig '));     $my_meta->addTime($prefix.'start_time',array('name'=> 'When Does it Start '));     $my_meta->addTime($prefix.'end_time',array('name'=> 'When Does it End '));     $my_meta->addText($prefix.'with_who',array('name'=> 'With Who is the Gig '));     $my_meta->addTextarea($prefix.'words',array('name'=> 'A few words on the gig '));     $my_meta->Finish();     }      How do I display the content of these various fields in my index.php? I currently have this...                      <?php     $args2 = array         (             'post_type' => 'gig',             'numberposts' => -1         );         $prefix = "_gig";         $gigs = get_post($args2);      foreach ($gigs as $gig)      {     echo get_post_meta($gig->ID, $prefix.'where', true);       }     ?>


Facebook plugin shows existing comments

Installed the official facebook plugin and seems to be working. The problem is that existing comments are still visible (with default style) above facebook comments form. My `comments.php` is empty now and I see this. (Sorry about greek text, no time to change it). I emptied it because I know there is no merge possible, so moving to the fb-comments only era on this site. Is there a way to completely remove the existing comments, or at least style them and move them after fb ones? I see no option in the backoffice of the plugin. ![enter image description here](http://i.stack.imgur.com/07EFQ.png)


How to use a different database to list and manage comments in the backend

I need to make Wordpress use another database (not the one specified in wp- config site-wide) on the "Comments" admin backend. I then must be able to edit, approve, delete etc. comments as usual. The database server I am going to connect to has been setup to accept external connections. I have a couple of ideas how to approach this:   1. from wp-config.php: have an if block to change the database connection strings if user is viewing comments page. However this doesn't sound good to me, I assume this may create a lot of unnecessary database connections if user goes back and forth to the comments page.   1. modify wp-admin files: create an instance of wpdb and tell Wordpress to use it for comment administration.  However, I can't find the .php files that get the comments from the database (so I can change the database where they do it). Have been looking at edit- comments.php->class-wp-comments-list-table.php->class-wp-list-table.php (down to base class), but I can't see the bit that talks to the database.   1. Any hooks available to tap into and change the database? (doubt it) Many thanks in advance.


Split Blog Into Two Sections?

Alright, so this is my vision for a website I am currently looking to relaunch... As of right now, my site's blog consists of posts in the form of products linking to Amazon via WP Zon Builder (plugin). Now I am looking to open the blog up to others who are interested in writing content for the site. Is there a way to split my blog up into two sections, like the following: • original posts • new posts Basically I don't want my original posts taking over the site, especially since there are over 400 of them. In a way, I kind of want to archive them and have the focus of the site be the new blog posts being submitted by my authors/users. I'm thinking of a possible workaround. Is there some kind of plugin that can split my blog up by users? I can assign all the current posts to an individual user account, thus making room for the new users. Hopefully this isn't confusing. Any help is much appreciated!


AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page:               "http://permalink.comtitle"      It's as if all the html tags ( and
 there) were discarded. Here's the PHP part in functions.php where I give $html its value:               if ($query->have_posts()){              while ($query->have_posts()){                  $query->the_post();                 $html = '
' . the_title() . '
';             }         }         echo $html;      jQuery part (I give only the part where I send the data to the target since everything else work as intended):               success:function(data){                     $('#actu_ajax').html(data);                 }      **Edit:** As a side note, if I remove the filters the html tags are back there. I am surely missing something easy to spot...


Redirect function inside a Shortcode

I am developing a free plugin for connection a external support system to WordPress to be able to authenticate users on WordPress. For this, currently from the external system, the user is sent to WordPress's login page with this at the end               ?action=freshdesk-remote-login      My plugin then checks if the user is logged into WP, if not it shows the login form and after successful login, redirects them back to the 3rd party site. The redirect is done using something like this: `wp_redirect( $sso_url );` Now this works well, but I plan to offer a shortcode which could be added to a page the user chooses. Now once a user goes to this page, if they are logged in, they should be forwarded to the 3rd party site, if not, then to the login page. Is there a way you could suggest wp_redirect to work inside a shortcode?


How to Change Loop to Order Posts by Views (using wp-postviews plugin)

I hope somebody would be kind enough to help. I currently have a page that orders all of the posts by comment count, but I want to change the loop to order the posts by view count. I have installed the 'wp-postviews.1.50' plugin and have got it to display the number of views on each post, so I know that side of it is working, now I just need the loop code changed to order by most views, is this possible? This is the how the number of views is called out:               <?php $views = get_post_meta($post->ID, 'views', true); ?><?php echo $views; ?>      And here is the loop I need changed:               <?php $posts_per_page = get_query_var('posts_per_page'); ?>     <?php $paged = intval(get_query_var('paged')); ?>     <?php $paged = ($paged) ? $paged : 1; ?>     <?php $args = array(     'posts_per_page' => $posts_per_page,     'paged' => $paged,     'more' => $more = 0,     'orderby' => 'comment_count',     'order' => 'DESC',     ); ?>     <?php query_posts($args); ?>     <?php if (have_posts()) : while (have_posts()) : the_post() ;?>     <div <?php post_class() ?> id="post-<?php the_ID(); ?>">      Thanks in advance for any help with this. I'm using WordPress 3.0.4.


How can I disable parent menu item links?

I don't want to have the parent menu items of my site's nav menus linking to a separate page. For one thing I don't want to have a superfluous page. For another these links hobble site navigation for mobile users who can't "hover" over a link (to bring up the child items). The best solution would be to disable the parent menu item links. But how do I do that, especially now that with WordPress 3.5 the Disable Parent Menu Item plugin has stopped working? One possible solution is here.


HTML content filtered on blog page

On my blog page where my all post are listed all formating is filtered and the post text is in a paragraph tag with all other formatting HTML tags removed. It works fine on the posts single page. How can I fix it and allow my posts to be visible till "more break" with all formatting.


update_meta_user difference in i:1 and b:1, how to write b:1

This code leads to wp_cababilities being written to the database but with an i:1 in front.               if( $new_roles === 'administrator' ) {         $capabilities = array ("administrator",'activate_plugins','delete_others_pages','delete_others_posts','delete_pages','delete_plugins','delete_posts','delete_private_pages','delete_private_posts','delete_published_pages','delete_published_posts','edit_dashboard','edit_files','edit_others_pages','edit_others_posts','edit_pages','edit_posts','edit_private_pages','edit_private_posts','edit_published_pages','edit_published_posts','edit_theme_options','export','import','list_users','manage_categories','manage_links','manage_options','moderate_comments','promote_users','publish_pages','publish_posts','read_private_pages','read_private_posts','read','remove_users','switch_themes','upload_files','create_product');         $user->set_role('administrator');         update_user_meta( $user_id, 'wp_capabilities', $capabilities );         update_user_meta( $user_id, 'wp_user_level', 10 );     }      This is what is placed in the database:               a:39:i:0;s:13:"administrator";i:1;s:16:"activate_plugins";i:2;s:19:"delete_others_pages";i:3;s:19:"delete_others_posts";i:4;s:12:"delete_pages";i:5;s:14:"delete_plugins";i:6;s:12:"delete_posts";i:7;s:20:"delete_private_pages";i:8;s:20:"delete_private_posts";i:9;s:22:"delete_published_pages";i:10;s:22:"delete_published_posts";i:11;s:14:"edit_dashboard";i:12;s:10:"edit_files";i:13;s:17:"edit_others_pages";i:14;s:17:"edit_others_posts";i:15;s:10:"edit_pages";i:16;s:10:"edit_posts";i:17;s:18:"edit_private_pages";i:18;s:18:"edit_private_posts";i:19;s:20:"edit_published_pages";i:20;s:20:"edit_published_posts";i:21;s:18:"edit_theme_options";i:22;s:6:"export";i:23;s:6:"import";i:24;s:10:"list_users";i:25;s:17:"manage_categories";i:26;s:12:"manage_links";i:27;s:14:"manage_options";i:28;s:17:"moderate_comments";i:29;s:13:"promote_users";i:30;s:13:"publish_pages";i:31;s:13:"publish_posts";i:32;s:18:"read_private_pages";i:33;s:18:"read_private_posts";i:34;s:4:"read";i:35;s:12:"remove_users";i:36;s:13:"switch_themes";i:37;s:12:"upload_files";i:38;s:14:"create_product";}      These capabilities do not work for that user. A simple copy/paste of the following into the database **gives the user the capabilities**               a:27:{s:13:"administrator";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:12:"upload_files";b:1;s:19:"delete_others_pages";b:1;s:19:"delete_others_posts";b:1;s:12:"delete_pages";b:1;s:11:"delete_post";b:1;s:20:"delete_private_pages";b:1;s:20:"delete_private_posts";b:1;s:22:"delete_published_pages";b:1;s:17:"edit_others_pages";b:1;s:17:"edit_others_posts";b:1;s:10:"edit_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"edit_private_posts";b:1;s:20:"edit_published_pages";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:17:"moderate_comments";b:1;s:13:"publish_pages";b:1;s:18:"read_private_pages";b:1;s:18:"read_private_posts";b:1;}      **What is the difference between the i:1 and b:1 ? How can I get the update_meta_user to add the b:1?** I cannot find a document but curious if this is i for integer and b for boolean. In which case, how can I get this code to update the wp_cabailities database field?


Taxonomy term page being linked a post from another custom post type?

I am building a Wordpress website which consists of 3 different custom post types (using post type UI) and also a number of different custom fields using the ACF plugin. I am getting a really weird issue where it has come to setting up a taxonomy terms page. Before I get into the specifics I will give a brief overview of my post structure. Post types:   * solutions   * need-advice   * case-studies Taxonomies (all attached to the case-studies post type):   * need-advice    * sector    * service Now, one of the key pages of the website is called 'Businesses we help'. This page is essentially a list of the terms relating to the _sector_ taxonomy. Sometimes they will have a related case study, other times they will be empty. I've got this page working as intended. The issues I am having are all related to `taxonomy-sector.php` I am trying to get the desired custom fields to appear onto this page. For example if I try the following code               <?php global $post; echo $post->post_name; ?>      It returns the name of a post relating to the _need-advice_ post type. This is the same if I echo the post ID on the `taxonomy-sector.php` page, it returns the ID of a need-advice post. Could this be because a Taxonomy shares the same name of a post type? I know there is nothing too specific with this at the moment but can anyone advise if they have heard of anything like this happening before? If I try changing the ID of the need-advice post directly in the database, the ID being returned on the taxonomy terms page also changes to the new ID, as if they are linked together.


Remove_filter ('the_content', 'wpautop') is not working

I've tried disabling WP's auto-paragraph thingy using `remove_filter ('the_content', 'wpautop');` but I am still getting my stuff wrapped in automatic `<p>` tags... What am I doing wrong? Its at the bottom of a functions file. Its not in functions.php, but in a file that functions.php includes (and putting it in functions.php doesn't change the behaviour at all). Update: `var_dump( $wp_filter['the_content'] );` outputs `NULL`. How can I test why this filter isn't being run?


Getting Catategory / Taxonomy Description on Non-archive Pages

Can you pull in the description of a custom tax on pages other than the taxonomy-(custom-tax).php i.e on the home page you want to show the description of a custom tax. This works on the aforementioned archive page but nowhere else:               <?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>      Many thanks for any help.


Attachment doesn't display post_parent gallery in multisite

I am working on multisite in a subfolder. I create a post with image linked to "attachment page" and not to a "media file". If the post has one single attachment and if i click to this image (image.php):               $metadata = wp_get_attachment_metadata();      works fine, and so i can go to post_parent. If the post has a gallery, metadata return only link to post (title of the image) and not to post_parent. For example:                 <?php echo get_the_title( $post->post_parent ) ?>      works in image.php only if the post has one image. If the post has a gallery, post_parent display only the title of the attachment, and doesn't display title of post_parent. Code of metadata in image.php is the default code:               <?php                                      $metadata = wp_get_attachment_metadata();                                 printf( __( 'Published  <time class="entry-date" datetime="%1$s">%2$s</time> at %4$s × %5$s in %8$s.', 'twentytwelve' ),                                     esc_attr( get_the_date( 'c' ) ),                                     esc_html( get_the_date() ),                                     esc_url( wp_get_attachment_url() ),                                     $metadata['width'],                                     $metadata['height'],                                     esc_url( get_permalink( $post->post_parent ) ),                                     esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),                                     get_the_title( $post->post_parent )                                 );                             ?>      Why this happens? I suppose it depends by the installation and configuration of multisite. There is a solution?


Inserting image into meta box row using jQuery - always adds to first row

I'm having a problem with inserting images into a custom post type meta box. I have a button that adds a row to the DIV and you click on the **Select Image** button to use the WordPress media selector. However, if you create two rows and try and select the images, the first one works fine but the second one is inserted in the row where you first added the image. Here's the code...               add_action( 'admin_init', 'init_bb_meta' );          function init_bb_meta()     {         add_meta_box( 'bb_room_images_meta_box',             'Room Images',             'display_bb_room_images_meta_box',             'resort_rooms', 'advanced', 'default'         );     }          function display_bb_room_images_meta_box( $room )     {         ?>

         <button type="button" id="add_room_image_button">Add New</button>         <input type="hidden" name="BB_PLUGIN_URL" id="BB_PLUGIN_URL" value="<?= BB_PLUGIN_URL ?>" />         <?php     }      Javascript:               jQuery('#add_room_image_button').click(function()     {         var BB_PLUGIN_URL = jQuery('#BB_PLUGIN_URL').val();              var new_row = '
' +             '
Image
' +             '
' +             '
Name<input type="text" name="bb_img_title[]" class="widefat bb_img_title" maxlength="50" value="" />
' +             '

' +             '
<button type="button" class="upload_image_button">Select Image</button>' +             '<input type="hidden" name="bb_img_url[]" class="bb_img_url" value="' + BB_PLUGIN_URL + 'images/no_photo_room_slider.jpg" />
' +             '
' +             '
';         jQuery('#bb_room_img_list').append(new_row);     });          var file_frame;          jQuery('.upload_image_button').live('click', function( event )     {         event.preventDefault();         var image_url = jQuery(this).parent('.bb_half').find('.bb_img_url');         var image_href = jQuery(this).closest('.bb_room_img_form').find('.bb_img_display');              // If the media frame already exists, reopen it.         if ( file_frame )         {             file_frame.open();             return;         }              // Create the media frame.         file_frame = wp.media.frames.file_frame = wp.media(         {             title: jQuery( this ).data( 'uploader_title' ),             button: {                 text: jQuery( this ).data( 'uploader_button_text' ),                 },                 multiple: false  // Set to true to allow multiple files to be selected         });              // When an image is selected, run a callback.         file_frame.on( 'select', function()         {             // We set multiple to false so only get one image from the uploader             attachment = file_frame.state().get('selection').first().toJSON();                  // Do something with attachment.id and/or attachment.url here             image_href.css('border', '2px solid red');             jQuery(this).css('border', '2px solid red');             jQuery(this).closest('.bb_room_img_form').css('border', '2px solid red');                  image_url.val(attachment.url);             image_href.attr('src', attachment.url);         });              // Finally, open the modal         file_frame.open();     });      I think the popup image select window is causing an issue. Any ideas on how to fix. Thanks


How can I get an XML export of my 1K+ posts WordPress instance?

I'd like to export my database to XML because the import script to my new blog already supports getting data from that. A database backup or wordpress clone is not that useful in this case. The problem is that using the builtin export button times out after 90 seconds. I have ssh access to the server and am not afraid to use it :) I don't really know php but I can muddle around with help. Given Problem: Create a cron job to export posts to a WordPress XML file on server I think that the export_wp function might be what I want, I just don't know what to do with that...


dropdown does not work

I have the page http://www.supersprox.eu/invoicewithtabs/. When I click "Show filter" button an area with several dropdowns appear. The problem is I can not select values of the first row of dropdowns. When I click, for example, first "Field name" dropdown a list with values do not appear, although HTML-code of the page shows that there are values in that dropdown with `id='fiedname00'`(values are Invoice, Stamping, Part number, Quantity etc.). But I can not change the initial value that was set when page loaded. But when I press "Add condition" button that add new portion of dropdowns, these new dropdowns allow to change their values. Why this happens? On local computer, without WordPress everything works fine, but on WordPress site there is an issue described. I am using WordPress 3.9.2.                   <select id="fieldname00" onchange="populatedropdown('0')">         <option>Invoice</option>         <option>Stamping</option>         <option>Part number</option>         <option>Quantity</option>         <option>Order number</option>         <option>Anodal</option>         <option>LILS</option>         </select>


How to display variable prices by default in woocommerce?

I would like to display the variable price by default in the "from price tab" in the single product page. and not have the from price. Its confusing to the shopper to see a "from" price then below it a price for each variation, that changes once a variation is chosen. **see attached image** So instead of having to sets of price fields I want to display only one where its a single or variable product. ![enter image description here](http://i.stack.imgur.com/sK1oc.png)


Can I divide the pages into categories?

I wanto know if I can divide the pages into categories? Going into the Wp administration panel I can see that I can create some categories for the posts but it seems to me that I can't do it for the pages. Why? What am I missing? Tnx


Nextgen Gallery: Fast Function To Retrieve Single Thumbnail From Gallery

Does anyone have a better (faster) function to retrieve a single thumbnail image from a nextgen gallery? The following functions fetches the entire gallery stdObject - is there a more direct approach if I don't want to deal with objects? Would you recommend a simple database call? I need the post ID, title and permalink               function getImagesLink($postid=0, $size='thumbnail')         {           global $post;            $sortie = 0;                       $postid = get_the_ID();                       if(class_exists('nggdb'))             {               //retrouver la galerie liée au post               $gal_id = getGalleryFromPost($postid);               //var_dump($gal_id);               if(intval($gal_id))               {                 $picturelist = nggdb::get_gallery($gal_id, 'pid', 'ASC');                 if($picturelist && count($picturelist) > 0)                 {                   $thumb = current($picturelist);                   foreach($picturelist as $image){                              $sortie = $image->thumbURL;                         }                                        }               }      return $sortie;                      }


How do I get only a certain number of images from a post (minus the featured image)?

I have the following code (see below) that lists all attached images from a post. I'm trying to alter this code to only list the first five images, and also to exclude the featured image from the list. Any help is certainly appreciated. Thanks in advance.

         <?php                $args = array(            'post_type' => 'attachment',            'numberposts' => -1,            'post_status' => null,            'post_parent' => $post->ID           );                $attachments = get_posts( $args );              if ( $attachments ) {                 foreach ( $attachments as $attachment ) {                    echo '
';                    echo wp_get_attachment_image( $attachment->ID, 'thumbnail' );                    echo '
';                   }              }         ?>


Determine Term depth

I'm looking to be able to find the depth of a term within it's hierarchical tree.               Produce     -- Vegetables     ---- Carrot     ---- Onion     ---- Celery     -- Fruit     ---- Apple     ------ HoneyCrisp     ----Orange      Produce is level 0 (or 1), Fruit is level 1, Apple is 3, HoneyCrisp is 4, etc. Ideal usage is `$depth = get_term_depth( $term_id );`. Anyone have experience with this? I essentially want a different rendering depending on depth on a term archive page.


make a pagination that show posts by date

i dont know if this is right question or not . but what i want to do is that , i need to create a pagination that show posts by date . i know the regular pagination is like this first-page - 22 - 23 - 24 ... last-page but i need some thing like this . 2009 - 2010[jul,apri,feb] - 2011[agus,oct] - 2012[nov,dec] - 2013[jan,agus,jul] . when i click on each year , then i should see the month that the admin have post any thing on that month .![like this image](http://i.stack.imgur.com/jN9Us.png) i hope you get what i mean .


No Authors for custom post type

I am trying to implement custom post type in Wordpress. plugin: **Advanced Custom Fields**                   register_post_type('acf', array(             'labels' => $labels,             'public' => false,             'show_ui' => true,             '_builtin' =>  false,             'capability_type' => 'page',             'hierarchical' => true,             'rewrite' => false,             'query_var' => "acf",             'supports' => array(                 'title',             ),             'show_in_menu'  => false,         ));      However, my another plugin, which displays only user's content (posts, pages, media...) is disabling also the metaboxes created by this plugin. This is the code of the small plugin which displays user's stuff (thanks goes to another post and person)               function content_for_current_author($query) {          if($query->is_admin) {         global $user_ID;         $query->set('author',  $user_ID);     }     return $query;     }     add_filter('pre_get_posts', 'content_for_current_author');      Users now can't see metaboxes which I created as admin on the website.


I see the message when trying to access wp admin at localhost: Fatal error: Call to undefined function reset_mbstring_encoding() in Z:\home\localhost\www\k-gayduk.ru\wp-includes\class-http.php on line 251 I suspected plugins, however, nothing has changed when turned all of them off. Any thoughts?


Modify Redux Framework Options in Child Theme

I have a wordpress theme that I am modifying the look and feel by making a child theme. The parent theme I am using uses the redux framework. Im a bit new to using filters and hooks, but I want to add/modify a section on the options page. I found a function to add sections through the child theme but I don't know how to use it. When I include the code in my child-theme functions.php I get an error saying it can't be re-defined. This is the example it shows in the options.php file. Can anyone help explain how to use this function or point me to some concise explanations on how it should be used. Thanks!               /*      *      * Custom function for filtering the sections array. Good for child themes to override or add to the sections.      * Simply include this function in the child themes functions.php file.      *      * NOTE: the defined constansts for URLs, and directories will NOT be available at this point in a child theme,      * so you must use get_template_directory_uri() if you want to use any of the built in icons      *      */     function add_another_section($sections){         //$sections = array();         $sections[] = array(             'title' => __('A Section added by hook', AZ_THEME_NAME),             'desc' => __('
This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.
', AZ_THEME_NAME),             'icon' => 'paper-clip',             'icon_class' => 'icon-large',             // Leave this as a blank section, no options just some intro text set above.             'fields' => array()         );              return $sections;     }     //add_filter('redux-opts-sections-twenty_eleven', 'add_another_section');


Is it possible to checkout a beta version of WordPress via github?

I know how to check out current versions of WordPress using via `git fetch --tags` but I only see current and past versions, not betas. Is it possible to get access to betas through github?


AZ Directory category

Hi i would like to create an A to Z index of category of 3 rows. How would i go about in doing this? Example: ABCDEFG... A   title of category started with the letter A B title of category started with the letter B C title of category started with the letter C D title of category started with the letter D E title of category started with the letter E F title of category started with the letter F G title of category started with the letter G etc...


How to force TinyMCE in WordPress to replace newlines with
 tags and not with

TinyMCE editor inserts `<p> </p>` instead of `<br>` tags when I press enter in my text for a new line. How to force TinyMCE in WP to replace newlines with `<br>` and not `<p> </p>`?


adding multiple custom columns to users.php

I'm trying to add two columns to the users.php file. I'm not sure how to add both $total_time_display and $logged_in_amount_display. How could I return both values? Here is my code:               add_filter('manage_users_columns', 'freeman_add_user_minutes_column');     function freeman_add_user_minutes_column($columns) {         $columns['total_time'] = 'Total Minutes';         $columns['logged_in_amount'] = 'Number of Logins';         return $columns;     }          add_action('manage_users_custom_column',  'freeman_show_user_minutes_column_content', 10, 3);     function freeman_show_user_minutes_column_content($value, $column_name, $user_id) {         $user = get_userdata( $user_id );         if ( 'total_time' == $column_name )             $total_time_display = ($user->total_time);             return $total_time_display;         if ( 'logged_in_amount' == $column_name )             $logged_in_amount_display = ($user->logged_in_amount);             return $logged_in_amount_display;         return $value;     }


Wordpress javascript call functions?

wordpress runs jquery in noconflicts mode which means that you either need to write your JS code using the jQuery function call               $(document).ready(       function($) {         $("html").niceScroll();       }     );      (The above like codes problem , I want to know where they should be rightly placed,) The above code calls for nicescroll.js file which i have en queued like this:               function your_enqueue(){       wp_enqueue_script(' name ', get_template_directory_uri(). '/nicescroll.js' , array('jquery')), '1.0', false);     }     add_action('wp_enqueue_scripts', 'your_enqueue');      What is "your_enqueue here does? Most importantly, just don't only correct enqueue code but also to tell where the jquery call functions will be placed to call nicescroll.js. Thanks