wp_nav_menu not appearing correctly on category page

this is the code i am using to call wp_nav_menu               <?php          wp_nav_menu(                 array(                     'container_class' => 'menu-header',                     'theme_location' => '',                     'menu_id'         => 6,                     'depth' => 4                 )             );     ?>      the menu appears perfect on home page and single post pages, as seen here: http://www.enkitec.com/ but when i visit a category page e.g. http://www.enkitec.com/education/ the menu items change, it seems like some menu items don't appear. **note:** i have only 1 menu in dashboard and it is set as default menu **strange thing is:** the code above is included in header.php, so it is the same on all pages, but still the results are different on category page. _any help would be highly appreciated._ more over i am also including the code of my theme pages: **header.php**               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                   <meta charset="<?php bloginfo( 'charset' ); ?>" />         <title><?php wp_title('-', true, 'right'); ?> <?php bloginfo('name'); ?></title>         <meta name="description" content="<?php echo is_single() ? single_post_title('', true):bloginfo('name')." - ".bloginfo('description'); ?>" />         <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/font_kit/stylesheet.css" type="text/css" charset="utf-8" />         <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/favicon.ico" />         <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />                                             <?php if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); ?>         <?php wp_head(); ?>

                     <?php                         wp_nav_menu(                             array(                                 'container_class' => 'menu-header',                                 'theme_location' => '',                                 'menu_id'         => 6,                                 'depth' => 4                             )                         );                     ?>

                  <?php $single_cat_title = single_cat_title(); ?>             <?php $p_title = trim(wp_title(NULL, FALSE)); ?>             <?php $cat = get_the_category(); $c_title = trim($cat[0]->name); ?>      **category.php**

                     <?php if (have_posts()) : ?>                     <?php while(have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?>
                         <?php // the_content(); ?>                         <?php the_excerpt(); ?>

                             <?php the_time('F jS, Y') ?>,                             By <?php the_author_posts_link(); ?>.                             Filed Under: <?php the_category(', '); ?>

                          <?php endwhile; ?>                          <?php if (  $wp_query->max_num_pages > 1 ) : ?>

<?php next_posts_link(__('« Older posts', '')); ?>

<?php previous_posts_link(__('Newer posts »', '')); ?>

                     <?php endif; ?>                          <?php else : ?>
Nothing Found

Sorry, but you are looking for something that isn't here.

<a href="<?php echo get_option('home'); ?>">Return to home page

                          <?php endif; ?>                          <?php if (is_home()) : ?>

                     <?php endif; ?>

                     <?php get_sidebar(); ?>

          <?php get_footer(); ?>      **footer.php**

                     <?php get_sidebar('footer'); ?>

                     © COPYRIGHT <?php echo date("Y"); ?>, ENKITEC, LP.

         <?php wp_footer(); ?>                          **functions.php**               <?php         /* Register a Custom Post Type (Slide) */         add_action('init', 'slide_init');         function slide_init() {             $labels = array(                 'name'                  => _x('Slides', 'post type general name'),                 'singular_name'         => _x('Slide', 'post type singular name'),                 'add_new'               => _x('Add New', 'slide'),                 'add_new_item'          => __('Add New Slide'),                 'edit_item'             => __('Edit Slide'),                 'new_item'              => __('New Slide'),                 'view_item'             => __('View Slide'),                 'search_items'          => __('Search Slides'),                 'not_found'             => __('No slides found'),                 'not_found_in_trash'    => __('No slides found in Trash'),                  'parent_item_colon'     => '',                 'menu_name'             => 'Slides'             );             $args = array(                 'labels'                => $labels,                 'public'                => true,                 'publicly_queryable'    => true,                 'show_ui'               => true,                  'show_in_menu'          => true,                  'query_var'             => true,                 'rewrite'               => true,                 'capability_type'       => 'post',                 'has_archive'           => true,                  'hierarchical'          => false,                 'menu_position'         => null,                 'supports'              => array('title', 'excerpt', 'thumbnail')             );              register_post_type('slide', $args);         }              /* Update Slide Messages */         add_filter('post_updated_messages', 'slide_updated_messages');         function slide_updated_messages($messages) {             global $post, $post_ID;             $messages['slide'] = array(                 0 => '',                 1 => sprintf(__('Slide updated.'), esc_url(get_permalink($post_ID))),                 2 => __('Custom field updated.'),                 3 => __('Custom field deleted.'),                 4 => __('Slide updated.'),                 5 => isset($_GET['revision']) ? sprintf(__('Slide restored to revision from %s'), wp_post_revision_title((int) $_GET['revision'], false)) : false,                 6 => sprintf(__('Slide published.'), esc_url(get_permalink($post_ID))),                 7 => __('Slide saved.'),                 8 => sprintf(__('Slide submitted.'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))),                 9 => sprintf(__('Slide scheduled for: %1$s. '), date_i18n(__('M j, Y @ G:i'), strtotime($post->post_date)), esc_url(get_permalink($post_ID))),                 10 => sprintf(__('Slide draft updated.'), esc_url(add_query_arg('preview', 'true', get_permalink($post_ID)))),             );             return $messages;         }          /* Update Slide Help */     add_action('contextual_help', 'slide_help_text', 10, 3);     function slide_help_text($contextual_help, $screen_id, $screen) {         if ('slide' == $screen->id) {             $contextual_help =             '
' . __('Things to remember when adding a slide:') . '
' .             '
' .             '
' . __('Give the slide a title. The title will be used as the slide\'s headline.') . '
' .             '
' . __('Attach a Featured Image to give the slide its background.') . '
' .             '
' . __('Enter text into the Visual or HTML area. The text will appear within each slide during transitions.') . '
' .             '
';         }         elseif ('edit-slide' == $screen->id) {             $contextual_help = '
' . __('A list of all slides appears below. To edit a slide, click on the slide\'s title.') . '
';         }         return $contextual_help;     }     if (function_exists('add_theme_support')) {         add_theme_support('post-thumbnails');     }               function checkFeild($a) {         if (trim($a)==""||$a==NULL||empty($a)) {             return false;         } else {             return true;         }     }          if (function_exists('register_sidebar')) {         register_sidebar(array(             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));     }          function register_my_menus(){         register_nav_menus(             array(                 'header-menu'=>__('Header Menu')             )         );     }     add_action('init', 'register_my_menus');          function fix_missing_menu($query) {         $query->set('post_type', array('post', 'nav_menu_item'));     }     add_filter('pre_get_posts', 'fix_missing_menu');     ?>


turn single domain off

I am running `WordPress` 3.3.2 with `multi site` in sub-domain mode. I want to add a new `sub-domain` but have it be "offline" until I finish working on it. Is there an easy way to do this? I know that if its a single site i can just add an `if` in the header file and the site will be online only to me, but in this case all of my sites are using the theme, making it the same header file thus making this solution invalid. thank you.


WP_Query on custom taxonomy works fine but fails if run through wp_ajax_

I'm using WP_Query to collate some info about posts based on their custom taxonomy. My arguments are as follows:               $args = array(             'posts_per_page'=> -1,             'post_status' => 'publish'         );              if ( isset($_POST['tag_id']) ) :             $args['tax_query'] =                 array(array(                     'taxonomy' => 'region',                     'field' => 'id',                     'terms' => $_POST['tax_id'],                 ));         endif;      Then I loop through and collate my data. And that works perfectly well. But because it's quite a heavy query, and appears for each taxonomy id I thought I'd run it on user demand and return the data with wp_ajax_ The same query seems to ignore all the tax_query arguments when returned through ajax. The arguments are the same and the correct "terms" is being passed. It's identical. I can't figure it out. Is this a bug? It's bugging me. Updated to put the code in pastebin: http://pastebin.com/rxSJ1C2n The class is at the top, then the bit of jQuery I've put at the bottom but is actually in a separate file.


How To Add New Option Types To Option Tree?

I am using option tree in theme mode and child theme mode and I am trying to add new option types. The new option types will be based off of the post- select option type, but will only list posts from a specific category. I created a new file and added it to the array of files to be included that begins on line 178 of ot-loader.php. In the new file I cut and pasted the post-select option type that begins on line 905 of /includes/ot-functions- options-type.php. You can see this new file here. In my post select option type I appended a unique slug to the function name. I also put that slug on the css class .type-post-select for the format outer setting wrapper. In the post query post array I added a category parameter. Then I added my new post-select option type to my theme options, hoping it would show only posts in the category I had set. It showed the posts from all categories. Interestingly enough the option was wrapped in .type-post-select. I also created a regular post-select, which did not have the modified css. As an experiment I tired adding the category parameter to the original post- select option in the same way and it worked exactly as I expected--only showing posts from that category. Unfortunately I need to create 6 new post- selects each showing posts from a different category. Clearly I am missing a step, but for the life of me I can not find it. I looked for some other place that option types need to be registered or something, but couldn't find it...


Is wordpress a library with a default GUI?

First let me give little bit background about myself. I'm a desktop application developer and a systems programmer. I usually write all my applications in Assembly,C,C++. I'm not much of a web developer. I did developed couple of websites in PHP. Nothing great, No design patters, No frameworks, No external libraries, just a simple database querying and generation of HTML. I'm trying to understand Wordpress. This is my view point about wordpress. Just correct me if I'm wrong.   1. WordPress is a library (set of functions) which has inbuilt functions for Creating, Updating, Deleting & Retrieving Posts & Comments from the database. Like QT has functions for creating widgets.    2. Wordpress is not just a library it also has a sample Frontend to demonstrate those functions from its library.Like QT ships with some sample GUIs built using the functions. If you want a different GUI, you can modify the default GUI to your needs. Now, this modifying frontend (GUI) can be done in two ways:   3. For simple modifications, Unlike in QT, they've provided with an interface for modifying - a customization panel (Admin panel)   4. For large modifications, like QT, you'll have to edit the code and make further changes.   5. Suppose, I've made changes to default GUI to meet my needs. And I'm updating a wordpress, only the library will be updated not the (default) GUI because, it would break my frontend.


Rewrite ugly URL to clean URL

Im trying to go from:               http://www.example.com/product?level1=value1&level2=value2&level3=value3&level4=value4      To:               http://www.example.com/product/value1/value2/value3/value4      Sometimes not all values are set, so it also needs to work with only 2 values set:               http://www.example.com/product/value1/value2      The `http://www.example.com/product/` page uses its own template file. This is how my code looks like:               function my_rewrite_rules( $wp_rewrite ) {         $wp_rewrite->rules =         array_merge( array(             '^product/([^/]+)/([^/]+)/([^/]+)/([^/]+)/?$' =>             'index.php?level1=$matches[1]&level2=$matches[2]&level3=$matches[3]&level4=$matches[4]'         ), $wp_rewrite->rules);     }          add_filter( 'generate_rewrite_rules', 'my_rewrite_rules' );          function my_rewrite_queryvars( $qvars ) {         $qvars[] = 'level1';         $qvars[] = 'level2';         $qvars[] = 'level3';         $qvars[] = 'level4';         return $qvars;     }          add_filter( 'query_vars', 'my_rewrite_queryvars' );      It works when im trying to get the query_vars, but it also gives me a 404 page, and not the right template. What am I doing wrong?


Can user meta be shown or hidden depending on user logged in status?

Can **is_user_logged_in** be combined with **jquery** somehow to add/remove fields wrapped in a certain class? More specifically:   * I want to wrap the users' phone and email in class "private".    * Then if the user viewing the page is logged in, they can see those two fields in the User Directory and on the User page. I don't want to just hide these fields via 'display: none;' (since they'd still be in the source).


Why isn't my registered sidebar showing up in the admin?

I'm using sidebars in my mega menu drop downs to let the admin add widgets specific areas of the menu:

<?php if ( ! dynamic_sidebar( 'submenu1-1' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-2' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-3' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu1-4' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-1' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-2' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-3' ) ) : ?><?php endif; // end sidebar widget area ?>

<?php if ( ! dynamic_sidebar( 'submenu2-4' ) ) : ?><?php endif; // end sidebar widget area ?>

      in my functions.php:               function my_widgets_init() {     /**      * menu widget areas      **/      //area 1     register_sidebar( array(         'name'          => __( 'First Menu Item - First Column', 'cfhof' ),         'id'            => 'submenu1-1',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Second Column', 'cfhof' ),         'id'            => 'submenu1-2',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Third Column', 'cfhof' ),         'id'            => 'submenu1-3',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'First Menu Item - Fourth Column', 'cfhof' ),         'id'            => 'submenu1-4',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );          //area 2     register_sidebar( array(         'name'          => __( 'Second Menu Item - First Column', 'cfhof' ),         'id'            => 'submenu2-1',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Second Column', 'cfhof' ),         'id'            => 'submenu2-2',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Third Column', 'cfhof' ),         'id'            => 'submenu2-3',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     register_sidebar( array(         'name'          => __( 'Second Menu Item - Fourth Column', 'cfhof' ),         'id'            => 'submenu2-4',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
',     ) );     }     add_action( 'widgets_init', 'my_widgets_init' );      the first set shows up but not the second.


SQL: Search query to get attachments only of those parents which are published

i'm having some problem creating nice 1 query to be able to get search results which includes NOT only post_type POST but also attachments. BUT if search query return attachment, i want that it won't be returned if that's attachment's parent is NOT published. I'm using ajaxy-search plugin and i want to customize it to search what i want. I pasted query which works for me, but i want to exclude attachments which parents are not published.               $results = $wpdb->get_results(         $wpdb->prepare(             "select $wpdb->posts.ID,                 $wpdb->posts.post_status,                 $wpdb->posts.post_parent             from $wpdb->posts             where post_title like '%%%s%%' and                 (post_type='albumas' OR post_mime_type='audio/mpeg')                  AND (post_status = 'inherit' OR post_status = 'publish')             $excludes limit 0,".$setting->limit,             ($setting->search_content == true ? array($name, $name):$name)         )     );                                                                             `      I know how to do that, but i want to get the most optimal code here, not executing in loop queries to check post_parent id and then if it's published. I want as much performance friendly code as it can be :D


plugin not updated after update wordpress 3.5.2

after upgrade to 3.5.2 plugin update not working showing error : > Downloading update from > http://downloads.wordpress.org/plugin/adminimize.1.8.4.zip… > > Unpacking the update… > > Installing the latest version… > > The package could not be installed. The plugin contains no files. > > Plugin update failed. and another problem is created I cant upload any image showing "HTTP ERROR" and cant see any thumbnail in media library. any help appreciated...


Using Jetpack carousel w/o creating a gallery

I want to use the Jetpack Carousel for all my posts without editing all of them. Is there a way to show pictures in the carousel even if they're not in a gallery?


How to Get Logged-in to "Remote WP Site" from my local script (in Same Browser)?

In Wordpress, is it possible:   * To "make my current browser" to get "logged-in" to the a WP site, from a script in my localhost? Means, i will be running a script in my `localhost`:   * `http://localhost/do_login.php` And after that, in the same browser, when i go to:   * `https://www.my_remote_wpsite.com/wp-admin` I should already be logged in there.   So my local script will make my current browser logged-in into the remote WP site. How can it be done please?


get_pages Not accepting my query

Im hoping someone maybe able to point out my mistake. I have a function in functions.php with a simple meta_query. If I use this query.               $args = array(     'meta_query' => array(       array(        'meta_key' => 'Partner_Level',        'meta_value' => 'Gold',        'post_type' => 'page',        'post_status' => 'publish'      )));     $pages = get_pages($args);               foreach ( $pages as $page ) {     $option = '<option value="' . get_page_link( $page->ID ) . '">';                 $option .= $page->post_title;                 $option .= '</option>';                 echo $option;     }      I retrieve every page in my site, not the ones matching the $args passed to get_pages(); If I simplify the $args to               $args = array(         'meta_key' => 'Partner_Level',         'meta_value' => 'Gold',         'post_type' => 'page',         'post_status' => 'publish'         );      Then Im not getting any results at all. So it really is an all or none, from what I can see my query looks good, but I know Im overlooking something, but what.... ? Appreciate any help with this. I have performed a SQL statement and Im able to retrieve the expected results using..               $querydetails = "        SELECT wposts.*        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta        WHERE wposts.ID = wpostmeta.post_id        AND wpostmeta.meta_key = 'Partner_Level'        AND wpostmeta.meta_value = 'Gold'        AND wposts.post_status = 'publish'        AND wposts.post_type = 'page'        ORDER BY wposts.post_date DESC      ";       So my assumption is its something with get_pages() not listening to my $args. Thanks in advance.


Given a WP_Query, how can I get a list of tags?

I have a `new WP_Query` that I use to generate a custom loop and display a set of posts. One of the things the query does is provide pagination. Before I display the queried posts though, I'd like to get a list of all the tags for the posts found. I know I can do this by looping through each of the posts and then removing duplicates, but I was hoping for a more elegant approach.


Saving value of a selection option in comment form as comment meta

In a plugin that I am writing I need to let user choose an option from a dropdown list before they post a comment. I used the comment_form action and inserted a drop down into the comment form.               /**      * Modify the comment to add our custom left and right dropdown      */     function modify_comment_form($post_id) {         echo "         <label class='comment'>Choose your side:</label>         <select id='tallytree_side' name='tallytree_side'>             <option selected='selected' value='neutral'>Neutral Comment</option>             <option value='left_answer'>" . $this->get_left_answer() . "</option>             <option value='right_answer'>" . $this->get_right_answer() . "</option>         </select>";     }     add_action('comment_form', 'modify_comment_form');      Which looks like this: ![enter image description here](http://i.stack.imgur.com/X3bAr.png) Now I just need to be able to save the value of this dropdown list when the comment is posted as a meta data of this particular comment. Note that this is a plugin and I dont want to modify core wordpress files as suggested in a tutorial here. I found a relevant discussions on the wordpress forum but I still could not find the answer I was looking for. How can I save the selected option value as a comment meta in wordpress database? Do I need to use AJAX for this or can this be achieved by simply using an action or filter that I could use to retrieve the value of the dropdown menu?


Problem with registration page

I am sorry if this is a very trivial question, but I am very new to wordpress and this is the first time I use wp. I am trying to set a website with wordpress and buddypress. I followed all the steps and the website is up and running in my localhost. Now I would like that a new members can register in the website. When I try to go to registration page server tell me that the page does not exist. I googled for a while, but I did not found any basic tutorial. Then I believe that this is a very trivial question, so I am wondering if something goes wrong during the installation. Who can help me or give me a resource to fix this problem?


Add subtitle to Woocommerce product title

I'm using WooCommerce on a site built with Pagelines Framework. I need to have a subtitle/customisable field appear under the product name anywhere it appears in the site. As it is, WooCommerce doesn't offer that option. I've tried using custom fields but WooCommerce use these too and output a bunch of stuff I don't want along with my subtitle. If I were to name my custom field "bookauthor" would this code work to display only the custom field I want?               <?php echo get_post_meta($id, "bookauthor", true); ?>      And if so, how do I make my new field output straight after the product title on the front end? I've found the hooks I need in this php file (I think, I don't know php, which is why I'm asking you):                   <?php      /*       * @hooked woocommerce_template_single_title - 5       * @hooked woocommerce_template_single_price - 10       * @hooked woocommerce_template_single_excerpt - 20       * @hooked woocommerce_template_single_add_to_cart - 30       * @hooked woocommerce_template_single_meta - 40       * @hooked woocommerce_template_single_sharing - 50     */     ?>      I know how to filter out but how do I add in the custom field to that list? Or is there an entirely different way to achieve what I need? Undying gratitude to anyone who can help.


WP E-Commerce - Navigation 'current item'

I'm using WP E-Commerce on a Wordpress site, which creates a 'Store' page and a 'Checkout' page. I'm also using wp_nav_menu() to create a menu. The problem is, when I'm viewing an individual product, the 'store' menu item doesn't have the 'parent_item' class, so I can't give it's active state in CSS. In fact, it sets the 'blog' page as the 'parent_item' class...which is really odd. Seems like a strange bug, unless I'm missing something of course. Any thoughts?


Modified Categories.php, it now displays wrong posts

I recently modified Categories.php for a friend's website. The website is using the Twenty Twelve theme that I have customised to his specifications. I modified Categories.php in the following way:               <?php         $i = 0;              query_posts($query_string.'&posts_per_page=10');              /* Start the Loop */         while ( have_posts() ) :               the_post();         $post = get_post(get_the_ID());     ?>          <div class="custom-archive-item" style="<?php if($i == 0 || $i == 2 || $i == 4) echo "border-bottom: none;"; // awesome hacks ?>">
          <?php echo $post->post_title; ?>

Posted on:

<?php echo the_time("F dS Y"); ?>

<?php echo_first_image(get_the_ID()); echo get_the_excerpt(); ?>

          <?php $i++; endwhile; ?>      Every time a user clicks on an "archive" link, for example "June", it won't just show posts from that month, but posts from the beginning of time. Could anybody help please? see the website at: http://www.nbanewssource.com the archive links are in the sidebar. Thank you.


Query Not working as expected

So I wrote a rather - unattractive function - a while ago and I was re- factoring some code and I realized my query function doesn't work ... I recently made a post about how my tansient posts were not working and it all boiled down to the basics of the query not working. Now yes, I do actually get a post object back, and yes I do manage to loop through it and display some content. How ever the paging isn't working, its the same set of posts regardless of page number your on. So in reading that post I checked to make sure I am getting the max number of pages. and I am. But as stated, no matter the page I am on the posts are the same. Does the same concepts applied in the answer to my other question apply here or ...                   protected function _query_post($query, $remove_nav = false){             global $wp_query;             $original = $wp_query;             $wp_query = new WP_Query($query);                  if($wp_query->have_posts()){                 while($wp_query->have_posts()){                     $wp_query->the_post();                          if(isset($this->_options['post_before'])){                         echo $this->_options['post_before'];                     }                          $this->_components->thumbnail($this->_options);                          $this->_components->title($this->_options);                          the_excerpt();                          if(isset($this->_options['post_after'])){                         echo $this->_options['post_after'];                     }                                }                 if($remove_nav != true){                     $this->_general_loop_nav($wp_query->max_num_pages);                 }             }else{                 $this->_components->error_page($this->_options);             }                  $wp_query = $original;           }      Keep in mind this function is planning to be re-factored. This question has **not already been answered** as the query coming in looks like this:               'query' => array(         'post_type' => 'post',         'paged' => get_query_var('page') // Look i'm already paged     ),


How to access my php page in wordpress

I created a services folder in `wordpress/wp-content/services`. This folder will have web services coded in PHP. But when i try to access the `.php` file it is being redirected to `index.html` While checking the `.htaccess` file i came across the line `# ErrorDocument 404 /index.php` even though i commented the line the problem is still same. Is there any particular standard to be followed to access my php. I also tried including `require_once(wp-load())` but no use.. please help.. thanks


avoiding the display of certain categories to certain user roles at content entry time

How can I eliminate the "featured" category (and its sub tree ) in the admin panel when the user role is not editors or admins?


Creating Photo Gallery System with Custom Post Type

I'm creating a movie blog using WordPress. I have Movie and Trailer custom post types and I want to add a Photo feature for this and I want to add a relationship between this photos and Movie CPT. What the best way to handle this? Is custom field the answer? And manually add the movie post id on the custom field?


Extra User Profile Field Upload File / Image

I have been following the following tutorial to try and an upload form to the user profiles. http://www.scribd.com/doc/81666407/Add-and-Remove-WordPress- User-Profile-Fields-and-Display-Them-Within-Your-Theme- I'd like to be able to make this a little more simple and just have an upload button and text box that allows the user to upload one file at a time rather than multiple files. I was going to use Cimy Plugin which allows file uploads, however it doesn't seem to be possible to add sub headings for some fields. If any of you have any recommendations that would be brilliant.


How do I display a tag cloud under my post that only shows tags from that post?

I've be looking to add a tag cloud under my post that only shows tags pertaining to the post. The tags shown should be in a tag cloud format; the post tags that have more post tagged with it will be displayed in a bigger font. I've tried adding the following code under my posts:               <?php wp_tag_cloud( array(                  'smallest' => 8,          // font size for the least used tag             'largest'  => 22,         // font size for the most used tag             'unit'     => 'px',       // font sizing choice (pt, em, px, etc)             'number'   => 45,         // maximum number of tags to show             'format'   => 'flat',     // flat, list, or array. flat = spaces between; list = in li tags; array = does not echo results, returns array             'orderby'  => 'name',     // name = alphabetical by name; count = by popularity             'order'    => 'ASC',      // starting from A, or starting from highest count             'include'  => $post_id,         // ID's of tags to include, displays none except these             'link'     => 'view',     // view = links to tag view; edit = link to edit tag             'taxonomy' => 'post_tag', // post_tag, link_category, category - create tag clouds of any of these things             'echo'     => true        // set to false to return an array, not echo it              ) ); ?>      I was attempting to use the include array to call up the post id to take reference of the post tag. But it does not work. It shows all the tags in existence, instead of the tags that are specific to the post. Does anyone have a solution. Please help.


WP_Query leaking absurd amounts of memory

Every time I call WP_Query() in the function below, Wordpress leaks 8 megs of memory. And since I call this function a lot, things get hairy pretty quickly... :( I've tried unsetting the resulting $queryObject as well as periodically calling wp_cache_flush(), but neither seems to have any effect. Any thoughts?               function get_post_ids_in_taxonomies($taxonomies, &$terms=array()) {         $post_ids = array();              $query = gen_query_get_posts_in_taxonomies($taxonomies, $terms);         // var_dump($query);              //Perform the query         $queryObject = new WP_Query($query); //*****THE 8 MEGABYTES IS LEAKED HERE*****              //For all posts found...         if($queryObject->have_posts()) {             while($queryObject->have_posts()) {                 $queryObject->the_post();                      //Get the $post_id by capturing the output of the_ID()                 ob_start();                 the_ID();                 $post_id = (int) ob_get_contents();                 ob_end_clean();                      // echo $post_id."\n";                 $post_ids[] = $post_id;             }         }              unset($queryObject);              return $post_ids;     }      gen_query_get_posts_in_taxonomies() is:               function gen_query_get_posts_in_taxonomies($taxonomies, &$terms=array()) {         //General query params         $query = array(             'posts_per_page'    => -1,  //Get all posts (no paging)             'tax_query'             => array('relation' => 'OR'),         );              //Add the specific taxonomies and terms onto $query['tax_query']         foreach($taxonomies as $tax) {             //Get terms in the taxonomies if we haven't yet             if(!array_key_exists($tax, $terms)) {                 $terms[$tax] = array();                      $terms_tmp = get_terms($tax);                 foreach($terms_tmp as $tt)                     $terms[$tax][] = $tt->term_taxonomy_id;             }                  $query['tax_query'][] = array(                 'taxonomy' => $tax,                 'terms' => $terms[$tax],                 'field' => 'term_taxonomy_id',             );         }              return $query;     }


Sort the data in Wordpress using get-page-by-title

Just got this "fresh" task this morning. I have a website that using the following syntax               $thenews = get_page_by_title(date("Y"));      But in the website it's displaying not the latest news. What other parameter should I include in this syntax? To be honest I just start explore WordPress this morning but quite familiar with PHP Another problem is I only have the CMS module from vendor, I have no source file to play along. Thank you -sea-


PHP Warning on fresh install (Connection timed out)

I get this PHP Warning when accessing my fresh WordPress 3.4.1 install (Norwegian language).               Warning: fopen(URL_TO_MY_WORDPRESS_PAGE/wp-cron.php?doing_wp_cron=1341476616.7605190277099609375000): failed to open stream: Connection timed out in PATH_TO_MY_WP_FILES/wp-includes/class-http.php on line 923      This is of course with the `WP_DEBUG` flag set to `true`, as it's running on a development server. ![enter image description here](http://i.stack.imgur.com/fkFpe.jpg) This happens intermittently, so it seems to be a problem with `wp-cron`. Is this likely an error in WordPress or something wrong on my server? **Should I worry?** The server is a fresh Ubuntu Server 12.04 VM with the LAMP stack. Google search shows I'm not the only one experiencing this. (See buffered/indexed versions of pages listed to see the actual errors.) **EDIT: I'm also getting this same PHP Warning on the front page. Could it be related to the fact that the webserver is being NATed to? Currently I've set up the firewall to point port 19235 to 80 on the development server.**


Dynamically output a class to an anchor tag depending on what tag is chosen

Not sure if this is possible, but what Id like to do is have the ability to output/add a class to an anchor tag depending on what tag I choose when creating the post. My reasoning behind this is to be able to call up different background images via CSS depending on the tag that will be chosen for each specific post. Here is an example of what Im ive got going already... What Im essentially doing here is showing a featured image from the post and then on hover, a jquery script is called to reveal the anchor tag over the image which contains the background image that Id like to dynamically change depending on the tag chosen.
              <?php $epr_acces = new WP_Query(array('post_type' => 'product', 'productcategory' => 'epr-accessories', 'posts_per_page' => 6, 'orderby' => 'rand', 'paged' => $paged )); ?>     <?php while ($epr_acces->have_posts() ) : $epr_acces->the_post(); ?>
     <a href="<?php the_permalink(); ?>" title="View Item" class="product_view_sm">..View Item..     <?php the_post_thumbnail('prod-img-sm', array('class' => 'single_product_img_sm', 'alt' => 'View Product')); ?>
          <?php endwhile; ?>     <?php wp_reset_query(); ?>


Latest posts by category — how to exclude current post?

This is the code I use to display the 4 most recent posts under the category the current post belongs to (right below the current post):               <?php if (is_single()) : ?>         <?php             $count = 0;             $aahan_category = get_the_category();             $aahan_category = get_term_by( 'name', $aahan_category[0]->cat_name, 'category');             $some_featured_posts = new WP_Query(array('category_name' => $aahan_category->slug, 'posts_per_page' => 4));             while ($some_featured_posts->have_posts()):                 $some_featured_posts->the_post();                 $count++;                 $no_margin = (2 == $count || 4 == $count) ? ' no-margin-right' : '';         ?>              <div class="latest-category-posts-image-t<?php echo $no_margin; ?>">         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">             <?php the_post_thumbnail( 'thumbnail' ); ?>
<?php the_title(); ?>

              <?php             endwhile;             wp_reset_postdata();         ?>     <?php endif; ?>      In case it matters, I added this code in `content-single.php`. The code basically shows the featured images (post-thumbnail) of the 4 most recent posts under the category the current post belongs to, along with their titles. Now the question is, if the current post is among the `n` most recent posts (`n = 4` as per my code), how do I exclude it from the listing? **PS:** Although it goes without saying, it would be great if you can show how the code I use could be _optimized_.


When a user creates a post (pending), send a confirmation link that allows them to publish

I've got another question for you guys! I need the following thing:   1. User creates post (automatically sets it to pending for approval)   2. Send the user an email with a confirmation link   3. The User clicks the link   4. The posts will be set to approved and will be posted automatically How can this be created? Are there hooks in Wordpress available to create such a confirmation link?


Featured Image uploaded, attached and set but only appearing in the media library

I am using the function in this answer to upload, attach and then [set_the_post_tumbnail][2]/featured image to a post which I am creating from an RSS feed. I ran a test and the output is showing that the attachment ID matches my thumbnail ID. I checked in the media library and it is assigning the correct IDs according to get_post_thumbnail_id but **the problem is** my featured image meta box is not displaying the image through the dashboard or when using [get the post thumbnail][4] in my template. Am I missing any steps here? The code is mostly from the answer linked above with a few tests on the end.               global $wp_query;                     wp_insert_post($my_post); // create a new post                     $post_id = $wp_query->post->ID;  // get the ID for the new post                               $image_url = $thumbnail;                     $upload_dir = wp_upload_dir();                     $image_data = file_get_contents($image_url);                     $filename = basename($image_url);                     if(wp_mkdir_p($upload_dir['path']))                         $file = $upload_dir['path'] . '/' . $filename;                     else                         $file = $upload_dir['basedir'] . '/' . $filename;                     file_put_contents($file, $image_data);                          $wp_filetype = wp_check_filetype($filename, null );                     $attachment = array(                         'post_mime_type' => $wp_filetype['type'],                         'post_title' => sanitize_file_name($filename),                         'post_content' => '',                         'post_status' => 'inherit'                     );                     $attach_id = wp_insert_attachment( $attachment, $file, $post_id );                     require_once(ABSPATH . 'wp-admin/includes/image.php');                     $attach_data = wp_generate_attachment_metadata( $attach_id, $file );                     wp_update_attachment_metadata( $attach_id, $attach_data );                          set_post_thumbnail( $post_id, $attach_id );                     echo "Attachment ID: " . $attach_id;                     $post_thumbnail_id = get_post_thumbnail_id( $post_id );                                  echo "Thumbnail ID: " . $post_thumbnail_id;                      get_the_post_thumbnail($post_id, 'full');


Auto add content such as pages upon plugin activation?

I'm creating my first plugin and it requires some pages with content to functionally work properly. I was wondering if it is possible to show a message like "Click here to automatically add the required pages for this plugin" in the wordpress plugins area. So when the user activates the plugin this message will show and if the user clicks the button a function will run that will add the pages necessary. Any help in direction most appreciated. Matt


I have created a "custom link" under Menus. ![enter image description here](http://i.stack.imgur.com/HtIGQ.jpg) The problem is that URL in the browser retains the Wordpress URL ( http://blog.tabsonrahm.org ) instead of the linked URL ( http://tabsonrahm.org/about ). When I click a custom menu link, how do I make it update the URL in the browser to the external link? Thanks.


split wordpress loop into columns of categories and associated posts

Here is what I need to do with 5 columns on the "archive" page: I can already loop through the categories and posts in a loop to display them quite nicely, I just cant figure out how to split it into columns. I also need it to be paged. Basically show only 18 post titles/excerpts per page. Any help? My loop below: **UPDATE: I am posted the working solution below. This works perfectly to break a continuous loop of posts sorted and displayed by category of any type or taxonomy.** **WHAT STILL NEEDS WORK:** I cannot seem to figure out how to make the paging work. I need the paging to count total posts (ignoring the categories) and display only 12 or so per page. I have added the paging code but it is commented out.               <?php     // for a given post type, return all             $post_type = 'retailers';             $tax = 'states';             $tax_terms = get_terms($tax);             $post_counter = 0; // reset so we can generate columns              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                      if ($tax_terms) { ?>
                      <?php foreach ($tax_terms as $tax_term) {                      $args=array(                     'post_type' => $post_type,                     "$tax" => $tax_term->slug,                     'post_status' => 'publish',                     'posts_per_page' => -1,                   //'posts_per_page' => 15,                   //'paged' => $paged,                     'orderby' => 'title',                     'order' => 'ASC',                     'caller_get_posts'=> 1                     ); // END $args                          $my_query = null; // clear the query variable                     $my_query = new WP_Query($args);                          if( $my_query->have_posts() ) { ?>

<?php echo $tax_term->name; ?>

                  <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
                                    <div class="retailer_wrap retailer_id-<?php the_ID(); ?>" style="padding:0; width:165px; float:left;">
                                   <?php the_title(); ?>
                                                                        <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_2_numInSet_0', true)) { ?>                                       <?php echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_2_numInSet_0', true); ?>                                     <?php } ?>                                     <?php echo " "; ?>                                     <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', true)) { ?>                                       <?php echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_1_fieldID_1_numInSet_0', true); ?>                                     <?php } ?>
                                                                                <?php if (get_post_meta($post->ID, '_simple_fields_fieldGroupID_2_fieldID_3_numInSet_0', true)) {                                       echo get_post_meta($post->ID, '_simple_fields_fieldGroupID_2_fieldID_3_numInSet_0', true); ?>                                     <?php } ?>

                               <?php $post_counter++; ?>
                                  <?php if ( 0 == $post_counter % 7 ) { ?>

                             <?php } ?>                           <?php                           endwhile;                           //wp_pagenavi( array( 'query' => $my_query ) );                          } // END if have_posts loop                         wp_reset_query();                            } // END foreach $tax_terms                     } // END if $tax_terms                     ?>


Do I need to instantiate the XMLRPC class or any class in another class to access its methods?

I would like to use some of the methods of the XML RPC class, "wp_xmlrpc_server" in my own class. Is this class instantiated already or should I declare it myself? If so how?


Plugin data shared in Multisite

I am trying to build a site that very closely resembles another and so far so good with WordPress Multisite Networks. I am also using the plugin WP-FileBase - this plugin creates a database table per site (http://wordpress.org/support/topic/plugin-wp-filebase-download-manager-does- it-work-on-multisite) - is there any way for me to set it up so that the sites share the same database?


How to move wp-content (or uploads) outside of the Wordpress directory

I am trying to move the wp-content directory outside of the wordpress directory and hitting all kinds of weird problems. Even though http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder says you can do this, it seems that the directory structure is deeply wired into the WP code. For example, I get error messages like:               PHP message: PHP Warning:  file_exists(): open_basedir restriction in effect.     File(/srv/wp.content/themes) is not within the allowed path(s): (/srv/wordpress/:/tmp)      in /srv/wordpress/wp-includes/theme.php on line 369      All I need to do is to move the uploads directory outside of the main hierarchy. I tried to symlink it as well but then I am getting permission errors. Did anybody manage to successfully have the wp-content directory, or at least, uploads directory outside of the root directory?


Getting headers already sent error from plugin

I'm having a bit of trouble with a 'headers already sent' error from a Wordpress plugin I had built for me and now I'm adapting. This is the error: > Warning: session_start() [function.session-start]: Cannot send session cache > limiter - headers already sent (output started at > /home1/uname/directory/domain.com/wp-content/themes/ibm/header.php:2) in > /home1/uname/directory/domain.com/wp-content/plugins/osu-rfm/osu-rfm.php on > line 225 I've looked at header.php line 2 and this is what is there with no extra white spaces nor funny characters etc:               <!DOCTYPE html>     <!--[if lt IE 7 ]> <html class="ie ie6 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 7 ]>    <html class="ie ie7 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 8 ]>    <html class="ie ie8 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if IE 9 ]>    <html class="ie ie9 no-js" <?php language_attributes(); ?>> <![endif]-->     <!--[if gt IE 9]><!--><html class="no-js" <?php language_attributes(); ?>><!--<![endif]-->     <!-- the "no-js" class is for Modernizr. -->          <head id="osu-rfm" data-template-set="html5-reset-wordpress-theme" profile="http://gmpg.org/xfn/11">              <title>                <?php                   if (function_exists('is_tag') && is_tag()) {                      single_tag_title("Tag Archive for ""); echo '" - '; }      I've looked at line 225 in osu-rfm.php and this is what is part of that file (this is the plugin btw):               public static function enable_sessions()     {         if( is_post_type_archive( "ibmdirectory" ) || "ibmdirectory" == get_post_type() )         {             if( ! isset( $_SESSION ) )         /*         if(headers_sent($filename, $linenum)) {             //if headers already sent out print some message.             echo "Headers already sent in $filename on line $linenum\n";         } else {             //if headers not already sent             echo "New headers";         }         */             session_start();         }     }      And now I'm completely stuck as I don't know what to try next...can anyone make some suggestions? I removed all white space at the end and beginning in all my theme files as suggested here, but it doesn't seem to make a difference. I've also tried removing the closing `?>` tag at the end of my plugin file, but nada. By the way, this only happens on my live server, not my local set up, so I have the feeling it could be a server issue. Thanks Osu


Is there an action/filter called when WP_Query->query is finished and assigns posts

I took a look at the `WP_Query->get_posts()` function and couldn't see any action/filter that is called **AFTER** a query finishes. I want to be able to manipulate the results once they are sent, rather than the query itself (Using a Human Name Parser to sort by last name). I'm revamping an old site that alters the global `$wp_query->posts` right within `archive.php`, so I was just wondering if there was a way to take this logic completely out of the archive file and store it with my other CPT functionality. Cheers!


"Custom Post Type Permalinks" plugin URL strcuture

I've found this great plugin _Custom Post Type Permalinks_ by a Japenese developer which is awesome at generating hierarchical permalink structures for Custom Post Types. Only I'm having an issue which I cannot get around and am looking for a solution. I have a custom post type `classes` and a taxonomy `classes_categories` (ex: languages, technology, sciences...) The links generated by WordPress for the 'classes_categories' look like this:               http://site.com/classes/class_categories/languages/      I would like them to be like this:               http://site.com/classes/languages/      Strangely, both of the URL's work but I would like WordPress to generate them without 'class_categories' in the URL. I'm looking for a solution which would involve either plugin configuration, my taxonomy declaration parameters or perhaps a workaround with a hook or something (maybe parse the URL when they a being rewritten). thank you


Creating a Lightweight Media Tags Plugin with a Custom Taxonomy

We’ve been using Media Tags ( http://wordpress.org/plugins/media-tags/ ) for a while, particularly for the dashboard media management features rather than any of its front end display features. It isn’t really actively maintained anywhere, and since WP 3.5, is just a massive amount of overhead for something that should be able to be accomplished with little more than a custom taxonomy. In trying to create a working, minimal Media Tags plugin, I’ve used this Question ( How it is possible to use taxonomies on attachments? ) as my primary guide, but it suffers from at least two problems that I’m having issues resolving. ~~1) When viewing the tags in the dashboard, I always get a count of 0 displayed, even when there are clearly items tagged with said tag (and clicking on the 0 even takes you to them). I tried updating the update_count_callback value to ‘_update_generic_term_count’ per the other Question I’ve linked to, but it doesn’t give me anything other than 0s.~~ EDIT: My counts were off due to, not to this code, but to pre-existing entries in the database from code used earlier. 2) When viewing the Media Tags in the backend, you’re always presenting with a ‘View’ link when hovering on an item. That view link always tries to go to a non-dahsboard page that always brings back no posts. Ideally, the View link would just not be present - but it it needs to show up, I’d like it to at least work. Here’s the code I’m currently trying, but running into the two problems above:                   // Register Custom Taxonomy     function cets_media_tags_init()  {         $labels = array(             'name'                       => _x( 'Media Tags', 'Taxonomy General Name', 'text_domain' ),             'singular_name'              => _x( 'Media Tag', 'Taxonomy Singular Name', 'text_domain' ),             'menu_name'                  => __( 'Media Tags', 'text_domain' ),             'all_items'                  => __( 'All Media Tags', 'text_domain' ),             'parent_item'                => __( 'Parent Media Tag', 'text_domain' ),             'parent_item_colon'          => __( 'Parent Media Tag:', 'text_domain' ),             'new_item_name'              => __( 'New Media Tag', 'text_domain' ),             'add_new_item'               => __( 'Add New Media Tag', 'text_domain' ),             'edit_item'                  => __( 'Edit Media Tag', 'text_domain' ),             'update_item'                => __( 'Update Media Tag', 'text_domain' ),             'separate_items_with_commas' => __( 'Separate Media Tags with commas', 'text_domain' ),             'search_items'               => __( 'Search Media Tags', 'text_domain' ),             'add_or_remove_items'        => __( 'Add or remove Media Tags', 'text_domain' ),             'choose_from_most_used'      => __( 'Choose from the most used Media Tags', 'text_domain' ),         );              $args = array(             'labels'                     => $labels,             'hierarchical'               => false,             'public'                     => true,             'show_ui'                    => true,             'show_admin_column'          => true,             'show_in_nav_menus'          => false,             'show_tagcloud'              => false,             'update_count_callback'      => '_update_generic_term_count',             'query_var'                  => false,             'rewrite'                    => false,         );              register_taxonomy( 'media-tags', 'attachment', $args );     }          // Hook into the 'init' action     add_action( 'init', 'cets_media_tags_init', 0 );


Add File Attachment Name and URL into Javascript

I'm working on incorporating the jPlayer into our WordPress site. I don't particularly care for the two plugins that are available as our client is a bit on the technically deficient side. What we are looking to accomplish is have the Title and Mp3 load into the JavaScript for the jPlayer playlist. Currently everything is loading just fine and returning the appropriate texts, however I'm unable to get the File Name and the Attachment URL to load appropriately. I'm fairly new to java and wordpress for that matter. Any help would be appreciated. If you would like to see a live site example, please visit http://www.ourgoodfight.com/?p=6054               <!--Begin Jplayer Playlist -->     <script type="text/javascript">         //<![CDATA[         $(document).ready(function(){             new jPlayerPlaylist({                 jPlayer: "#jquery_jplayer_1",                 cssSelectorAncestor: "#jp_container_1"             }, [              <?php                 global $post;                     $jukebox_args = get_posts( array(                         'post_type' => 'attachment',                         'posts_per_page' => -1,                         'post_mime_type' => 'audio/mpeg',                         'orderby' => 'menu_order',                         'order'  => 'ASC',                         'post_parent' => $post->ID                             ));                     $the_jukebox_query = new WP_Query( $jukebox_args );                     ?>             <!--This is what needs to loop -->                 <?php                     $loop = new WP_Query( $jukebox_args );                         while ( $loop->have_posts() ) : $loop->the_post(); ?>                     {                         title:<?php echo apply_filters( 'the_title', $attachment->post_title ); ?>,                         mp3:<?php echo wp_get_attachment_url( $attachment->ID, false ); ?>,                     },                 <?php endwhile;?>             <!--This would be the end of the loop -->             ], {                 swfPath: "<?php echo get_template_directory_uri(); ?>/js",                 supplied: "mp3",                 wmode: "window"             });         });         //]]>     </script>


Regenerate slugs from title of posts

is it possible to regenerate the slugs programmatically after changing the titles of the post?   The girl that updated the title of more than 200 posts just "forgot" to update the slug too, so i was wondering if there was some sort of plugin that regenerates the slugs from the new titles


phpMyAdmin displays error when importing database

I'm migrating a WordPress for a friend to a different server. I have already backed up all files and was given a copy of the database by the old server admin. The problem is that when I try and import the database using phpMyAdmin, I get this error message: `SQL query: -- -- Database: ``wordpress_6`` -- CREATE DATABASE ``wordpress_6`` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; MySQL said: Documentation #1044 - Access denied for user 'prvtres9'@'localhost' to database 'wordpress_6` I'm not sure what would initiate this error message, but the tiny amount of information I found out in several hours of frustration eludes that it could be in the way the database was copied, therefore putting me in a helpless position, but I don't want to approach the old server admin just to be wrong about this


How to use a .edu domain with WordPress?

I work with a university that already has a domain name that ends in `.edu` (clari.buffalo.edu). I want to use this domain name as we have decided to migrate our web page to WordPress. From the sign up page, it appears that `.edu` is not supported. Is this true? If not, how can I use a `.edu` name with WordPress?


Any walker causes blank menu?

Using the following, or any other custom Walker_Nav_Menu seems to cause a blank navigation menu, I tried specifying the default to make sure I wasn't going crazy yet it still blanks the output... Any ideas on what is going wrong?               <?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 3, 'walker' => new Walker_Nav_Menu() ) ); ?>      In Context               <?php     /**      * The Header for our theme.      *      * Displays all of the  section and everything up till
      *      * @package Expound      */     ?><!DOCTYPE html>     <html <?php language_attributes(); ?>>          <meta charset="<?php bloginfo( 'charset' ); ?>" />     <meta name="viewport" content="width=device-width, initial-scale=1" />     <title><?php wp_title( '|', true, 'right' ); ?></title>     <link rel="profile" href="http://gmpg.org/xfn/11" />     <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />               <?php wp_head(); ?>               <body <?php body_class(); ?>>
         <?php do_action( 'expound_header_before' ); ?>

                     <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">

                     <?php if ( dynamic_sidebar('header_widget_area') ) : else : endif; ?>

<?php _e( 'Menu', 'expound' ); ?>

<a href="#content" title="<?php esc_attr_e( 'Skip to content', 'expound' ); ?>"><?php _e( 'Skip to content', 'expound' ); ?>
     ####################################################################################         <?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 3, 'walker' => new Walker_Nav_Menu()) ); ?>     ####################################################################################
<?php if ( dynamic_sidebar('navigation_widget_area') ) : else : endif; ?>
                 <?php do_action( 'expound_navigation_after' ); ?>                               <?php do_action( 'expound_header_after' ); ?>
      The above is currently in my header.php of a child theme if that makes any difference, and the original theme also used the default walker, however it wasn't explicitly stated. with php as above

                     Home

      Gives errors:               Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 148          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 151          Notice: Trying to get property of non-object in /home/taamc/public_html/wordpress/wp-includes/nav-menu-template.php on line 153      with php as found by default in the theme               <?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => 3) ); ?>

             Home

             Activity

             Gallery

             Getting Started

             Groups

             Map

             Members


Run next query based on first query's term

I'm creating an authors site. I'm using a custom post type (Books) to display books. I'm using another custom post type (Reviews) to display reviews on the same page as the corresponding book. I'm sorting books and reviews with a custom taxonomy, with terms such as book1, book2, etc. On each single book page (`single-books.php`), I'm running a second query to display the reviews. So far so good. The problem is how to display ONLY the reviews with the same term as the current book. How can I get the term from the first query and then run it in the next query?


Hook to generate a dynamic sitemap with "All in One SEO Pack" Plugin

Besides the urls of posts, pages and categories, I need my site's sitemap to include the urls of various pages that display data coming from an external source other than the WP database (Rails API). Is there a hook to which I can add a filter so that once Dynamic Sitemap Generation takes place, I can then append these other urls to the sitemap. PS: I had a suggestion to use **aiosp_sitemap_post_filter** , but there is no doc on how it works. Thanks **UPDATE** with **aiosp_sitemap_post_filter** you can add only other posts to the sitemap and no custom content.


Directly using pure JWPlayer JS (but NOT WP Plugin)

First of all, I'm not using WP JWPlayer Plugin. (And i don't want it. And thats the another story) * * * Well in the Template file:               wp_register_script('myJW', get_bloginfo('template_url') . '/jwplayer.js');     wp_enqueue_script('myJW');     ?>

           It is not working, since **even** the `jwplayer("myJWPlayer")` call is **not** being triggered. * * * **Note: This codes are perfectly working in pure HTML sites.**   Any idea please?


Unable to get to the admin panel

I am using WordPress on one of the sites. I admit that I have been blitheringly idiotic not testing on a dev server, but I updated all the plugins today. They were akismet, custom login and wp security. Now the problem is that I am unable to get to the wordpress login panel. I had changed the login url using one of the plugins custom login or wp security or both, I am sure I don't remember. The login page url sends me to the not found page. I have already tried disabling all the plugins from the database by applying `a:0:{}` in active_plugins in the options table on the wordpress database.


Adding restrictions to open comments

I've got my discussion settings set to allow people to comment without registering, so the comment form has the standard Name, Email, Website and Comment, and this is working exactly as I want. The only problem is that if someone uses an admin's screenname and email, it looks as though the comment has come from the admin, as it picks up the gravitar and all. Is there any way to prevent users commenting with an email that matches an admins - unless it is the admin, in which case they'd be logged in? Or do I just have to moderate every comment before it's published?


How to get the first tag of a post as a hyperlink?

This WordPress Codex document clearly shows how to get the name of the first tag of a post:               <?php     $posttags = get_the_tags();     $count=0;     if ($posttags) {       foreach($posttags as $tag) {         $count++;         if (1 == $count) {           echo $tag->name . ' ';         }       }     }     ?>      How do I modify the aforementioned code, so that a hyperlink of the tag is shown, instead of just the name?


Bar separated navigation by extending Walker_Page

This question follows on from this one: Bar separated navigation by extending Walker_Nav_Menu I'm trying to do the same thing but this time I'm extending `Walker_Page` instead. The issue I'm having is that I'm setting the depth to 1 and in that depth there might be 4 pages. But in the `walk()` the number of elements returned are more. Because the number of elements returned are more than the amount of pages being showed then I get one bar `|` too many added to the end of my menu. Here is the code I have so far:               <?php     $children = get_pages('child_of='.$post->ID);     if( 0 != count( $children ) ) {         $child_of = $post->ID;     } else {         $child_of = $post->post_parent;     }     $args = array(         'depth'        => 1,         'child_of'     => $child_of,         'title_li'     => '',         'echo'         => 1,         'sort_column'  => 'menu_order, post_title',         'walker' => new Bar_List_Walker_Page     );     wp_list_pages( $args );     ?>      My Walker:               class Bar_List_Walker_Page extends Walker_Page {         public $count;         public $running_count;         function __construct() {             $this->count = 0;             $this->running_count = 0;         }         function start_el(&$output, $page, $depth, $args, $current_page) {             extract($args, EXTR_SKIP);             $css_class = array();             if ( !empty($current_page) ) {                 $_current_page = get_page( $current_page );                 _get_post_ancestors($_current_page);                 if ( isset($_current_page->ancestors) && in_array($page->ID, (array) $_current_page->ancestors) )                     $css_class[] = 'current_page_ancestor';                 if ( $page->ID == $current_page )                     $css_class[] = 'current_page_item';                 elseif ( $_current_page && $page->ID == $_current_page->post_parent )                     $css_class[] = 'current_page_parent';             } elseif ( $page->ID == get_option('page_for_posts') ) {                 $css_class[] = 'current_page_parent';             }             $css_class = implode(' ', apply_filters('page_css_class', $css_class, $page));             $output .= 'ID) . '">' . apply_filters( 'the_title', $page->post_title, $page->ID ) . '';         }         function end_el(&$output, $item, $depth) {             $this->running_count++;             if($this->count > $this->running_count)                 $output .= " | ";         }         function walk( $elements, $max_depth, $r ) {             $this->count = count($elements);             return parent::walk( $elements, $max_depth, $r );         }     }      How do I get my walker to get the correct amount of pages in the level I'm targeting?


WP Cron is "half-failing" to insert posts

I built a plugin for my company, which basically goes to tube sites, scrapes them for content, and posts them automatically in whatever state is defined (publish, draft, future, etc). Now, everything goes well when I manually add a post through the plugin: it opens a cURL to the sites, grabs the videos and embeds, takes thumbnails, posts titles, flawless. however, when I try to run it from the cron job using               add_action('timelyTube', 'timelyPost');      and on the activation hook:               wp_schedule_event(time(), 'hourly', 'timelyTube');      it works in the sense that it fires the function `timelyPost()`, but when it goes to grab the video, it's not able to do so, it grabs the thumbnails & titles, but not the embeds, meaning that the cURL is working, but something gets messed up in the process. if anyone has any idea about what to do, I'll be grateful, Thanks, Itai.


Twitter/Facebook login for comments

What plug-ins there are available to allow people to leave comments using their Facebook and Twitter logins? Any special considerations or recommendations? I am currently allowing comments with the email addresses (default setup), but there are certain problems in this approach (spam being one).


Category archive is displaying all posts rather than the specific category

Here is my loop code for index.php . I do not have an archive or category.php right now. This is very basic.               $temp = $wp_query;     global $wp_query;         $wp_query = new WP_Query();          $wp_query->query('posts_per_page=20'.'&paged='.$paged);     while ($wp_query->have_posts()) : $wp_query->the_post();      I have about 10 posts split up into different categories. When I click /category/category-name it just lists all posts rather than filtering by category. Can someone help me out if they know the solution? Thanks.


With get_the_post_thumbnail I want the image to be 100% wide

I have a WP site whose center column is variable width. I would like the featured image to appear front and center - 100% width. If I hard code the image path using a plain old image tag with width=100% it looks exactly as I want. For obvious reasons I don't want it hard coded. I'm currently using this but the image goes outside of the bounds of the column.               <?php echo get_the_post_thumbnail($id, 'full', array('class' => 'aligncenter')); ?>      So, my question is this. How can I mimic the behavior of `<img src="myimage.png" width="100%" />` but with the `get_the_post_thumbnail` convention.


How do I add a post to a menu

I'm trying to get WordPress to highlight a specific item in my menu when a post (any post) is viewed. I'm thinking that adding the post to the menu item, then suppressing display of sub-menus might help, but my 'Menus configuration' page doesn't show posts as items to add to the menu. Does anyone know why that is, or if there's a better alternative to this method? I'm using a copy of the default TwentyTen theme which calls `wp_nav_menu` in `header.php`.


Enable "My blogs" in a custom installation

I'm trying to make a little blog network that functions like wordpress.com, where I can create and admin multiple blogs with a single user (or share blogs between users). I've tried to do that by simply following this guide, but when I tried to create a new site, it created another user with it. How can I enable the **_my blogs_** function from wordpress.com on a custom installation?


Pinterest Pin It button and facebook thumbnails don't work with uploaded images on Wordpress blog. Why?

I have recently migrated from blogger to wordpress, but am having issues with images. Both Pinterest and Facebook are not recognising my new images that I am uploading to wordpress, however they do recognise the old images that have been imported directly from blogger and still point to blogger. When I try to pin an image it allows me to select the image, but then when I click "pin" it says "Whoops! Sorry, We could not fetch the image". With facebook, trying to share the link, the posts with new uploaded images do not load any thumbnails, however the images from the old imported blogs do show thumbnails. I have checked the pinning from a friends blog that is based off the same theme and I can pin off their site. I have also checked whether the uploaded images are in iframes - they are not. I have verified my website with pinterest. If I load the images onto a image hosting site, such as photobucket and add them to the wordpress post via the photobucket url then they work fine, with pinterest and facebook. However, this is an extra step which I don't want to have to do every time I blog.


I am getting `function deactivate_plugins does not exist` error when calling this function               function deactivateSelf(){         deactivate_plugins(RSD_PLUGIN, true); //gives error: function deactivate_plugins does not exist         header("Location: plugins.php?deactivate=true"); //redirect to plugin management with message         die();     }        * the function `deactivate_plugins` is on the server in `/wp-admin/wp-includes/plugin.php`   * the function deactivateSelf works on my developer's computer but not on my linode server   * I downloaded http://www.turnkeylinux.org/wordpress, which should have pretty standard configuration and I got the same error. I tried to upgrade wp to the latest version and still got the same error. Any idea how to make it work?


How do I remove a pre-exising customizer setting?

My theme doesn't use the tag line, how can I remove it from the customizer?


Is wordpress Privacy Settings sufficient for this?

I am going to import my current blog posts on to my future to-be self-hosted wp blog. It will take somedays before I make it the primay blog. In the WP Privacy Settings I have set "Ask search engines not to index this site" Is this setting enough so as to not affect my current page rankings? Or do I need to do something else may be messing with robots.txt or anything? Or are there any side-effects with this settings? EDIT: It says underneath: `"Note: Neither of these options blocks access to your site — it is up to search engines to honor your request."`


How can I create gallery of products and submit data for each product?

I have a client that wants an eCommerce contact to order website. The client wants to submit products on the website, including the price, name, and information for the product. Along with that, the "contact to order" would be clicking the button for each product, it'll go to a form and contact the site owner for purchase (I can do that part). But this will be my first time really developing with WordPress other then creating a theme for it. I have no clue how I should get started with this project. There is a feature on WordPress called Taxonomies, as I read it might be what I need. Is this correct? If not, what would be the best solution for creating products and showing them on the website? Is there a plugin for this?


How to display <a> tag attribute "target" in the_author_meta( 'description' );

I am facing following problem: Lets assume user has pasted his twitter id within "Biographical info" textarea using tag along with target _blank attribute, but the outcome for the_author_meta( 'description' ); discarded attribute target _blank of tag. Any solutions? Thanks,


How to update taxonomy custom field with wp_update_term()?

I'm using Clipper, a coupon theme developed by AppThemes.com, and I'm trying to programmatically import coupons. The problem I'm having is each coupon needs to have a "store" added when it's uploaded. I can add the "store name" just fine, but I'm not able to update one of the custom fields associated with the "stores" taxonomy. Below is my code to update the custom_field. 41 is the term_id of the taxonomy I'm trying to update.               wp_update_term( 41, 'stores',      array(     'clpr_store_url' => $url,     'clpr_store_aff_url' => $url     )     );       It appears that "wp_update_term" does not allow me to update the field "clpr_store_url". Here is the documentation for the function but it doesn't help me out: http://codex.wordpress.org/Function_Reference/wp_update_term


Adding my own "add to cart button"

I am using Jigoshop to build an e-commerce site. The end goal is for the front page to have a _featured products_ section. Jigoshop provides a shortcode, but the shortcode defaults to the medium image size. I would like to use the large image size, and so I did a WP_query conditionally to check for featured images, grabbed the image, product title and description, but can't seem to figure out how to get the "add to cart" button generated. Any ideas?


Restrict the Number of Posts an Author can Publish (over time)?

I'm thinking maybe limit the number of posts a user can make in a given period of time. (Say a user can only publish 1 post per 5 minutes?)   Is there such a plugin?


Creating a non-removable taxonomy term

Is there a way, without modifying the core, to create a term for a custom taxonomy programmatically that is non deletable? "Uncategorized" is an example, but in my case, it does not have to be the default term if a post is not attached a term, but yes it will be a default always existing term in that custom taxonomy. **EDIT:** By non-removable, mostly I mean on front-end. That is, the delete link and bulk action checkbox will not show, just like "Uncategorized".


How to make a theme with more than one CSS file?

I've made my first theme and now I want to create different "profiles". These profiles are just independent CSS files that user can try. The point is, how to make these files to allow users to choose the color scheme through the admin panel? It is, I don't want to allow users to access to the file system, so they will have to change the CSS file using the admin panel. How to do it? Is there any plugin that allows to change CSS files?


get_image_tag filter not working

I'm trying to get the custom field data off an attachment and display it following the image tag in a page/post using the get_image_tag filter. I'm using the same function to get the same data and display it on the attachment field as well. That works perfectly using the the_content filter so I know the function is working ok and the data is being stored and retrieved. I feel like I'm missing something really obvious. Based on the few other questions I can find about the get_image_tag filter, it seems like there's either something buggy about its implementation or it doesn't run where it seems like it should. I can't even get it to append a string to the resulting $html variable and I don't get an error with wp_debug = true either. The code is on Pastebin at http://pastebin.com/VRcEyYBh.


adding custom script to functions file

I have a problem adding a custom script to my functions.php file:               add_action('wp_print_scripts', 'load_AJAX_URL__');     function load_AJAX_URL__() {         wp_localize_script( 'ajax_URL', 'MyAjax', array( 'ajaxurl' => admin_url('admin-ajax.php') ) );     }      Why is not working? any ideas?


Modular CSS and JS in Child Themes

Let's assume that twentythirteen/shortcodes/ exists and inside are folders with shortcodes. 1 folder = 1 shortcode. Each shortcode has: 1 PHP file, 1 CSS file, 1 JS file. twentythirteen/shortcodes/load.php exists that does `scandir()` and `wp_enqueue_script()` for each JS and CSS file. Furthermore, it has an option to generate twentythirteen/shortcodes/style-cache.css and enqueue only this one (or all JS and CSS files individually). The structure described above makes it very neat and modular but this will not work with Child Themes? Is there any way to make it work like that? It makes a lot of sense to have 1 folder with 1 CSS file, 1 JS file and 1 PHP file for each shortcode, don't you think?


Including style.css in Child Theme

Twenty Thirteen uses `wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() );` in functions.php. Wheter I use it or not use it in twentythirteen-child/functions.php the style.css from Child Theme is loaded (it is always loaded) and style.css from parent theme can never be loaded. This is an exception to other files added via `wp_enqueue_style()`, right? It doesn't behave like all the other scripts and style files that are added with `wp_enqueue_script()`. So, I can't load parent's style.css in the child theme other than via `@import`?


New custom menu created. how to apply it?

i have a childtheme from twentyeleven, i created a 'inicio' (name) custom menu, ![enter image description here](http://i.stack.imgur.com/GdWyS.jpg) how can I apply it? tried:               <?php wp_nav_menu( array( 'theme_location' => 'inicio' ) ); ?>      but not working (not even change visible) EDIT Trying now: header.php: (child) * * *               <?php //wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>     <?php wp_nav_menu( array( 'theme_location' => 'inicio' ) ); ?>      functions.php (child)               function register_my_menus() {     register_nav_menus(array('inicio' => 'Inicio Menu'));     }      And still seeing 'default' navigation menu


If your blog was an app on Facebook

If you were to turn your blog into a Facebook app, what features would it have? What would the UI look like? What are the significant dealbreakers you'd need to satisfy to extend your blog to a social networking platform? I'm marking this as a community wiki because I'm not looking for one answer, but for an array of "best practices" that developers should consider when taking their blog online through a social network. One feature/UI element/dealbreaking necessity per answer please.


function to remove 'comments and trackbacks are closed'

Does anyone have a function I can place in my `functions.php` that will remove this? I want to avoid altering the core files. It currently says "Both comments and trackbacks are currently closed."


How to use a Wildcard SSL with WordPress Network?

I am using WordPress Network to have a network of sites, but as each site needs to be on Facebook they now need to be SSL secured. ( _Note: not just the admin, but the whole front-facing site_ ) I purchased a wildcard SSL certificate for the whole domain, and am using subdomains on the site site.example.com Does anybody have simple steps for achieving this, as I have tried searching Google and not been very successful. Visiting https://site.example.com does not show the blog, instead it shows the server default page. Thanks!


how to display today's most viewed posts order by custom meta "views"

I wanna display **today's most viewed post list** ? order by custom meta = views Is it possible ?


Child Theme - what is the scope of overwriting files?

I noticed that creating twentythirteen-child/archive.php overwrites twentythirteen/archive.php but creating twentythirteen-child/shortcodes/drop- cap/drop-cap.php does not overwrite twentythirteen/shortcodes/drop-cap/drop- cap.php. What does this depend on? Sub-folders aren't overwritten? Similarly twentythirteen-child/shortcodes/drop-cap/drop-cap.css will not overwrite parent CSS file if called through `wp_enqueue_script();`. This means that `wp_dequeue_script()` and `wp_deregister_script()` must always exist for multiple CSS and JS files (and for PHP files in folders)?


how to import custom taxonomy (& terms)

I exported a working Wordpress (v3.5.1) blog content with multiple custom taxonomies (& terms) and whenever I try to import these terms and taxonomy into a new blog the wordpress-importer fails with the message "failed to import ". How can I 1) export and import custom taxonomies? (or) 2) fix the current export & import functions to make it work? ... looks like the terms are not created at all, even less associated to the posts. thanks. feel free to try it with the following export, where the post "hello world!" is associated with terms "parent term2" and "child term 1" of my custom taxony "taxonomy test": https://www.box.com/s/c6n14zjz509u20wuynqr


Trying to create a table/list of my EventBrite course listings

I have an ever evolving list of courses on EventBrite. I would like to display them in two ways on my website:   - On this page: http://agilepainrelief.com/agile-training-overview/certified-scrummaster-training as a table with Date, Location, Price and perhaps Early bird pricing   - On the blog as feed of the next 5-6 events I have upcoming. In this case I need enough control of the formatting to put my CST seal (a logo of sorts) above the list.   - Added bonus the table is filtered by event type so as I add more training types a table on each page only displays the correct one.  I've got no problem paying for a plugin that can actually do this, but so far can't find one. Any ideas? Lost in Wordpress


Change default admin page for specific role(s)

I was wondering if anyone knew of a plugin or a way programmatically to change the the default admin page for a specific user/role? I have a master panel page for my plugin currently setup with custom roles and permissions for the plugin using the Members Plugin and would like to force users that are in these custom roles to use my master control panel for their dashboard because they don't necessarily need access to the Dashboard. **Minor Edit** : Along with changing the default dashboard for the roles, is there a way to disable the WordPress dashboard? -Zack


Adding javascript files to WordPress and jQuery version

I've been trying to use the recommended method of adding javascript files to WordPress, after reading this http://codex.wordpress.org/Function_Reference/wp_enqueue_script but I'm having a hard time figuring it out... I've added this to my functions.php:               function enqueue_raluk_scripts() {         wp_enqueue_script( 'tinynav-script', get_template_directory_uri() . '/scripts/tinynav.js', array('jquery') );         wp_enqueue_script( 'superfish-script', get_template_directory_uri() . '/scripts/superfish.js', array('jquery') );     }          add_action( 'wp_enqueue_scripts', 'enqueue_raluk_scripts' );      and after looking inside the source code of my site I can see that they're appearing inside the tags. The problem is that those two javascript files require jQuery 1.8.3 to work, and the WordPress built-in jQuery version is newer. How can I go about solving this issue without deregistering (which is a bad practice) the WordPress's default jQuery version? Is there any way to assign a specific jQuery version to be used by certain javascript files? Thanks.


Disable auto hide of the login form on Woocommerce's checkout page

I'm in the process of trying to style a checkout page in Woocommerce and need the login form to be visible all the time when the user is not logged in rather than initially hidden then toggled on and off. What I have discovered is that the login form is generated by Woocommerce's `woocommerce_login_form` function and then hidden on document load by `checkout.js` on line 83 `$('p.password, form.login, .checkout_coupon, div.shipping_address').hide();`. Since this is a core file of Woocommerce and will be overwritten on update I don't want to edit that one line of code but I cannot seem to find any better way of preventing it from hiding the login form. Since this occurs after my own Javascript files I cannot even simply show the form again. Are there any better ways I can try and prevent the form from being hidden?


Symbols such as £ end up being Â in the database

Any posts with symbols such as £ or & or ♥ end up being Â or worse. It doesn't show in the admin panel on the edit post page, but it is saved in the database as Â and shows on the actual live blog as Â too. Here are the relevant tables in the database And the wp-config snippet:               /** Database Charset to use in creating database tables. */     define('DB_CHARSET', 'utf8');          /** The Database Collate type. Don't change this if in doubt. */     define('DB_COLLATE', 'utf8');      Believe me, I have tried **every single** tutorial and tip and suggestion that you can find on Google. I realise it's a UTF8 encoding issue. But my database is UTF8. My wp-config says UTF8. I've used every plugin and SQL snippet to convert my database, tables and all posts inbetween. Not a single thing has worked - I've been at this for 3 weeks now and I'm about to explode. So please... somebody help me!


Create un-removeable user

How can I add a Wordpress user that can't be deleted (at all cost, not even by a superadmin) with some code? I can't find anything on Google about such a _god-account_. This morning a client of our company deleted the main-admin account and deleted all of the websites content. We were able to restore the website with a backup, but i would like to prevent this problem in the future.


How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

I've been combing this site and google for the answer and I've come up completely empty. Basically I want to do exactly what this post asks, but I need a hierarchical taxonomy. The answer given in that post works great, but only with a single level taxonomy. Is it possible to do what I want? I've tried a million things, but none work, at best I can get the right permalinks but they come up 404. To visually illustrate what I want:               /basename/ - ideally a page, but I think this will cause a permalink collision         /basename/top-cat/ - top parent custom taxonomy archive         /basename/top-cat/child-cat/ - child cat custom taxonomy archive          /basename/top-cat/child-cat/grandchild-cat/ - grandchild cat custom taxonomy archive         /basename/top-cat/child-cat/grandchild-cat/post-name/ - my custom post type post      You can do this fine with the built in posts and categories, how do you do it with custom taxonomies and custom post types? I know that you need to use `'rewrite' => array( 'slug' => 'tax-name', 'with_front' => true, 'hierarchical' => true ),` to get hierarchical slugs, which works fine on the archive pages, but the custom post type posts come up 404. If I remove the `'hierarchical' => true` part then the posts work, but I lose the hierarchical urls (only /basename/grandchild-cat/post-name/ works). So, any solutions? Thank you so much, this has been driving me nuts for about 3 weeks now.


alt attributes not showing on pages

I have downloaded a wordpress theme called livepuse, and unfortunately the alt tags are not showing on portfolio pages for my images. The website is as follows: http://vitul3ddesigns.com/project/listed-buildings/ the code snippet from the theme is as follows:
                                                     <?php                                                         foreach ($images as $att) {                                                             // get image's source based on size, can be 'thumbnail', 'medium', 'large', 'full' or registed post thumbnails sizes                                                             $src = wp_get_attachment_image_src($att, 'full');                                                             $src = $src[0];?>                                                                                <img src="                                                                     <?php if($rscript == 'TimThumb'){ ?>                                                                         <?php bloginfo('template_directory');?>/scripts/timthumb.php?src=<?php echo $src; ?>&w=70&h=40&a=t&q=95&zc=1                                                                      <?php } elseif($rscript == 'PHP Thumb'){ ?>                                                                         <?php bloginfo('template_directory');?>/phpThumb/phpThumb.php?src=<?php echo $src; ?>&w=70&h=40&q=95&zc=1                                                                      <?php } elseif($rscript == 'Disable Resize Script'){ ?>                                                                         <?php echo $attachment[0];?>                                                                     <?php } else{?>                                                                         <?php bloginfo('template_directory');?>/scripts/timthumb.php?src=<?php echo $src; ?>&w=70&h=40&a=t&q=95&zc=1                                                                      <?php }?>                                                                          " alt=""/>                                                                                <?php                                                         }                                                         ?>
      Thanks for your help in advance...


Activity feed on admin dashboard

Is it possible to create an activity feed for a user on the WordPress admin dashboard for the activity on that blog? e.g. "Admin published a post - 12:00 Jan 12, 2013" "User2 updated page 'xyz' - 16:35 Jan 10, 2013" "New user 'User2' created - 09:06 Jan 9, 2013" etc. Are there any plugins that would collect data like this so that I can output it with PHP or is there a native WordPress way to do this?


Real time Duplicate title check

On my website there are a lot of authors and they are all writing about italian 'scene' so sometimes it happens that two of them write the same post or use same title so what I'm looking for is a way to prevent duplicated posts using title comparison. Something like here on stackexchange or that is Built in vBullettin and Data Life Engine. Is there any tutorial, example or even one of you who can help me achieve this?