Custom fields not displaying on front end

I've read a ton of tutorials and articles and searched for days now, but I still can't seem to get my custom fields to display in the loop and I could use a hand. First off, I definitely have the custom fields enabled and they are taking data. When I edit a post (I'm using the More Fields plugin), I can see the native custom fields boxes on the post, and the data is loading from the database. I am creating a child theme for Twenty Eleven, which is otherwise working beautifully. When I try to insert the               <?php echo get_post_meta($post->ID, 'details', true); ?>       code into the loop, i get no response. I'm putting it on the index.php template. 'details' is the name of the custom field key I'm trying to display. Right now, the pertinent bit of code I'm using is this:               <?php while ( have_posts() ) : the_post(); ?>                     <?php get_template_part( 'content', get_post_format() ); ?>                     <?php echo get_post_meta($post->ID, 'start_time', true); ?>                 <?php endwhile; ?>      Alas, the data is not showing up on the front end. Does anyone have any idea why this isn't working? It seems like such a simple thing and I am a bit confused as to why the Twenty Eleven theme doesn't have something built in to handle custom fields. I can post other bits of code or whatever if it's needed for further troubleshooting. Thanks in advance! **Just a follow up:** I tried putting a basic
<?php echo "this is working" ?>
         inside the loop and that didn't work either. something is definitely screwy here. i've got the index.php inside the child theme folder, and the posts are definitely posting and displaying on the page. and that bit of code works perfectly if i put it inside the footer. In case it would help, here's the link to my dev version: http://sandbox.littleoracle.net/starseed/?p=291


I want to enable facebook connect how to do this?

I do not allow users to login to my blog, but I would like to enable facebook connect for those who do not want to enter their details in the comments fields all the time. How should I start doing it? Enable on wordpress settings user logins, when implement facebook comment and thats it?


Benefits or Problems for using Sub-Directory vs Sub-Domain install of WP Network

Reading through the documentation you have the ability to setup a WP Network in two ways, Sub-Domains and Sub-Directories. The only explanation they give you is **Sub-directory sites** > It works with the use of the mod_rewrite feature on the server having the > ability to read the .htaccess file, which will create the link structure. > > If you are using pretty permalinks in your blog already, then subdirectory > sites will work as well. **Sub-domain sites** > It works using wildcard subdomains. You must have this enabled in Apache, > and you must also add a wildcard subdomain to your DNS records. (See Step 2 > how to set up.) > > Some hosts have already set up the wildcard on the server side, which means > all you need to add is the DNS record. > > Some shared webhosts may not support this, so you may need to check your > webhost before enabling this feature. I'm looking to find if there is a performance, maintenance or other benefit to use one over the other.


Correct way to serialize the data of options table?

I am writing a plugin and it require around 15 different options so I am using php serialization. I'm doing it by an array and update option with php serialize functions. but when I access it from `/wp-admin/options.php` I'm able to see the raw data but while as core wordpress options are locked mentioned `SERIALIZED DATA`. I want to implement something like this.


Problems after transfering WP

After transfering my Wordpress to a new domain I can't add new things like images to post or even "text field" to widget area. I see only white blank page after that actions. Everything else looks normal. Please help me! :( PS. I've changed everywhere old ulr's to new domain url.


Allow Users to Choose Pagination or Next/Previous (Combine)

I'm building a themes option panel and want users to be able to choose between Next/Previous links or pagination in my archives and homepage. I need help combining the two functions below (pagination and next previous) to create a function which chooses based on the user's selection. I figure the function I add to the options panel will look like this:               array( "name" => "Paginate or next/previous links?",         "desc" => "Choose your option",         "id" => $shortname."_next_prev_or_paginate",         "type" => "select",         "options" => array("Next/Previous Links", "Pagination"),         "std" => ""),      Here's how I'm calling the pagination:               <?php     global $wp_query;          $big = 999999999; // need an unlikely integer          echo paginate_links( array(         'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),         'format' => '?paged=%#%',         'current' => max( 1, get_query_var('paged') ),         'total' => $wp_query->max_num_pages     ) );     ?>      Here's how I call next/prev links:               <?php previous_posts_link ('Newer') ?>     <?php next_posts_link('Older') ?>


Create multiple Search functions for posts / custom post types and everything

I'm currently working on a search function in a wp site. The plan is to have a search function on the news page which just searches posts. I'm achieving this by adding the below to my functions.php file:                  /* search just posts */     function SearchFilter($query) {       if ($query->is_search) {       $query->set('post_type', 'post');     }     return $query;     }           add_filter('pre_get_posts','SearchFilter');      which works fine. BUT. I also need to create a search on a custom post type listing - for just the custom posts and also one for the entire site to live on the 404 page. Any ideas how to go about this greatly appreciated?


Function in functions.php by url

I want to use wordpress content in external mobile app. I need an URL address to get content from function located in `functions.php` for example:               function test()     {          return 'it works';     }      What I need is an url address (`http://example.com/something`) which will return a value from function test. I hope that I wrote it clearly. Sorry for my language mistakes.


In the code below (from my functions.php), I'm attempting to create an array of items from the wp_postmeta table where the meta_key is "_wp_attached_file". I'm getting an error: Fatal error: Call to a member function query() on a non-object What's wrong with the query?               $excludeImages = array();     $excludeImages = $wpdb->query("SELECT meta_value                                    FROM $wpdb->postmeta                                    WHERE meta_key = '_wp_attached_file'");          array_push($excludeImages);


"Headers already sent" while trying to add a CSS file to my login page?

Every tutorial I've seen on this subject is out of date, so I'm hoping someone here can help me. I want to style my wp-login.php page with a CSS file. But I'd like to do it in a way that won't get overwritten when Wordpress is updated. From what I can tell, based on the tuts I've read, the best way it to add it using a function in my themes functions.php file. Unfortunately, the code that people have suggested using just doesn't work for me. Here's the code that I've added.               <?php     function custom_login() {     echo '<link rel="stylesheet" href="wplogin/wplogin.css" />';     }     add_action('login_head', 'custom_login');     ?>      It does include the stylesheet like I want, but unfortunately I get this error on my page. > Warning: Cannot modify header information - headers already sent by (output > started at /home/skyyprod/gointrigue/sandbox/wp- > content/themes/rockwell_v1.6/functions.php:899) in > /home/skyyprod/gointrigue/sandbox/wp-login.php on line 353 > > Warning: Cannot modify header information - headers already sent by (output > started at /home/skyyprod/gointrigue/sandbox/wp- > content/themes/rockwell_v1.6/functions.php:899) in > /home/skyyprod/gointrigue/sandbox/wp-login.php on line 365 What am I doing wrong?


domain mapping confused about sunrise

When i try to access my domain mapping page it asks me to move the line define('sunrise', 'on') above the last require_once line in the wp-config file. It is already above this line. I tried moving it higher and even to the top of the file(below the opening I recognizes if i remove the line alltogether (asks me to uncomment the line or add it if it is missing) so I know It is not looking at some other file. What could cause this behavior? http://pastebin.com/wTWhxPjj


Automatically add a page to menu

I write a lot of content on a daily basis, and I have a lot of menus, submenus etc. I don't want to use the menu gui each time I create a new page/article.   Is there _any_ plugin or way of automatically putting the pages into the specified submenus?


Multiple Child Themes

I have a quick question: Is it possible to have multiple child themes activated at once? I need to have many different page templates activate at once. If it's not possible how can I go about it?


Submit To PDF in WordPress

Is there a plugin or something that creates PDF files from a entered by the user form data, when it clicks on the submit button?


Pass parameter to the upload_dir filter

I'm trying to figure out a better way to pass a parameter to the function I am using with the upload_dir filter. Currently I have only gotten it to work by using sessions and/or cookie that I erase after I use them. I have a URL like the following: /wp-admin/admin.php?page=my- plugin.php&parameter=apple I want to upload the file into a directory called /apple/ (inside of the default upload directory) so that I can better categorize the images. This may be too much info, but figured it might help understand my end goal. I built out the page in the plugin using the following so that I could use the media uploader from there. This basically just lets you pick images and once you click 'insert' it drops the image IDs as a comma sep list into a hidden variable.               $('#uploadGalleryButton').click(function(e) {         e.preventDefault();              //If the uploader object has already been created, reopen the dialog         if (plugin_gallery_uploader) {             plugin_gallery_uploader.open();             return;         }              //Extend the wp.media object         plugin_gallery_uploader = wp.media({             multiple: true         });              plugin_gallery_uploader.on('select', function() {             selectedImages = '';             plugin_gallery_uploader.state().get('selection').each(function(item){                 selectedImages += item.id+',';             });                  selectedImages = selectedImages.slice(0,-1);             $('#imageList').val(selectedImages);         });              plugin_gallery_uploader.on('open',function() {           var selection = plugin_gallery_uploader.state().get('selection');           ids = $('#imageList').val().split(',');             ids.forEach(function(id) {               attachment = wp.media.attachment(id);               attachment.fetch();               selection.add( attachment ? [ attachment ] : [] );             });         });              //Open the uploader dialog         plugin_gallery_uploader.open();     });      I had found the media_upload_form_url filter, and I figured perhaps I could append the parameter name/value to the form URL and pass it along in that manner, but I can't seem to get it to work (or perhaps it doesn't even work to override what I think it does).               add_filter('plugin_upload_form_url', 'plugin_upload_form_url', 9);          function plugin_upload_form_url($form_action_url, $type) {         return '/test/';     }      If I run the above it doesn't seem to alter the upload form URL. Am I misinterpreting what that filter is supposed to do, or am I using it incorrectly? That filter is defined in /wp-admin/includes/media.php Thanks so much!   Levi


Custom post type thumbnail / Media Library WP_DEBUG notice

My custom post type thumbnail appears to be working correctly. However, when I return to edit one of my species profiles (in the Admin area, not talking about the front-end here), the following text scrawls directly above my featured image in its meta box:               Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537          Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 537          Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543          Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 543          Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550          Notice: Uninitialized string offset: 0 in /home/my/domain/public-facing.com/public_html/wp-includes/media.php on line 550      I know I can have these messages ignored by changing `WP_DEBUG` but I'm not willing to do that at this stage (still developing the CMS). ![Error screenshot](http://i.stack.imgur.com/d0ewB.png) **EDIT** The only code I'm using to achieve this feature is this line in my plugin: `'supports' => array('author','thumbnail','excerpt','comments')` .. and this line in my theme's functions.php: `add_theme_support( 'post-thumbnails', array( 'post', 'species' ) );` ** EDIT 2 ** The error is actually occurring on my Media Library page too: ![Media Library error](http://i.stack.imgur.com/bt0X5.png) ** EDIT 3 ** Here is the code from `media.php`. Lines 537 to 550.                   if ( ( $data['width'] == $size[0] && $data['height'] <= $size[1] ) || ( $data['height'] == $size[1] && $data['width'] <= $size[0] ) ) {             $file = $data['file'];             list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size );             return compact( 'file', 'width', 'height' );         }         // add to lookup table: area => size         $areas[$data['width'] * $data['height']] = $_size;     }     if ( !$size || !empty($areas) ) {         // find for the smallest image not smaller than the desired size         ksort($areas);         foreach ( $areas as $_size ) {             $data = $imagedata['sizes'][$_size];             if ( $data['width'] >= $size[0] || $data['height'] >= $size[1] ) {      ** EDIT 4 ** This error also appears when I don't use a string format for `<?php the_post_thumbnail( 'indexleft-species-thumb' ); ?>`. If I use `<?php the_post_thumbnail( array(200,200) ); ?>` it will display the same errors as above. ** EDIT 5 ** var_dumps as requested: `array(2) {[0]=> int(80) [1]=> int(60) } array(3) { ["file"]=> string(30) "Amazonas-English-1-288x381.jpg" ["width"]=> string(3) "288" ["height"]=> string(3) "381" } array(2) { [0]=> int(80) [1]=> int(60) } array(3) { ["file"]=> string(30) "Amazonas-English-1-339x450.jpg" ["width"]=> string(3) "339" ["height"]=> string(3) "450" } array(2) { [0]=> int(80) [1]=> int(60) } string(0) ""` `array(2) { [0]=> int(80) [1]=> int(60) } array(3) { ["file"]=> string(45) "Acrochordonichthys-rugosus-2-Nonn-288x140.jpg" ["width"]=> string(3) "288" ["height"]=> string(3) "140" } array(2) { [0]=> int(80) [1]=> int(60) } array(3) { ["file"]=> string(45) "Acrochordonichthys- rugosus-2-Nonn-450x219.jpg" ["width"]=> string(3) "450" ["height"]=> string(3) "219" } array(2) { [0]=> int(80) [1]=> int(60) } string(0) ""` Etc, etc. Any ideas? Thanks in advance,


Child Themes of Non-Wordpress Sanctioned Templates

I have created and used over a dozen Wordpress child themes for various websites. I have downloaded the themes from Wordpress. This time I wanted to use a theme outside of Wordpress' realm. I heard good things about Gridly, actually it was part of Lynda.com's presentation. When I tried to create a child theme for Gridly, I approached it in the same manner. I set up the usual directory and css files with the correct info at the top. I imported all the original theme's style.css. I activated my new child theme. Despite all of that I still can't use custom CSS. In fact, when I use Chromes Dev tools and inspect where an element is getting its styling from, it comes from the parent theme's stylesheets. When I inspect the header it calls for               <?php if ($gridly_color_scheme == 'dark') { ?>         <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?    >/css/dark.css" />      <?php  } elseif ($gridly_color_scheme == 'custom') {  ?>         <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/custom.css"/>      <?php  } else {?>          <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/light.css"/>      <?php  } ?>      I have don't know if that `get_template_directory_uri();` is getting the parent or child theme's uri. Can anyone shed any light on this?


How to display some settings for super admin user only using Settings API

I'm developing a plugin with an options page using the Settings API. I'd like to have one options array stored for my plugin, but on the settings page, I'd only like some of the settings to be visible to admin users, but the full list of settings to be available to the super admin. Is this possible?


Regex in add_rewrite_tag not accepting OR operators?

I am trying to add a custom field to the post permalinks by using a combo of `add_rewrite_tag` and applying a `post_link` filter. What I am aiming for is something like this:               http://example.com/%category%/%mycustomfield%/%postname%      I can manage to get the `%mycustomfield%` as `%psubject%` working by using               add_action( 'init', 'register_rewrite_tag');     function register_rewrite_tag() {           add_rewrite_tag( '%psubject%', '(.*)' );     }       However there are only a set number of `%psubject%` values. But the regex below, which I have tested on regex testers does not work and instead redirects all posts with this link structure to the homepage as `home.php`, not even a `404` or index redirect.               add_rewrite_tag( '%psubject%', '(option1|option2|option3)');      However simply having the regex inputs below will work.               (option1) or (.*)      Such as               http://example.com/somecategory/option1/this-is-the-post-title       will show the correct post. * * * **Edit:** I have found even in Wordpress 3.6 that this issue still occurs. It appears that by using the regex `OR` operator in the `add_rewrite_tag` function only will allow the last option of the `OR` statement, but not any before it. Example:               add_rewrite_tag( '%slugname%', '(orange|apple|strawberry)');      Will only allow 'strawberry', despite the syntax being a standard `OR` statement. This issue **does not occur** in other Wordpress functions such as `add_rewrite_rule`. **Question:** How can I tell the rewrite tag to only allow a set number of strings to be accepted for the permalink?


Wordpress $wpdb no result

I have the following code in my functions.php               $code = 'EUR';     global $wpdb;     $query = 'SELECT * FROM ';     $query .= $wpdb->get_blog_prefix() . 'fxbase ';     $query .= 'WHERE code= '.$code;     $data = $wpdb->get_row( $wpdb->prepare( $query ), ARRAY_A );      The problem is the above query does not give any result. Just to test the following query in mysql is working fine:               SELECT * FROM `1621_fxbase` WHERE `code` = 'EUR'      Not really able to figure out what is the issue here.


'Show on screen' for custom taxonomies does not save

I have noticed that on the admin screen for viewing custom taxonomies that WordPress does not seem to save the 'show on screen' screen option. Upon changing it and clicking apply, the screen reloads and the value is back to 20. This does not occur with the WordPress built-in categories and tags. Only custom taxonomies. The other screen options (which columns to show/hide) behave as expected. Have I unearthed a bug, or I am expected to implement this option (or have I neglected an option when registering the taxonomy) ? **EDIT** I have made the a test plug-in, here is the code. I have tested this on WP3.3, TwentyEleven theme.               <?php     /*     Plugin Name: Test Plugin     Version: 1     */          add_action( 'init', 'create_Test_taxonomies', 0 );     function create_Test_taxonomies() {       $category_labels = array(         'name' => _x( 'Test Categories', 'taxonomy general name' ),         'singular_name' => _x( 'Category', 'taxonomy singular name' ),         'search_items' =>  __( 'Search Categories' ),         'all_items' => __( 'All Categories' ),         'parent_item' => __( 'Parent Category' ),         'parent_item_colon' => __( 'Parent Category:' ),         'edit_item' => __( 'Edit Category' ),          'update_item' => __( 'Update Category' ),         'add_new_item' => __( 'Add New Category' ),         'new_item_name' => __( 'New Category Name' ),         'not_found' =>  __('No categories found'),         'menu_name' => __( 'Test Categories' ),       );              register_taxonomy('test-cat',array('post'), array(         'hierarchical' => true,         'labels' => $category_labels,         'show_ui' => true,         'query_var' => true,         'public'=> true,       ));     }


the_post_thumbnail not resizing

I'm using the following code:               <?php if (the_post_thumbnail()) : ?>         <div class="thumbnail">         <?php the_post_thumbnail('thumbnail'); ?>         </div>     <?php endif; ?>      But the thumbnail is appearing full size. Same applies if I use `(array(200,150))`. My "Media" settings are set correctly (thumbnails at 288 max width, 500 max height); I've checked the `uploads` directory to see if the images have been resized and they have. Any ideas?


How to change default position of WP meta boxes?

Im wondering if there is a way to change the default position of Wordpresses meta boxes such as "featured image" for custom post types without having to drag them manually? **Example:** ![Meta Box Positioning Example](http://i.stack.imgur.com/SXwOO.jpg)


Getting the_excerpt to link to child pages

I'm using the Twentyeleven `'continue reading'` function for my excerpts               function twentyeleven_continue_reading_link() {     return ' ' . __( 'Read more', 'twentyeleven' ) . '';     }      This works fine until I pull it in to link to a child page. The 'Read More' links to the Parent page only. How can I get it to pick up the permalink of my child pages as well?


What is a good resource to find out about making custom walkers?

Custom walkers seem to be a poorly-documented area of WP. Online tutorials focus on styling the output, not on directing the walker to go where you want it. I am reading the code, but I wonder if there's a good resource I'm missing. If you know about walkers, how and where did you learn about them?


Pull comments from one page/post into another page/post?

I am creating a facebook app via wordpress but some how need to pull the comments off my homepage and insert them onto another page, essentially what I am trying to do is duplicate the homepage with a different url/page name. I have mananged to do so easily but I need the comments as well. Thanks a tonne to anyone who can help in advance!


Unable to apply selective loading

I wanted to get rid of unnecessary calls in my header. I would like a plugin 'wizylike' to load only on 'posts', nowhere else ( archives, pages etc.). I have taken a hint from this thread on how to load plugin selectively and worked out a little code that goes to functions.php.               function remove_wizy() {             remove_action('init', 'wizylike_init');             remove_action('wp_head', 'wizylike_head');             remove_action('wp_print_scripts', 'wizylike');             remove_action('wp_print_styles', 'wizylike');     }          if( !is_single() ) {             add_action('wp_head', 'remove_wizy');         }      **Problem** : Plugin is still printing the scripts across all the pages in the header. Either I am not able to identify the right handle or am executing it wrong. I have tried many variations and failed so I thought will ask here now. Here is the code of the plugin's loader.php.               // constants paths     define('WL_PATH', dirname(__FILE__));          // constants URIs     define('WL_URI', get_bloginfo('wpurl') . '/wp-content/plugins/wizylike');     define('WL_CSSURI', WL_URI . '/css');     define('WL_JSURI', WL_URI . '/js');     define('WL_IMGURI', WL_URI . '/images');               // Calls database global     global $wpdb, $wl_tablename;               // Combines default db tables prefix with our newly tabel name     $wl_tablename = $wpdb->prefix . 'wizylike';               // includes plugin files     require_once(WL_PATH . '/widget.wizylike.php');         // Sidebar widget               // Runs when the plugin is activated     function wizylike_activate() {         global $wpdb, $wl_tablename;              if (!empty($wpdb->charset))             $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";                  // run the SQL statement on the database             $wpdb->query("CREATE TABLE {$wl_tablename} (                                 id BIGINT(20) NOT NULL AUTO_INCREMENT,                                 post_id BIGINT(20) NOT NULL,                                 ip_address VARCHAR(25) NOT NULL,                                 user_id BIGINT(20) NOT NULL,                                 like_status VARCHAR(25) NOT NULL DEFAULT 'like',                                 PRIMARY KEY (id),                                  UNIQUE (id)                                 ){$charset_collate};");                  $wpdb->query("ALTER TABLE `$wpdb->posts` ADD `like_count` BIGINT( 20 ) NOT NULL DEFAULT  '0'");              update_option('wizylike_capabilities', 'users-only');         update_option('wizylike_colour', 'red');         update_option('wizylike_style', 'style_1');         update_option('wizylike_like_txt', 'Like?');         update_option('wizylike_unlike_txt', 'Unlike!');         update_option('wizylike_widget_txt', 'Likes');               }     register_activation_hook(__FILE__, 'wizylike_activate');               // Runs when the plugin is deactivated     function wizylike_deactivate() {         global $wpdb, $wl_tablename;              $wpdb->query("ALTER TABLE `$wpdb->posts` DROP `like_count`;");         $wpdb->query("DROP TABLE IF EXISTS {$wl_tablename};");     }     register_deactivation_hook(__FILE__, 'wizylike_deactivate');               // register functions     add_action('admin_menu', 'wizylike_settingspage_create');     add_action('init', 'wizylike_init');     add_action('admin_init', 'wizylike_admin_init');               // settings page create     function wizylike_settingspage_create(){              if (isset($_POST['wizylike_save'])) {             // $wizylike_settings['wizylike_capabilities'] = $_POST['wizylike_capabilities'];             $wizylike_settings['wizylike_unlike_txt'] = $_POST['wizylike_unlike_txt'];             $wizylike_settings['wizylike_like_txt'] = $_POST['wizylike_like_txt'];             $wizylike_settings['wizylike_colour'] = $_POST['wizylike_colour'];             $wizylike_settings['wizylike_style'] = $_POST['wizylike_style'];             $wizylike_settings['wizylike_widget_txt'] = $_POST['wizylike_widget_txt'];                  foreach($wizylike_settings as $name => $val) {                 if(isset($_POST[$name])) {                     update_option($name, $val);                 }             }                  if(isset($_POST['wizylike_capabilities'])) {                 update_option('wizylike_capabilities', 'users-only');             } else {                 update_option('wizylike_capabilities', 'all');             }                  header("Location: options-general.php?page=wizylike&saved=true");             die;         }              $page = add_options_page( __('WizyLike', 'wizylike'), __('WizyLike', 'wizylike'), 'manage_options', 'wizylike', 'wizylike_settingspage');         add_action('admin_head-' . $page, 'wizylike_adminhead');         }               // wizylike front-end init          function wizylike_init(){              // includes main class         require_once(WL_PATH . '/class.wizylike.php');              // includes template tags for ease of usage         require_once(WL_PATH . '/template-tags.php');              // adds necessary stylesheets to wp_head         wp_enqueue_style('wizylike', WL_CSSURI . '/wizylike.css', false, '1.0', 'screen');              // adds necessary javascripts to wp_head         wp_enqueue_script('jquery');         wp_enqueue_script('wizylike', WL_JSURI . '/wizylike.js', false, '1.0', false);     }               // wizylike back-end init     function wizylike_admin_init(){         // adds necessary stylesheets to wp_head         wp_enqueue_style('wizylike-admin', WL_CSSURI . '/admin.css', false, '1.0', 'screen');              // adds necessary javascripts to wp_head         wp_enqueue_script('wizylike-admin', WL_JSURI . '/admin.js', false, '1.0', false);     }               // wizylike back-end head     function wizylike_adminhead(){          }               // wizylike front-end head     function wizylike_head(){         $js = '<script type="text/javascript"> var wizylike_url = "' . WL_URI . '"; </script>' . "\n";         echo apply_filters('wizylike_head', $js);              do_action('wizylike_head');     }          add_action('wp_head', 'wizylike_head');          // wizylike settings page callback     function wizylike_settingspage(){         require_once(WL_PATH . '/wrap.php');     }


How to update to WordPress 3.6 and not lose my website's design

I'm using WordPress 3.5 now, but I want to upgrade to WordPress 3.6. How I can do this? And how can I customize my posts, comments types?


How to order query by numeric meta value?

I cannot order my query by meta value by numbers, and ordering by post order does not work too. This is my code:               <?php     $args = array(           'posts_per_page' => '-1',             'post_type' => 'post',             'order'     => 'ASC',             'meta_key' => 'nda_cf3',             'orderby'   => 'meta_value_num', //or 'meta_value_num'          );              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();         echo '
ID, 'nda_cf3', true).'">'.get_the_title().''.'
'.get_the_content().'

';              endwhile;        ?>


Category.php loads first before page.php?

I've got a problem with the following: I made a category called app-functions, when viewing my domain.com/app- functions/ it opens up the category-app-functions.php instead of page-app- functions.php. Does anyone know why this happens? Also.. with the view of SEO, page.php is more important then category.php.. right?


Hide <sidebar> if subpages are shown

I have this code to show subpages in everypage.               <?php $parent = $post->ID; ?>           <?php query_posts('posts_per_page=15&post_type=page&post_parent='.$parent);      while (have_posts()) : the_post();     ?>          <?php $image_thumb = get_post_meta($post->ID, 'image-thumb', true); ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
               <?php     $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' );     ?>     <div class="subpages-img" style="background: url(<?php echo $src[0]; ?> ) no-repeat center !important; height: 400px; width: 150px;">     <?php the_post_thumbnail(); ?>

     <?php endwhile; ?>      Can I somehow do the following: If this code is used/there are subpages in a page then dont show sidebar, if there are no subpages, then show sidebar?


How to create a theme that can be updated by people using the theme on their site

I'm thinking of starting to create themes to sell on Themeforest and i'd like to have my themes be updatable in the themes section under appearance. How is that done ? is there some repository that you have to use to submit your theme ? does it happen just by placing you theme on wordpress.org ?


Advanced Custom Fields Plugin - Images not displaying

I am using the ACF purely so the user can upload images to a predefined location and have assigned the page rules accordingly. Everything seems to be fine on the WP back-end, with the three images uploaded to the fields. However, on the font end, nothing apart from blank box is appearing at all where the images should be. Looking at the source that WP is outputting, there is only blank code:                     This is the loop I am using:               <?php query_posts("posts_per_page=1&post_type=page&page_id=168"); if (have_posts()) :       while ( have_posts() ) :        the_post(); ?>

<?php the_title(); ?>
     <?php the_excerpt(); ?>     <img src="<?php the_field('image_1'); ?>" class="middle" alt="image1"/>     <a href="<?php the_permalink(); ?>" class="button">View More
      <?php endwhile; ?>                    <?php else: ?>                    <?php endif; ?>         <?php wp_reset_query(); ?>


get post id using custom filed value

I'm having custom field "prime" with values yes or no. I want to get the post id's with selected value " **Yes** ".How can i get that. Thanks in advance


All posts display default index.html

I am setting up a wordpress blog on a Ubuntu LAMP with ispconfig 3 and freedns.afraid.org. I have everything set up, can log in to domain/wp-admin to create posts, etc. But the blog views as the "Welcome to your website!" ispconfig page. What should I check to figure out what is wrong? Thanks!


Working with query_posts ( arrays and query strings)

I'm trying to use the search query along with an array of arguments to narrow down search results, but I'm failing horribly. This is what I have so far.               $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;                    $query_string = 's=test&category=wordpress'                $s_array = array(         'post_type' => 'blog',         'caller_get_posts' => 1,          'paged' => $paged,          'meta_query' => array(             array(                 'key' => 'votes_percent',                 'value' => '50',                 'compare' => '>',                 'type' => 'numeric',             )         )     );     $s_query = http_build_query($s_array);     $is_query = '&' . $s_query;     $s_streaming = $query_string . $is_query;       query_posts($s_streaming);      When echoing out $s_streaming I get               s=test&category=wordpress&post_type=blog&caller_get_posts=1&paged=1&meta_query%5B0%5D%5Bkey%5D=votes_percent&meta_query%5B0%5D%5Bvalue%5D=50&meta_query%5B0%5D%5Bcompare%5D=%3E&meta_query%5B0%5D%5Btype%5D=numeric      If I remove the meta_query keys it works, so I'm guessing that is where my problem resides. It works fine like this               query_posts($s_array); //just using the array to filter          query_posts($query_string); //just using the search query     //$query_string = 's=test&category=wordpress';      I'm trying to build the string to query, because this fails.               query_posts($query_string . $s_array); //using both      Can anyone point me in the right direction?


Custom message when wordpress updates are available

Just a quick question to see if anyone has done this before, is there a function that I can use to add a custom message to the "Wordpress XX is available" ![Update Notice Image](http://i.stack.imgur.com/EwGgg.png) Recently, I've had clients updating their own site and making a right mess of things, especially with third party plugins. I just want to throw a notification on saying how updating could cause issues, please contact me first.


Add Previous/Next Buttons to CPT Single Pages Only

I'm working with a site that is displaying a portfolio CPT on the home page in a "Grid Loop." On the single pages, i'd like to add Previous & Next Item buttons. I thus added this code:               function custom_post_navigation()     {     ?>

                 <?php previous_post_link('%link', 'Previous Item'); ?>

                 <?php next_post_link('%link', 'Next Item'); ?>

     <?php     }          add_action('genesis_before_post_title', 'custom_post_navigation');      On the site Safety Warehouse It now displays the links properly on the single item pages, but It is also displaying Previous and Next buttons on the home page as well. How can I remove them from the home page?


Create posts under certain page

I am a wordpress newbie and wonder whether this is possible; I used wordpress to create a website with different pages and subpages. Now I would like that new posts appear only under certain page, how can I do this? I tried but new posts always go under main page


Options and template changes not updating

Few months ago I had a problem with updating changes on wordpress, all changes were registered inside WP but in front end no changes were shown even if I change something manually on theme as footer or sidebars. I fixed that changing the htaccess because the htacces had written a different domain like `blogonline` instead `multionline.com`.               RewriteEngine off     <IfModule mod_suphp.c>         suPHP_ConfigPath /home/mainuser/public_html/blogonline.com/php.ini         <Files php.ini>             order allow,deny             deny from all         </Files>     </IfModule>      Now I have the same problem but... all data is correct including this lines for WP               # BEGIN WordPress     <IfModule mod_rewrite.c>     ErrorDocument 404 /index.php?error=404     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     #RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Any idea to fix it?


Turning the read more link into a button

I want to change the read more text to translate it and add a background to it to make it look more like a button. As it is done here: http://unaventananuevayork.com/. I´m using ultimatum theme and would appreciate answers for dummies (where to paste the code, etc), as I´m a beginner. The site I want to do this in is: http://test.creatiburon.com/ Many thanks :)


TinyMCE Editor Set Default Tab

I removed the tabs from the WP editor using               wp_editor('', 'some-id', array('quicktags' => false) );      But sometimes when the page loads the TinyMCE field loads with the Text tab selected: ![](http://i.stack.imgur.com/gfB8r.png) Rather than the HTML tab: ![](http://i.stack.imgur.com/XNOh0.png) Is there a way maybe with JS / JQuery to make sure the tab is always the visual HTML tab? Already tried:               add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') );


Internal linking to posts permalink fail because of spaces and stripe at postname

I have written a function which outputs a tag in a textarea in which people can link internally to other posts on the website. This works like a charm except with using a `postname permalink structure`... For example: people link to a post called **'Hello World'** by writing **(link: Hello World)**... The link to the post, however, is: http://somesite.com/ **hello-world** So what happens? I get a 404-error because it looks like _Hello World_ does not exist, but it does! It has just no stripe between it and uppercase letters... My question is: how do I make it link to the proper post? This is the code I am using:                $content = preg_replace('%\(link: ?(.*?) ?\)%', '(link: $postname_test)', $content);


Need a Plugin to create a registration form for my website?

I need a custom registration page from for my site. I want to take some details from my regular visitor and then finally want these details in a csv or excel file. Is there is a plugin which can do this for me just like we have Contact Form 7 for Contact Page??? This question may seems common but please consider me as i am very new to wordpress.


WordPress as a data intensive web app

I would like to get some opinion about using WordPress as a data intense Web Application, let say like rememberthemilk where a user can have multiple post (task) just in a single day. Or maybe like twitter where one can even have multiple post (twitter) in an hour. Another point is that those web application is open for public, not on a limited group of users. If downloaded and tried P2 theme, as the closest benchmark, but I am not sure how it performs with a large number of users. And the question is;   * is it advisable to create those kind of app in WordPress?   * What are the drawbacks if it is build using WordPress? **Update :** Currently I'm experimenting a custom WordPress theme that can be used a personal finance log. This was started only as wp-ajax experiment. The theme has a front-end upload form, to log each transaction, and put them in the 'budget' (transaction category) and 'account' taxonomy to be queried. Every users have their own main budget and account custom-post-type with child budgets and accounts. But along this experiment I started to wonder whether a single WordPress installation is suitable as a private-blog-that-anyone-can-register-to like this. Is it possible to handle large number of users ? And how far can I push a WordPress as an app framework?


Can I exclude a single URL from a rewrite plugin?

I am working on an imported .html site that has been using the .html on pages plugin to rewrite the URLs for inbound link purposes. Now I am trying to integrate it with a subdomain blog (domain.com/blog/) that also needs to maintain inbound links. Everything is setup and working correctly except the blog archive page. The permalinks are set to (/blog/%postname%/) and the URLs are correct for both pages and posts. The only issue is the page set to frontpage (/blog/)is being rewritten to /blog.html/ so links to (domain.com/blog/) are getting a 404. There doesn't seem to be an easy way to exclude the page from the .html rewrite. I tried using a conditional tag, but the plugin hooks to 'init' so it doesn't work. Is there another way to exclude that page from being rewritten? Or is there some other (hopefully simpler) way to achieve a blog archive at (domain.com/blog/)?


How to change database values on theme update

I have a theme released into the wild but have not prefixed the post type appropriately. Yes, I know, it's a shame and I regret it :( So, I am currently using `acme` as the post type name, but I' like to change it to `prefix_acme`. I'm looking for the most appropriate function/hook to rename the post type without losing any data so users will not experience a difference. Can the database values under `wp_posts -> post_type` simply be changed during a theme update? If so, then can the same be done for `wp_postmeta -> meta_key` without losing the `meta_value`?


Does "Custom Post Type" can have page hierarhy option?

I want create "Custom Post Type" that will have next structure: Post (hierarhy level)-(some-post-id) > Post 1-1 => >   >   >           Post 2-2 >           Post 2-3 >           Post 2-4 => >                    Post 3-5 >                    Post 3-6 >                    Post 3-7 >           Post 2-8 >           Post 2-9 >           Post 2-10 >   I need something like "Page attributes": http://s019.radikal.ru/i638/1205/19/d533f543c5f7.png


Set up collaborative site

I 'm setting up a site to allow multiple associations to use it. I ask your help to decide whether it's worth to consider switching to the current 'single site with many plugins' approach, whick feels like a bad hack, to a multisite approach. The requirements are:   * Each association may have multiple users, with different internal roles.    * Users from association must have the ability to edit their own posts, pages and menus, while not being able to modify those from other associations.    * Associations are able to contribute to thir own 'area', but also to shared areas So far, I've come with a normal installation, using categories for each association, and tags to define areas, so they can be shared. I use some plugins to define and modify user roles, and to show content (e.g. sidebar menus) depending on the context: 'User Role Editor', 'Restrict categories' and 'Widget Logic'. The problem is that I still have problems restricting access to pages (because of no categories), menus and anything that does not have a category. Also, it feels like forcing wordpress too far away from its purpose.. I've had a look at the wordpress multisite and seems like that would help solve those problems, but I'm not sure how to implement the shared contents in the main site. What do you recommend? Keep working on the single-site approach or go for multisite? Any plugin suggestions for either case? Thanks!


Wordpress .htaccess rewrite for custom template

I am trying to convert a website to WordPress. The URLs in use are currently in the format: `http://www.example.com/database/44/category/short-item- description.html` To display items that are stored in the database, I have created a page template DatabaseFetch.php and have added a page to WordPress to use this template at address `http://www.example.com/database/` (this can also be access by `http://www.example.com/index.php?p=39`) The template DatabaseFetch.php will have the PHP code to get the ID number from the URL and then use this ID number to get the relevant item details from the database. I am trying to alter the .htaccess file found in the WordPress root folder as I want all URLs in the format of `http://www.example.com/database/44/category/short-item-description.html` to be processed by `http://www.example.com/database/` but I want the browser to display the URL in the format of `http://www.example.com/database/44/category/short-item-description.html` (ie the URL not to change) I have tried many combinations over the last couple days but I cannot get it working. Using the line:               RewriteRule ^/?database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$ /database/ [NC,L]      brings up WordPress 404 page. Using the line:               RewriteRule ^/?database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$ /?p=39 [NC,L]      brings up correct page, but the URL in the browser changes to `http://www.example.com/database/` Does anyone know how I need to alter the .htaccess file below to get the desired results I seek?               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     # RewriteRule ^/?database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$  /database/ [NC,L]     RewriteRule ^/?database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$  /?p=39 [NC,L]     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]          </IfModule>          # END WordPress      I have also tried both lines with flags and no flags and combination of flags but nothing gets the desired result. On a non-Wordpress installation, I have the desired outcome defined by one line in .htaccess               RewriteRule ^/?database/([0-9]+)/?([a-zA-Z0-9_-]*)/?([a-zA-Z0-9_-]*).html$ database.php?id=$1 [NC,L]      The problem with WordPress is that the database page I need is not the physical DatabaseFetch.php file. therefore how do I go about the rewrite? Any help will be very much appreciated.


How do I register a stylesheet inside a WordPress widget?

I'm developing a WordPress widget following Dave Clements tutorial. It works well. Now I want to add some styles to it. I want the styles to be in an extra css file which will be loaded during runtime. I'm calling this function               function myprefix_add_my_stylesheet() {       wp_register_style( 'myprefix-style', plugins_url('mystyle.css', __FILE__) );       wp_enqueue_style( 'myprefix-style' );     }      right before (see Dave's tutorial) "// Widget output //" using the following statement.               add_action( 'wp_enqueue_scripts', 'myprefix_add_my_stylesheet' );      But nothing seems to happen. What am I doing wrong?


CSS not being applied using wp_enqueue_style

I am trying to load my style sheets in my plugin but they are not being called, the javascript files however, are being loaded.               <?php     /**     Plugin Name:      Plugin URI:      Description:      Version:     Author:      Author URI:      **/          define("MPF_PATH", ABSPATH . 'wp-content/plugins/' . basename(dirname(__FILE__)).'/' );     define("MPF_URL", trailingslashit(get_option('siteurl')) . 'wp-content/plugins/' . basename(dirname(__FILE__)) . '/' );                class mpf_plugin{          function crf_user_registration(){         add_action('plugins_loaded', array(&$this, "load_my_scripts"));         add_action('admin_menu', array(&$this,'add_crf_menu_items'));              if(!is_admin()){             add_shortcode('crf_registration', array(&$this, "do_shortcode"));         } else {             //do something else here              }     }          function load_my_scripts(){         if(is_admin()){             wp_register_script('crf_script', MPF_URL . 'includes/js/crf_script.js');             wp_register_style('crf_style', MPF_URL . 'includes/css/crf_style.css');             wp_enqueue_style('crf-style');                  wp_enqueue_script('jquery');             wp_enqueue_script('crf_script');                  wp_localize_script( 'crf_script', 'MyAjax', array( 'MPF_PATH' => MPF_PATH, 'MPF_URL' => MPF_URL,'ajaxurl' => MPF_URL . 'includes/save-layout.php', 'loadPageLayoutURL' => MPF_URL . 'includes/get-layout.php', 'optionsPageURL' => MPF_URL . 'includes/options.php' ));         }     }               function do_shortcode(){              include('crf_form.php');     }               function options_page() {         // HTML code goes here, left out for brevity     }          function custom_dropdown_page(){         // HTML code goes here, left out for brevity     }          function add_crf_menu_items() {         add_menu_page(                 'My Plugin Form',                  'MPF',                  'manage_options',                  'mpf-options',                  array(&$this,'options_page')             );              add_submenu_page(                 'mpf-options',                  'MPF Options',                  'MPF Options',                  'manage_options',                  'custom-mpf-options',                  array(&$this,'custom_dropdown_page')             );     }          }          new mpf_plugin();      The paths are all correct. Any ideas as to what is going on?


Wordpress comments email notification for authors

I'm admin of a question and answers website in WordPress. All users are defined like authors. I have the problem that when I approve a comment ( an answer to a question), the author receives too much personal information ( email address, ip, whois arin, links of: spam it, trash it, approve it, ) of other users by the comments notification email sent by WordPress. Is there a way to modify this email sent to authors?


Redirect all www.xyz.com to www.xyz.com/wordpress?

I have my website working from www.xyz.com/wordpress, but customers should not need to type it all. If they just type www.xyz.com it should take them to www.xyz.com/wordpress.


get_the_title($postID) OR get_the_title()?

I would like to know which could be more performant between these two approaches of getting data of a post   * To use a loop after a `WP_Query($aConditions)` and use functions like `get_the_title()` ... and all the similar functions without passing any parameters   * To call `get_the_title($postID)` with the parameter outside the loop


Get current post id in functions.php

I have a `wp_localize_script()` function in my functions.php where I need to push the current post ID of the current post to a jQuery file. So I was wondering how you can get the current post ID of a post in my functions.php. These are both not working:               global $post;     $post_id = $post->ID;          global $wp_query;     $post_id = $wp_query->get_queried_object_id();


Image resize with image url

I am using **wp_handle_upload()** to allow users to upload the images in back- end and I want to re-size images to a custom size before uploading it. Is there any way without using any plugins or so to achieve this ?


Plugin not installing properly, functions being redeclared

I've installed a plugin (HC custom WP-Admin url) locally and I didn't have any problems. I tried to install it on my server and I get the following error: `Fatal error: Cannot redeclare get_file_description() (previously declared in /home/USERNAME/public_html/wp-admin/includes/file.php:58) in /home/USERNAME/public_html/wp-admin/includes/file.php on line 71` **Please note I DID post an error on that plugin's page.** I'm posting again here because I suspect it isn't specific to that plugin, but rather a permission problem preventing the plugin from being installed properly. Has anybody had a similar problem? The installation claims to be complete, but after the installation, the whole site breaks. I can't even logout. The only way i found to get the site running again is to rename the plugin folder. There's an error generated and WP deactivates the plugin and everything works again.


How to query_post custom posts within default taxonomy?

I'm trying to query_post custom posts. It works very good with custom taxonomy, but not with default "category" taxonomy. I tried using "category_name" and "tax_query", but it doesn't work for me. My code is:                 $c_args = array(       'post_type' => 'product',       'tax_query' => array(            array(                'taxonomy' => 'category',                'field' => 'slug',                'terms' => 'furniture'             )         )     );          // The Query     wp_reset_postdata();          query_posts( $c_args );      I get no results. As I said - it works with custom taxonomy, but I need to use "Custom Permalinks" plugin, which doesn't work with custom taxonomy. Any help appreciated.


Is it possible to change the path of a css file that is registered through wp_enqueue_style()?

The theme I am using already calls the `wp_enqueue_style` function to enqueue a css file. I want to whether it is possible to change the css file path before it is actually outputted on the page. Why I want to do this? Basically, I want to check if it is a dev or prod environment. Based on that I want to include either the uncompressed or compressed file.


Wordpress Theme Problem

Can anyone tell me, why this theme is not working? My Configuration : XAMMP 1.8.1 PHP 5.4.7 Wordpress 3.5.1 After Installing the theme with other necessary plugins and frameworks, I activated the theme. But it notifies me with e message " Your theme does not support Open Theme Framework " http://www.web2feel.com/zenshop/


Fancybox for Wordpress for Signle Media Element

I would like to apply Fancybox for Wordpress plugin to a single media element and disable it for all other media elements. The problem is that by default the plugin applies to all media elements and opens them using Fancybox. How can this be accomplished? Or is there another plugin you would suggest? Link to plugin: http://wordpress.org/plugins/fancybox-for-wordpress/


get_category_parents for custom post type taxonomy

I know that we can get the parent category in normal post type by:               get_category_parents($cat, TRUE, ' » ');      But how can we get the parent category in custom post type? I use this for:               if ( is_category() || is_single() && !is_singular( 'portfolio' ) ) { // Full path links          $category = get_the_category();         $ID = $category[0]->cat_ID;         echo '
'.get_category_parents( $ID, TRUE, '', FALSE ).'
';            } elseif ( is_singular( 'portfolio' ) ) {         $category = get_the_terms( $post->ID, 'portfolio-category' );         $ID = $category[0]->cat_ID;         echo '
'.get_category_parents( $ID, TRUE, '', FALSE ).'
';     }


Increase size of Google Document Site Wide

How do I increase the size of an embedded Google document in Wordpress site wide. Without the need to add css `width="100%" height="800px"` to every iframe.               <iframe src="https://docs.google.com/document/d/1QFvpre76QuZ9xWXGu3FV1hqSlEWcxqln57wbKjku56s/pub?embedded=true"></iframe>      Example: http://www.idolovewords.com/portfolio-item/transcritical-co2-system/


The purpose of the post_date_gmt?

Why do we have 2 date fields in the wp_posts? What's the purpose of the post_date_gmt? When does storing the greenwich time get handy?


In Woocommerce theme need to add custom external link

I am new in Woocommerce plugins and i have requirements that in External/Affiliate product there is one "Product URL" field that is linking in to external url of "Buy now button". Now i want that same url on product images and product name. How can i do it ?


bloginfo('stylesheet_directory') vs. get_stylesheet_directory_uri() and include('file.php') vs. get_template_part()

In my custom theme I'm using `<img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.jpg"/>` to load my custom logo. I'm using a custom sidebar for `front-page.php` and that's why I used `<?php include('sidebar-front.php') ?>` to get it. But when I'm using the 'theme-check' plugin it's suggesting to change the following:   * `bloginfo('stylesheet_directory')` to `get_stylesheet_directory_uri()`   * `include()` to `get_template_part()` So, I did the following:   * `<img src="<?php get_stylesheet_directory_uri(); ?>/images/logo.jpg"/>`, and   * `<?php get_template_part('sidebar-front.php') ?>` But both failed here. The logo doesn't load and the sidebar isn't too. I used `<?php get_sidebar('front'); ?>` and it's working fine. I just want to speculate what the problem with those suggestions? It's WP 3.4.2 here.


Fill custom fields when saving custom post types

I have a Custom Post Type called "Report." It has some custom fields, including the name of the place where the post has been written. I would like that when a user saves (or updates) the post from the admin interface, if he did not fill the place name, the system will fill in automatically on the basis of latitude/longitude (using reverse geocoding). Which hook should I use?


Searching a hook which triggers when deleting a post to get all comments

When deleting a post, all comments associated with this post get the status "post-trashed". I'm searching a hook for this event. Tried these one without success: `comment_approved_to_post-trashed comment_approved_to_trash`


ReWrite rule for files of a previously standalone blog moved to network

A moved a standalone wordpress install to be one of a network, but the possibility to access the uploaded files with the same URL is need to be kept. I'm trying to get the following rewrite rule to work, without success:               RewriteCond %{HTTP_HOST} ^(.*)?domain\.com     RewriteRule ^/wp-content/uploads/(.*)$ /wp-content/blogs.dir/3/files/$1 [L]      What do I miss?


Check if jquery library exist

How to check if jQuery library exist in head tags?               <head>     <script type="javascript/text" src="http://code.jquery.com/jquery-1.6.2.js"></script>     </head>      and if not exist how do I load in head tags the jquery library, I'm doing a plugins and I want to load my plugins script in jQuery and also do able to check if jQuery library exist so my jQuery script will run


I can't access my admin page after changing main url

I have change the main URL of my wordpress theme. I accessed `Admin area => Settings => and change my URL from : www.sampleURL.com to www.sampleURL.com/?page_id=2` and now every time I enter `www.sampleURL.com/wp-admin` i get directed to `www.sampleURL.com/?page_id=2` Please help!


Function is Missing an Action Hook

I have tied an action into a status change, which works on the backend. However,using a frontend button for updating post status does not trigger the action(http://wordpress.stackexchange.com/questions/17794/publish-pending- article-from-front-end-with-a-button), but it does update the post status. So I have this button for updating a post from 'draft to rejected'                    function show_reject_button(){            global $post;                  echo '<form name="front_end_reject" method="POST" action="">                 <input type="hidden" name="pid2" id="pid2" value="'.$post->ID.'">                 <input type="hidden" name="FE_REJECT" id="FE_REJECT" value="FE_REJECT">                 <input type="image" src="https://---.com/images/logo1/sreject.png" alt="reject" title="Reject this reservation" style="background: none !important; border:   none !important;">             </form>';            }              function change_post_status($post_id,$status){           $current_post = get_post( $post_id, 'ARRAY_A' );           $current_post['post_status'] = $status;           wp_update_post($current_post);          }               if (isset($_POST['FE_REJECT']) && $_POST['FE_REJECT'] == 'FE_REJECT'){          if (isset($_POST['pid2']) && !empty($_POST['pid2'])){         change_post_status((int)$_POST['pid2'],'rejected');          }         }      I'd like to thank Bainternet for that code. I have the action of changing a post from draft to rejected tied into a function for changing some post meta.                     add_action ('draft_to_rejected', 'void_payment_hold' );              function void_payment_hold() {               global $post;                $type = get_post_type( $post->ID );                  if( $type == 'tribe_events' ){                      $order_id = get_post_meta($post->ID, 'order', TRUE);                      $current_hold = get_post_meta($order_id, 'hold', TRUE);                      $released_amount = get_post_meta($post->ID, 'amount', TRUE);                      $remaining_hold = $current_hold - $released_amount;                      __update_post_meta($order_id, 'hold', $remaining_hold);                        }                 }      When I execute this on the backend it works, but when I update the post status with the button the function does not execute. Does anyone know why this may be happening? Thanks for your time


Meta function issue

Taking a clue from older WordPress stock themes I created a meta function to display information about each post.               function my_entry_meta() {     // Translators: used between list items, there is a space after the comma.     $categories_list = get_the_category_list( __( ', ', 'ritualHealing' ) );          // Translators: used between list items, there is a space after the comma.     $tag_list = get_the_tag_list( '', __( ', ', 'ritualHealing' ) );          $date = sprintf( '<time class="entry-date" datetime="%3$s">%4$s</time>',         esc_url( get_permalink() ),         esc_attr( get_the_time() ),         esc_attr( get_the_date( 'c' ) ),         esc_html( get_the_date() )     );          $author = sprintf( '%3$s',         esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),         esc_attr( sprintf( __( 'View all posts by %s', 'ritualHealing' ), get_the_author() ) ),         get_the_author()     );          //Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.     ?>
           Posted by --  <?php the_author(); ?>          -- Category --<?php __('%1$s') ?>           -- <?php __('%3$s') ?> --          <?php comments_number( 'no responses', 'one response', '% responses' ); ?>           <?php __('%2$s') ?>
<?php          printf(         $utility_text,         $categories_list,         $tag_list,         $date,         $author     );      }      endif;      For some reason, the category and the date doesn't display. The author name and comment number displays just fine. Am I missing something?


How to add social buttons like facebook and twitter in the footer of a theme?

Hi I own the blog camilamfotografia.com.br and I'd like to add social buttons in the footer or in the navigation menu to link my site to facebook twitter flickr pinterest etc... I have tried without any success, can anyone help me please? Thanks Camila


Conditionals in WP_Query

What I'm trying to do is this: If in the last 7 days someone has added a post in the category 'featured' display it in the loop. Otherwise, display the most commented post from the last seven days. So far I can display the most commented post but I'm not sure how to go about setting up the if/else block or if there is built in functionality in the wordpress core.               <?php                   // retrieve posts from the last seven days              function filter_where( $where = '' ) {             // posts in the last 7 days             $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";             return $where;         }                                        $args = array(                         'posts_per_page' => 1,                         'orderby' => 'comment_count'                         );                              add_filter( 'posts_where', 'filter_where' );                              $the_query = new WP_Query( $args );                              remove_filter( 'posts_where', 'filter_where' );                                        ?>                              <?php if ( have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>                              <?php $do_not_duplicate = $post->ID; ?>                                  <a href="<?php the_permalink();?>">
<?php the_title(); ?>

Published on <?php the_date(); ?> by <a href="<?php echo the_permalink();?>"><?php the_author(); ?><a href="<?php the_permalink();?>"> <?php comments_number(); ?>
                                  <?php the_excerpt(); ?>
                              <?php endwhile; else: ?>                                   <?php endif; ?>                              <?php wp_reset_postdata(); ?>


Some recent plugin updates have failed "Could not create directory"

I have been developing my WordPress site on a WAMPServer on my laptop for a few months, with few problems. In the last few days several (but not all) plugin updates have failed - Specifically IThemes Security, MailPoet Newsletters, TablePress. I can reinstall OK. With the first two I thought it might be something to do with their having changed name, but not TablePress. It is possibly not WordPress, but where do I start to look? I am experienced in application development, but not in the more technical details. I cannot see any answers so far that seem to apply. I have plenty of space on the disk, and no storage limits that I know of. I presume that permissions are not the problem as it all used to work OK, and I do not know that I have changed anything. I don't see how it can be Windows path lengths as the folder names you can see below are short. Apache is 2.4.4, PHP 5.4.12, MYSQL 5.6.12, WordPress 3.9. Any help would be appreciated. Thanks The result of the latest update is: > Update Plugin > > Downloading update from > http://downloads.wordpress.org/plugin/tablepress.1.4.zip… > > Unpacking the update… > > Installing the latest version… > > Removing the old version of the plugin… > > Could not create directory. C:/wamp/www/wp/wp-content/plugins/tablepress/ > > Plugin update failed.


Add different span class to wp nav menu

Here is my html for the menu:

Home

Portfolio

Services

Freebies

About

      & the wp code:               <?php      wp_nav_menu(      array(      'theme_location' => 'primary',     'container_id' => 'main-menu-container',     'menu_id' => 'main-menu',     )      );      ?>      As you can see, the problem is I have different span class added to each list item. & I can not use `link_before` & `link_after`. I have no idea how to add them in `wp_nav_menu`. How can I solve this?


Metabox cloning via Admin Ajax call issue

I've created a fairly simple class for handing the creation of metaboxes within wordpress admin. I've set up the class so that each instance of the class represents an new metabox definition. Each class instance stores its metabox definition as a private class variable, which is used throughout the class for drawing the metabox fields etc. So far, so good. There is a separate class variable which defines if the metabox is repeatable. If it is, the metabox class adds in the necessary actions and javascript to handle the admin ajax call. Now, this call to admin ajax is causing an odd issue. For some reason, the admin ajax call always returns the metabox definition of the first created metabox, regardless of what metabox is actually calling the admin_ajax method. This is how I set up the admin ajax action. The conditional just checks if the metabox supports repeatable elements.               if($this->is_dynamic){                 add_action('wp_ajax_get_cloned_content', array(&$this,'ref_AJAX_get_cloned_content'));               }      Below is my admin ajax call.               public function ref_AJAX_get_cloned_content( ){              check_ajax_referer('get_cloned_content', 'nonce');             $newFormData =  json_encode($this->renderForm($this->m_box['fields']));                  $success_response = new WP_Ajax_Response();             $success_response->add(array(                         'what' => 'mbox',                         'data' => $newFormData,                         'supplemental' => array('fielddata' => $newFormData)             ));             $success_response->send();                   exit;            }      And this is the javascript call to the admin ajax handler.                                   var data = {                             action: 'get_cloned_content',                             nonce: <?php echo wp_create_nonce('get_cloned_content');?>,                           };                                   $.post(ajaxurl, data, function(response) {                             var res = wpAjax.parseAjaxResponse(response, 'ajax-response');                             jQuery.each( res.responses, function() {                                 console.log(this.supplemental.fielddata);                              });                         });      There are no problems calling the ajax method and getting a response, its just getting the actual class instances field data back that is the issue. I don't know why wordpress wont return my class instances variable values from that admin ajax call. Any ideas on why this would be occurring? I can get around it by using a different non admin ajax method to clone the metabox fields, but I'd still like to know why the issue I have is occurring, after banging my head on the wall with it.


get_terms by custom post type

I have two custom post types 'country' and 'city' and a shared taxonomy 'flag'. If I use:               <?php $flags = get_terms('flag', 'orderby=name&hide_empty=0');      I get a list of all terms in the taxonomy, but I want to limit the list to the post type 'country'. How can I do it? * * * ## Using the new solution               <?php      $flags = wpse57444_get_terms('flags',array('parent' => 0,'hide_empty' => 1,'post_types' =>array('country')));     foreach ($flags as $flag) {         $childTerms = wpse57444_get_terms('flags',array('parent' => $flag->term_id,'hide_empty' => 1,'post_types' =>array('country')));         foreach ($childTerms as $childTerm) {             echo $childTerm->name.'<br />';         }     }     ?>      I can't echo $childTerm->name. Why?


Is there a good plugin for an online booking system..?

I need to quote for a job, and I think due to the budget it will need a plugin. I’ve been having a look around online - can anyone recommend me a good quality plugin that allows for a booking system with calendar, and the ability to take card and paypal payments? The website will be for booking short break holidays. Any help, or some push in the right direction would be helpful! Dan


Custom Taxonomy specific to a Custom Post type

I want to create a custom taxonomy which behaves similar to the post type as a category behaves to a the default posts (on the grounds of /%category%/%postname%/ permalink structure) so that the posts in the custom post types are displayed as **www.example.com/custom-post-type/custom- taxonomy-name/post-name** Also I want the category meta box to appear **only** when we add new default post and not when we add a new post in the custom post type and the custom taxonomy box to appear only when we add a new post in the custom post type and not when we add new a default post.


custom field with links

I want to create a custom field, let's say Tickets in which I can store different links for each post. For example: On a post page I have a button called "Buy ticket" which has a specific link, also on another post I have the same "Buy ticket" but with another link and so on ... How can I make this ? Thanks


Content is displayed under admin bar

After updating to 3.4, my admin bar is not pushing down the content in the admin area. In this picture I have scrolled right up to the top of the page: greedy admin bar The problem is that notices get hidden under it. I've tried network deactivating all plugins, but no luck! I COULD just edit the core #adminmenu and #wpbody css to have a top margin of 28px, but I'd like to avoid doing that if possible. Anybody come across this before?


URL Rewrite with Custom Variables

I right now have a custom post type with a url structure like:               example.com/videos/taxonomyname/      I have a custom variable that I am detecting in the template file to switch layout views which works fine but the URLs are setup like:               example.com/videos/taxonomyname/?template=g      I am wanting the URLs to look like               example.com/videos/taxonomyname/g/       Mainly because of pagination is not working properly with `?template=g` when you try and page it sets the URLs as               example.com/videos/taxonomyname/page/1/?template=g       which then returns a 404. I have read some of the past articles. However was unable to get the URLs working properly partly due to the taxonomy name. How can I get this right?


Thumbnail Cropping with add_image_size?

I want my thumbnails on a particular page to be `300px` × `100px`, exactly. Currently, images shrink until they hit the 300 pixel or 100 pixel mark. How do I get the image to crop to exactly 300 × 100 (preferably without image distortion).               // functions.php:     if ( function_exists( 'add_image_size' ) ) add_theme_support( 'post-thumbnails' );          if ( function_exists( 'add_image_size' ) ) {          add_image_size( 'post-thumb', 620, 207, true );         add_image_size( 'home-thumb', 220, 180, true );         add_image_size( 'index-thumb', 300, 100, true );     }     // index.php:     if ( has_post_thumbnail()) the_post_thumbnail('index-thumb');


How to add contents of a custom field to a taxonomy term list?

I have a custom taxonomy term of 'artists' which is the artist's last name and a custom field of 'first_name'. To create a list all all artists with both their first name and last name I am using the following code, but it is printing as two separate lists. Do I have to join tables (never done this) to accomplish this or is there another way to write it so they are all in one list?               <?php while ( have_posts() ) : the_post(); ?>     <?php      $args = array( 'taxonomy' => 'artists' );          $terms = get_terms('artists', $args);          $count = count($terms); $i=0;     if ($count > 0) {         $term_list = '
';         foreach ($terms as $term) {             $i++;                  $termid = 'artists_' . ($term->term_id);             $termfirst = the_field('first_name', $termid);                  $term_list .= '
slug, $term->taxonomy ) . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $termfirst . $term->name . '
';                }         $term_list .= '
';         echo $term_list;     }          ?><?php endwhile; // end of the loop. ?>      The two lists are shown here on the development site


Client Profiles

Looking to find the best approach to creating a client database. Would a plugin be best to achieve the following? My Client Database plugin   * Store personal information and statistics about the client that will be gathered with custom fields and custom forms   * (Admin only) Dashboard Tab that opens a list area (Similar to the Users tab)   * (Admin only) “Add New” feature (Similar to the Users area of the dashboard)   * Once Admin creates a client profile. Admin can assign clients to a User   * Clients assigned to Users displays as User metadata. The clients assigned to Users will be visible in User profiles   * Dashboard widget displaying assigned clients for logged in Users with a link to the clients profile page Is a plugin the solution for this?


get_the_ID() is working on my local development but not on staging server

Great to see a StackExchange for WP! Ok so I'm working on pulling images and dates from piklist custom post types and I got this working on my local, BUT when I move it to WPEngine I get a white page until I take the code out. The date code doesn't throw a blank page but won't pull the dates entered. Can anyone tell me what about this code may be causing this? Thanks in advance! **CODE** **single.php**               <?php while ( have_posts() ) : the_post(); ?>            <?php              $image_ids = get_post_meta(get_the_ID(), 'my_media', false);              foreach ($image_ids as $image)         {                echo '<img src=" ' . wp_get_attachment_image_src($image, 'large')[0]  . ' "/>';              }       ?>            <?php echo get_post_meta(get_the_ID(), 'my_date', true); ?>            <?php get_template_part( 'content', themeblvd_get_part( 'single' ) ); ?>            <?php themeblvd_single_footer(); ?>            <?php if ( themeblvd_supports( 'comments', 'posts' ) ) : ?>         <?php comments_template( '', true ); ?>       <?php endif; ?>          <?php endwhile; ?>


Access posts while mod_rewrite is broken

On my wordpress installation mod_rewrite (e.g. the permalinks) is temporarily broken. For debugging I want to access the formerly "prettified" page `mydomain.tld/page/2`. What is the old GET parameter for it?


Add parameter to URL

I have in my functions.php this function:               // rewrite the url     function my_rewrites_init(){         add_rewrite_rule(             'demo/([0-9]+)/?$',             'index.php?pagename=demo&p_id=$matches[1]',             'top' );     }     add_action( 'init', 'my_rewrites_init' );          function my_build_demo_url($p_id)     {     $demo_url = add_query_arg( array('p_id' => $p_id, 'pagename' =>'demo'), get_home_url() );     return $demo_url;     }      In my page I have `<a href = "<?php echo my_build_demo_url($id)?>" ></a>` but I see `http://mysite.com/locale/?p_id=105&pagename=demo`. NB: in my WordPress admin I have flushed the permalink.


Can a plugin be run in a different language than WordPress?

I am working with a site that is running WordPress in English, but they would like to run one of their plugins using the Welsh language. We already have the appropriate .po/.mo files for the plugin, but they are not being used while WordPress is running in English. Is there any way, perhaps with some custom PHP code in the plugin, that we can force WordPress to use the Welsh language files just for this plugin, but leave the rest of the site in English?


Some Plugin Settings Are Kept After Removal and Reinstall of the Plugin

I have uninstalled and then reinstalled all my plugins hoping to restore my WordPress installation to its original state because I have problem with the funtion of RevieAzon plugin. For example, BEFORE I delete the WP Policies plugin I modified the categories in menu area but went I reinstall it the plugin is not in his original state. Several plugins are having similar problems. Can I restore all the plugins to their original state?


Convert all uploaded PNG files to PNG-8 format

Running a high trafficed platform. In my quest to minimise bandwidth costs, I added a high JPEG compression on all JPEG uploads (check solution in my previous question). However, Wordpress does not convert PNG files to JPEG, which means that all PNG files remain at their original size. Is it possible to make all PNG uploads be converted to PNG-8 format? PNG 8-bit is limited to 256 colours which should bring down the file size quite drastically.


Pagination for list category post plugin

This question is about this plugin http://wordpress.org/extend/plugins/list- category-posts/ if i do numberposts=10 but i have 20 posts how could i put the pagination there? this plugin really good but until even the plugin developer has not solve this pagination problem thanks!


How to deal with Wordpress bug: can't use wrapped and unwrapped shortcode on same post

After trouble parsing wrapping and non-wrapping shortcodes on the same page, I came across this trac ticket from 3 years ago: http://core.trac.wordpress.org/ticket/9264 The trouble is WP cannot properly parse               [myshortcode att="bla"] and      [myshortcode]Enclosed content[/myshortcode]       on the same page. The above gives you one shortcode with $att "`bla`" and $content "`and [myshortcode]Enclosed content.`" Adding a closing [/myshortcode] tag does not help:               [myshortcode att="bla"][/myshortcode] and     [myshortcode]Enclosed content[/myshortcode]       Wordpress fails to parse it, and you end up with this a shortcode with $att "`bla`" and $content "`[/myshortcode] and [myshortcode]Enclosed content.`" As the ticket author points out (6 months ago), > With both [test/][test]content[/test] and [test][/test][test]content[/test] > broken it seems impossible to enter a shortcode with null content before > another instance of the same shortcode tag. The diff in the trac ticket doesn't seem to work*, so I'm wondering if anyone has dealt with this or can suggest a fix in `wp-includes/shortcodes.php`. * * * *Perhaps related to the comment just before the changed line in wp-includes/shortcodes.php:                // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcodes()


shortcode causing the_content() to return blank?

I have a shortcode that just retrieves some info from the options table in the database. For whatever reason, when the content reaches a certain character limit the_content() to return blank? The function is pretty basic and I can't for the life me figure out why this is happening? Here's an example of the code:               function my_custom_shortcode() { return get_option('my_custom_shortcode'); }     add_shortcode('MYSHORTCODE', 'my_custom_shortcode');      Has anyone experienced this before? Thanks!


How to use get_template_part instead of include_once?

I'm including a file by `include_once`:               include_once( trailingslashit( get_stylesheet_directory() ) . '/recaptchalib.php' );      However I get warning from theme check plugin:               INFO: The theme appears to use include or require.      If these are being used to include separate sections of a template from independent files,      then get_template_part() should be used instead.       How can I include the above file using the `get_template_part`?


Taxonomy Parent not showing up in address bar

I created a custom taxonomy successfully and assigned the custom post type as well. It is a hierarchical taxonomy and I added terms in the back in a hierarchical way. I added for instance main Category "MAIN" and sub category "Sub Cat". Now, when I go to look at "Sub cat" in the from end, I get `/mysite.com/THE-CHOSEN- SLUG/sub-cat` instead of `/mysite.com/THE-CHOSEN-SLUG/main/sub-cat` What am I missing? I have worked with CPT and custom taxonomies for a while already and am very versed in wordpress. Anything changed lately?


High I/O load when hosting lots of wordpress sites

I have a vps that hosts about 30 separate wordpress sites and I notice it that does a lot disk writes. In total it does 5mb/sec disk write. Is there anyway to decrease the disk write? cause each time I add more wordpress site it increases


Allow user to Publish, but not Edit or Delete

I saw post Allow Content Author to Publish, But Not Edit or Delete but is not the same I need and I cannot ask there because of reputation ¬¬ I need an user that can publish any user's post but can't edit or delete any post, not only their. I tried with capabilites **Read|Publish Post** but can't see the Posts. With **Read|Edit Posts|Publish Post** can see the Posts but only publish own Posts. Is there a way of doing what I need ? Thank you in advance


Need an idea about how to open a popup which contain only post created form in wordpress admin

I need an idea about how to open a popup which contain only post created form in wordpress admin. What I am doing is, I created a custom post type and in that I added dropdown of normal posts. admin can select post from it during creating custom post type. At this stage it is fine. But if there is no post then I am displaying a link "Create New Post" with link to "/wp-admin/post-new.php". so when admin click on it, he redirect to that page. BUT my idea is I want to open a popup of create post same as post-new.php page and admin can create post at same time (without redirect). Is their any form API in wordpress because I want to show all metaboxes that other plugins added to post-new.php.


$wpdb: how to use a query as a base for another query?

I've got this query:               select p.ID, p.post_title, p.post_content, t.term_id, tt.taxonomy, t.name, t.slug, tt.count     from bdu_posts p     inner join bdu_term_relationships rel on p.ID = rel.object_id     inner join bdu_term_taxonomy tt on tt.term_taxonomy_id = rel.term_taxonomy_id     inner join bdu_terms t on tt.term_id = t.term_id     where p.post_type = "prodotto" and p.post_status = "publish"      then, basically, I need the same results grouped by t.term_id. Or, better, a subset of columns of the first query's results (the ones term-related), grouped by t.term_id. In theory, what I want is simply to use the first query results as a base "table" for another query to get other sub-results. I'm not really good in SQL. Probably the way would be things like table views, but I'm not sure how they work and especially how to use them with $wpdb. Does anyone know? :)


Remove Genericons Helper CSS from twentyfourteen theme

I'd like to remove the genericons-css styles loaded by default into twentyfourteen theme.               <link rel='stylesheet' id='genericons-css'  href='http://ffwdconsulting.com/wp/wp-content/themes/twentyfourteen/genericons/genericons.css?ver=3.0.2' type='text/css' media='all' />      I followed How to remove CSS file in the header using Wordpress functions? with this code:               function dequeue_my_css() {       wp_dequeue_style('genericons-css');       wp_deregister_style('genericons-css');     }     add_action('wp_enqueue_scripts','dequeue_my_css');      but doesn't work. Link to css still shows up in the header.


Pages with a loop (index, archive) are loading the first image as post_thumbnail

Using post thumbnails for custom header images -- works fine on straight pages. But custom templates that load a loop (including index) are pulling the first image instead of using the one set in the featured image field. Anyone seen this before? Thanks! -m


Best Way To Structure 3 Tiered Site

I'm starting a quote site using Wordpress. I'm wondering what would be the best way to structure the site considering the fact that I'd like to include a lot of static content on the tier 2 pages. For Example: Imagine there is HOME PAGE > Love Quotes > French love quotes, romantic love quotes...etc I could do all the tier 3 content as posts and throw them into the category of "love quotes", but the problem is that I'd like the tier 2 "love quotes" page to have a bunch of static content (the 30 best love quotes, etc...). So it seems I would have to code individual archive pages to include a bunch of static content, and do this for the 30+ categories I intend on including? Or, I could just use pages and sub pages, and forget about posts and categories altogether. But it seems like I'll lose some features like the ability to easily promote new posts or posts within a certain topic. Does it make a difference in terms of SEO? What would you recommend, considering this site will be more like a static site than a blog... Any help would be greatly appreciated.


Backstretch.js and thumbnail sizes to reduce loading time

I am using backstretch.js to set a featured image as a full size background image (as per this tutorial). I would like to combine this approach with different thumbnail sizes in order to reduce loading time on mobile devices. I am wondering how I can manage this. I guess the deciding line of code is the following from functions.php:               wp_localize_script( 'backstretch-set', 'BackStretchImg', array( 'src' => wp_get_attachment_url( get_post_thumbnail_id() ) ) );      I know that I can combine this code with an image size, like               wp_get_attachment_url( get_post_thumbnail_id(), 'medium' ) ) );      But I don't know how to combine this either with mediaqueries or an if-query. Do you have an idea?


styling wp_nav_menu - horizontal, sub-menu drop downs

live site. I'm using wp_nav_menu called "blog-nav". It's displaying ok, however I'd like to have it horizontally oriented and with sub-menu drop downs(all lower cased items should be in the drop down portion). I've searched around various posts here, alistapart.com, etc but nothing seems to work quite right. I mist be missing something? Here's what I'm using- functions.php               <?php         add_theme_support( 'menus' );     ?>      header-blog.php

<a href="<?php echo get_option('home'); ?>"/><img src="<?php bloginfo('template_directory'); ?>/img/blog-logo.png" alt="#" />

<?php wp_nav_menu(array('menu' => 'blog-nav', 'container' => false, 'items_wrap' => '
%3$s
')); ?>

      style.css               #access ul ul { display: none }     #access ul li:hover > ul { display: block }      Any ideas to make this all come together?


Using "excerpt_more" filter for a specific post type

I have used `excerpt_more` filter in a theme's functions.php and in a plugin's functions.php. Here is the code for the theme                 function theme_excerpt_more( $more ) {          return '...';       }       add_filter('excerpt_more', 'theme_excerpt_more');      and here is the code for the plugin                  function newsbox_excerpt_more($more) {        global $post;        $options = get_option('newsbox_plugin_display_options');        if(isset($options['read_more_text'])){           $read_more_text = $options['read_more_text'];        }        else{          $read_more_text = "Read More »";        }        return '...ID) . '">' . $read_more_text . '';      }       add_filter('excerpt_more', 'newsbox_excerpt_more');      But only the theme's `excerpt_more` is working. I want the plugin `excerpt_more` to work on the post that will set in the shortcode. This is the shortcode `[news_box posts_per_page=-1 news_box_title="Latest News" post_type="latest_news" category ="Uncategorized"]` If I don't set `post_type`, then the plugin's `excerpt_more` will work on the default post. Any suggestions to achieve this? Edit: Full code                function newsbox_new_loading_shortcod($atts){      extract(shortcode_atts(array(         'posts_per_page'=>'-1',         'news_box_title'=>'Latest News',         'post_type'=>'post',         'category'=>''     ),$atts,'news_box'));          $q = new WP_Query(      array('posts_per_page' => $posts_per_page,'post_type'=>array($post_type),'category_name'=>$category));     $list = '

 '.$news_box_title.'

';                                          while($q->have_posts()) : $q->the_post();                                              $newsbox_post_img_src = wp_get_attachment_image_src( get_post_thumbnail_id(), '', false );                                              $list .= '

                                                	                               '.get_the_excerpt().'

';                                          endwhile;                                          wp_reset_postdata();                                      return $list . '

';                                       }      add_shortcode('news_box','newsbox_new_loading_shortcod');


Image LazyLoad plugin not loading jQuery dependancies with wp_enqueue_script in WP 3.3.1

I am attempting to install the image LazyLoad plugin with use on my Wordpress 3.3.1 blog. I have followed the basic instructions, so it is installed and activated on my development site. The problem is I see no jQuery.sonar reference in the source (which this plugin uses). The plugin does this when en queuing the scripts:               wp_enqueue_script( 'wpcom-lazy-load-images',  self::get_url( 'js/lazy-load.js' ), array( 'jquery', 'jquery-sonar' ), self::version, true );     wp_enqueue_script( 'jquery-sonar', self::get_url( 'js/jquery.sonar.min.js' ), array( 'jquery' ), self::version, true );      Why would these scripts not be output and available in the source?


WP-Admin edit.php & post.php slowdown after import of 10k users

**Situation** :   * Clean wordpress install   * No plugins   * VPS server 5.2ghz / 4gb RAM (Default Directadmin)   * Import of 10k users **Problem** :   * WP-Admin edit.php and post.php take >4sec to load.    * A custom post type without the 'Author' support loads quickly **What I tried** :   * https://core.trac.wordpress.org/ticket/28160, didn't work **Question** :   * What to do to get it fast again?


How can I append custom data to images in the editor?

I've added a custom meta field to my image details so that a client can add a number to their photos (a design choice). The data would need to show up under each image (like a caption) inserted into the editor when the user inserts into post ( ~~I can't use the caption for my purposes because WordPress won't let me nest shortcodes, and I'm using a grid columns plugin which relies on shortcodes~~ ). Found out that you can indeed nest shortcodes—the editor just wasn't inserting the image with caption in the right spot and someone had told me you couldn't nest them. What they meant was that you can't nest the same shortcode: http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes I'd still like to know if I can add a field that could be specifically for this purpose rather than the caption. Here's what I used to add the custom meta field:               /**      * Add image number metabox to the media details      */          function ra_attachment_fields_to_edit($form_fields, $post) {         $form_fields["image_number"] = array(             "label" => __("Image Number"),             "input" => "text", // this is default if "input" is omitted             "value" => get_post_meta($post->ID, "_image_number", true),         );        return $form_fields;     }     add_filter("attachment_fields_to_edit", "ra_attachment_fields_to_edit", null, 2);          /*      * Save it      */     function ra_attachment_fields_to_save($post, $attachment) {         if( isset($attachment['image_number']) ){             // update_post_meta(postID, meta_key, meta_value);             update_post_meta($post['ID'], '_image_number', $attachment['image_number']);         }         return $post;     }     add_filter("attachment_fields_to_save", "ra_attachment_fields_to_save", null , 2);


display link to a custom plugin in admin menu bar

i have a custom plugin and i want the link to the plugin be accessible in the **admin menu bar** of the `wp-admin` right now, im using below code. but the link to this shows under my settings. what hook should i replace with the `add_option_page`?               function custom_plugin() {         add_options_page("my plugin", "plugin settings", 1, "my plugin", "custom_function");     }          add_action ('admin_menu', 'custom_plugin');


Incorporate zilla shortcode into theme

I am trying to incorporate zilla shortcode plugin into theme.I have done it nicely but result is not satisfactory.Here is my code               <?php     class ZillaShortcodes {          function __construct()      {            define('ZILLA_TINYMCE_URI', get_template_directory_uri() . '/a/tinymce/');               add_action('init', array(&$this, 'init'));         add_action('admin_init', array(&$this, 'admin_init'));     }          function init()     {         if( ! is_admin() )         {             wp_enqueue_style( 'zilla-shortcodes', get_template_directory_uri() . '/a/shortcodes.css' );             wp_enqueue_script( 'jquery-ui-accordion' );             wp_enqueue_script( 'jquery-ui-tabs' );             wp_enqueue_script( 'zilla-shortcodes-lib', get_template_directory_uri() . '/a/js/custom-script.js', array('jquery', 'jquery-ui-accordion', 'jquery-ui-tabs') );         }              if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )             return;              if ( get_user_option('rich_editing') == 'true' )         {             add_filter( 'mce_external_plugins', array(&$this, 'add_rich_plugins') );             add_filter( 'mce_buttons', array(&$this, 'register_rich_buttons') );         }     }          // --------------------------------------------------------------------------          function add_rich_plugins( $plugin_array )     {         $plugin_array['zillaShortcodes'] = get_template_directory_uri() . '/a/tinymce/plugin.js';         return $plugin_array;     }          // --------------------------------------------------------------------------          function register_rich_buttons( $buttons )     {         array_push( $buttons, "|", 'zilla_button' );         return $buttons;     }          /**      * Enqueue Scripts and Styles      *      * @return  void      */     function admin_init()     {         // css         wp_enqueue_style( 'zilla-popup', get_template_directory_uri() . '/a/tinymce/css/popup.css', false, '1.0', 'all' );              // js         wp_enqueue_script( 'jquery-ui-sortable' );         wp_enqueue_script( 'jquery-livequery', ZILLA_TINYMCE_URI . '/js/jquery.livequery.js', false, '1.1.1', false );         wp_enqueue_script( 'jquery-appendo', ZILLA_TINYMCE_URI . '/js/jquery.appendo.js', false, '1.0', false );         wp_enqueue_script( 'base64', ZILLA_TINYMCE_URI . '/js/base64.js', false, '1.0', false );         wp_enqueue_script( 'zilla-popup', ZILLA_TINYMCE_URI . '/js/popup.js', false, '1.0', false );              wp_localize_script( 'jquery', 'ZillaShortcodes', array('plugin_folder' => WP_PLUGIN_URL .'/zilla-shortcodes') );     }          }     $zilla_shortcodes = new ZillaShortcodes();