title: Theme Customizer - Custom Sections Display, but do Nothing

text: I'm creating a theme and I've started doing some work on the theme customizer. I'm going to do all of it in the theme functions, but I have an issue I want to figure out first: I've added a Typography section which currently only has some color pickers that can change the color of paragraph text and links. However, it doesn't work. There's no errors, section displays with the options, but nothing changes when I change the colors. Here's my code, if anyone can help me out, I'd be thrilled :)               /* Theme Customizer Code */     function dsgn_customizer_register($wp_customize) {     $wp_customize->add_section('dsgn_typograhy', array(         'title' => __('Typography', 'dsgn'),         'description' => ('Modify the theme typography')     ));     $wp_customize->add_setting('content_color', array(         'default' => '#544e4e',     ));     $wp_customize->add_setting('link_color', array(         'default' => '#BF5050',     ));     $wp_customize->add_control( new WP_customize_color_control($wp_customize, 'content_color', array(         'label' => __('Edit Content Text Color', 'dsgn'),         'section' => 'dsgn_typograhy',         'settings' => 'content_color'     ) ));     $wp_customize->add_control( new WP_customize_color_control($wp_customize, 'link_color', array(         'label' => __('Edit Link Text Color', 'dsgn'),         'section' => 'dsgn_typograhy',         'settings' => 'link_color'     ) ));      }               function dsgn_css_customizer() {     ?>     <style type="text/css">         a {             color: <?php echo get_theme_mod('link_color'); ?>;         }         .entry-content p {             color: <?php echo get_theme_mod('content_color'); ?>;         }     </style>     <?php     }          add_action('wp-head', 'dsgn_css_customizer');     add_action('customize_register', 'dsgn_customizer_register');      **NOTE:** I tried adding another control for the body background-color and that works perfectly... I did actually already have support for background- color using this code:               // Add theme support for Custom Background     $background_args = array(     'default-color'          => 'e9e9e9',     'default-image'          => '',     'wp-head-callback'       => '_custom_background_cb',     'admin-head-callback'    => '',     'admin-preview-callback' => '',     );     add_theme_support( 'custom-background', $background_args );      When I remove that code, the option no longer works, so I'm guessing I maybe have to add some kind of support for the typography changes as well..?


title: How to Deny Access to No Referrer Requests on Multiste with Mapped domains

text: RewriteEngine On     RewriteCond %{REQUEST_METHOD} POST     RewriteCond %{REQUEST_URI} .wp-comments-post\.php*     RewriteCond %{HTTP_REFERER} !.*yourdomain.com.* [OR]     RewriteCond %{HTTP_USER_AGENT} ^$     RewriteRule (.*) http://%{REMOTE_ADDR}/$ [R=301,L]      I'm aware that the following code Denys Access to No Referrer Requests. However I'm using a multiste installation and I would like to know. How can I modify it so the code above to work with WP multiste and mapped domains?


title: Output terms to post_class()

text:
I am trying to output all terms attached to a specific post (including custom taxonomy terms) as CSS classes applied to a DIV Something like that :                  <div <?php post_class('class-name'); ?>>
      So it outputs something like this :

      How do I do this? Thanks!


title: Stop turning small dashes into longer ones

text: When I write my site's title, description, posts, pages, or a taxonomy description, small dashes `-` are turned into longer, uglier ones `–`. Is there some way to stop this from happening? Can I put some sort of function in my functions.php? Any ideas?


title: Regenerate Thumbnails Plugin successfully updated my thumbnails but image src won't change to new image size?

text: I "successfully" regenerated my thumbnails using the Regenerate Thumbnails Plugin as I added a variety of new image sizes to my site; however, I'm having difficulty getting these new images sizes to actual display. When I inspect each image it is still showing the old image size path in the src="". I don't have any cacheing plugins running (this is on a staging server.) Could this be an .htaccess issue? For example:               Local:               Staging:           As you can see, on my Local environment the image src is using the correct image sizes as at the end of the link it has the "456x244.jpg" crop, whereas on my Staging environment it is still using the original upload.


title: Changing wp_link_pages() to "Next Page" and "Previous Page" buttons?

text:
Currently I am using `<!--nextpage-->` to split a post into multiple pages, but I would like to change from `Pages: 1 2 3 4` to `Next Page` and `Previous Page` links similar to what you see on this multipaged post In my `single.php` I have:               <?php wp_link_pages( array( 'before' => '
' . __( 'Pages:', 'pearl' ), 'after' => '
' ) ); ?>      How can I change this to a next and a previous button?


title: order by multiple meta_keys?

text: Hi i'd like to order by multiple meta_keys want to make it order using these keys adminscore + user_like + _count-views_all + comment_count combine these keys how should i array order it?? i try this but not work..                 $args = array(                 'meta_key' => 'adminscore' + 'user_like' + '_count-views_all' + 'comment_count',                     'numberposts' => $number_posts,                     'post_status' => $post_status,                     'post_type' => $custom_post_type,                     'orderby' => 'meta_value_num'                    );      Thanks for check my question, hope someone has answer for it.


title: Deleted pages are NOT removed from custom menus?

text: When I delete a page, post or category that has previously been added to a custom menu, the delete routine is apparently not checking to see if the item belongs to a custom menu, and thus its not removing it from the custom menu. This results in a 404 page error when the menu item is clicked on from the website. So as the code is now, its up to the user to (1) have knowledge of this behavior and (2) remember to delete the item from BOTH places, to avoid embarrassing 404 "not found" and search bot crawl errors. Is this a known bug/design flaw? It seems entirely counter-intuitive if its known and allowed to stand as is. I should note, as pointed out below by Maugly, that once the item is removed from "Trash", WordPress finally removes it from any custom menus. However, this is counter-intutive the the way all other WordPress menus operate. As soon as you place an item in the trash, its removed from "Pages" and "Recent Posts" widget listings, why not the same behavior for custom menus? I'd err on the side of consistency, and even more importantly, link integrity. Users should not expect custom menus to follow a completely different set of rules with respect to deleting pages and posts than other menus.


title: jQuery cycle and WordPress: Captions, buttons, oh my

text:
I'm attempting to use jQuery cycle to create a rotator on my blog (which will be used going forward on all other blogs) like the following: http://www.pbs.org/teachers
          <?php      $loop = new WP_Query( array( 'category_name' => 'Dynamic Lead', 'posts_per_page' => 3 ) );      $i = 0; ?>
     <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>                <li class="feature-well-feature <?php echo ++$i; ?>">         <a href="<?php echo get_post_meta($post->ID, 'custom_permalink', true); ?>">             <img alt="<?php the_title(); ?> image" <?php echo get_post_meta($post->ID, 'img_url', true); ?" />                              Go!                 <?php the_title(); ?>                 <?php the_content(); ?>
            <?php endwhile; ?>
     <?php $i = 0; ?>
              <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>         <li class="feature-<?php echo ++$i; ?> <?php if ( $i <= 1 ) echo 'activeSlide'; ?>"><a href="<?php echo get_post_meta($post->ID, 'custom_permalink', true); ?>" <?php if ( $i <= 1 ) echo 'class="activeSlide"'; ?>><?php the_title(); ?>
     <?php endwhile; ?>

       But when I implement the above code, I get nothing but blank space (the page doesn't continue loading). I've tried several tutorials about creating jQuery sliders in WP but none that allow me to have captions along with, lack of better word, buttons that hold the same titles as the captions. Can anyone help me out?


title: Creating Settings Page with dropdowns for Plugin

text: I am setting up my plugin's settings page and I am able to get the fields I want on the page, but I want them to be dropdowns not textboxes... I have not found any useful info on the web on how to do this other than using add_settings_field. With add_settings_field I can display a dropdown for my setting but I can't get it to appear on my plugin settings page, I can get it to appear on the 'reading settings page' though for example. basically I have used add_options_page() so that my Plugin Options page shows up under the settings menu in the wordpress backend, and addaction() to register my settings, and the form is built with the callback function from add_options_page. This all works, I just can't get anything but textboxes... and I would like dropdowns and probably checkboxes. I hope that makes sense. Thanks!


title: Select category from dropdown, display random post from that category

text: Was wondering if anyone could recommend a good way to display a single, random post from a wp_dropdown_categories() menu. Basically, I have a custom post type called Tips and a taxonomy term called Tip Categories. I want to display the Tip Categories in a dropdown (which I have done already using wp_dropdown_categories), then when a user selects a Tip Category and clicks a submit button, a random tip from that category will display. I suppose I can figure out a way to do this on the front end with Javascript/CSS (generating all tips, then showing/hiding them) but it seems like it would be best to generate one tip and do it all in PHP. Anyone have an idea of how best to accomplish this? Can I somehow pass the value of the wp_dropdown_categories selection to WP_Query()? Maybe this is easier than I thought and I'm missing something?


title: Finding posts containing matching array elements in a meta field usign WP_Query

text: I have a metafield, that contains a series of options and writes the results to an array in a single meta field:               array([0]=>'First',           [1]=>'Second',           [2]=>'Third',          );      I find posts that contain any of the array elements, and display them using `WP_Query`               $search = new WP_Query('meta_key=mykey&meta_value=second');      But this doesn't seem to work. Any idea on how to achieve this? * * * I have edited my method, following this question:               $arg['meta_key'] == $key;     $args['meta_value'] = "%|".$value."|%";     $custom_query = new WP_Query($args);      But no darts.


title: Multiple search template with separate stylesheets

text: I'm building a site which needs to have two search bars and two search results templates. One of the search bars is for regular posts, and the other is for a custom post type. I need the two search results pages to be styled completely differently, so I have set up two templates to display results. One is the standard `search.php` that detects if the post type is a custom one, and displays it on a template named `new-index.php` Im trying to attach different style sheets to the different pages using the following code:               <?php     if ( is_page_template('new-index.php')) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/home.css" />     <?php } ?>      which dosen't work, but if i use:               <?php     if ( is_search()) { ?>     <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/gallery.css" />     <?php } ?>      it works fine but it gives both the templates the same style sheet, I understand why its happening, but cannot figure out a way around it, any suggestions?


title: Conditional statement for parent, child and grandchild pages

text:
I'm trying to figure out how to set up a conditional statement to check if the parent, child or grandchild is being displayed. This is what I've got so far:               <?php           if ( is_page( 'about' ) || '29' == $post->post_parent ) {         //Start of the custom code...         while(has_sub_field('site_slideshows','option')):         ?>                   <div class="slideshow-slide" style="background-image:url(<?php the_sub_field('site_slideshows_slide_image'); ?>)">                 <div class="block-text" style="color: <?php the_sub_field('site_slideshows_slide_text_colour'); ?>;"><?php the_sub_field('site_slideshows_slide_text'); ?>

              <?php //Opening the PHP tag again         endwhile;          } elseif ( is_page( 'contact' ) || '31' == $post->post_parent ) {         //Start of the custom code...         while(has_sub_field('two_site_slideshows','option')):         ?>                   <div class="slideshow-slide" style="background-image:url(<?php the_sub_field('two_site_slideshows_slide_image'); ?>)">                 <div class="block-text" style="color: <?php the_sub_field('two_site_slide_text_colour'); ?>;"><?php the_sub_field('two_site_slideshows_slide_text'); ?>

              <?php //Opening the PHP tag again         endwhile;          }     ?>      This will successfully check for the parent and child page, e.g. the `about` page and all the children of the `about` page, but how would I adjust these statements to include grandchild pages also? Any suggestions would be greatly appreciated.


title: Wordpress Query orderby title with UTF8 string in title

text: I got posts with titles are in utf8 encoding. When I query posts with `orderby` is `title`, those with utf8 characters at the beginning are at the end. Example: post title starts with `Đ` are at the end of the list. Is there anyway I can make orderby order sorts `Đ`right after `D`?


title: Add profile field (usermeta) to Add New User

text:
Edit: Add profile field (usermeta) to user registration I am trying to add a custom field to the Add New User page much as I have done with the user profile page like so:               add_action( 'show_user_profile', 'my_show_extra_profile_fields' );     add_action( 'edit_user_profile', 'my_show_extra_profile_fields' );          function my_show_extra_profile_fields( $user ) { ?>
Player information

             Team Name	                                   <?php                  $status = get_the_author_meta( 'team-meta', $user->ID );                  $items = get_posts (array (                     'post_type' => 'team_page',                     'posts_per_page' => -1                 ));                 echo '<select name="team-meta" id="team-meta">                       <option value="">No team selected</option>';                   foreach($items as $item) {                      echo '<option value="'.$item->ID.'"',$status == $item->ID ? ' selected="selected"' : '','>'.$item->post_title.'</option>';                       } // end foreach                   ?>                      Please enter the player's team name

     <?php }          add_action( 'personal_options_update', 'my_save_extra_profile_fields' );     add_action( 'edit_user_profile_update', 'my_save_extra_profile_fields' );          function my_save_extra_profile_fields( $user_id ) {          if ( !current_user_can( 'edit_users', $user_id ) )         return false;          update_user_meta( $user_id, 'team-meta', $_POST['team-meta'] );     }      Basically I want whoever creates a new user to be able to add this directly without going to the user profile.


title: Custom class on Media image inserted in the editor

text: I would like to have different classes added regarding the options selected during the media insertion. When inserting a media, there are 3 options (media file, attachement page and custom URL) wrapping the image with `a href` : ![enter image description here](http://i.stack.imgur.com/Yc7U9.jpg) At the moment, the code returned is always the same :                                  It doesn't make difference what option is selected. What I would like to achieve is add a different class to my `a href` for each option available. For example, if I selected the option "Custom URL", I would have something similar to :                                   These different classes would help me to trigger actions in jQuery.


title: How to make my new theme read [youtube id="id of the video here" width="600" height="350"]?

text: I recently changed the theme on my website pocketlife.com.br , and now all my videos, which were used on the posts on this format: [youtube id="only the id here" width="600" height="350"] are not understood, and inside the posts like this one for example http://pocketlife.com.br/2014/03/cut-the-rope-2-chega- finalmente-ao-android/ , the following message is shown where the video is supposed to be: "Please enter the url to a YouTube video." . How can I make it so I don't need to go into all the posts I have that has any video inside and edit in a way that wordpress will embed it? Thanks!


title: Obliterate the main query and replace it

text: There are lots of good resources on how to alter the main query, or add secondary loops... But I actually want to completely replace the main query with a different query altogether. I am hijacking one of my pages to serve, essentially, as a category page. (Note I am changing from "page" to "post" in my effort to do this.) But when I alter the main query by doing this:               function front_page_announcements( $query ) {         if ( $query->query_vars['page_id'] == 84 && $query->is_main_query() && !$query->is_admin ) {             $query->set("category_name", "special-announcement");             $query->set("page_id", NULL);         }     }     add_action( 'pre_get_posts', 'front_page_announcements' );      I end up getting every page (not post) in the database. What I actually want is every post (not page) with a category id of `3`, or `special-announcement` in my case. I don't want to make unnecessary calls to the database, so it seems like the `pre_get_posts` action hook is what I'll want, but I can't figure it out. Even just setting `$query = new WP_Query('cat=3')` doesn't seem to work.


title: Changing theme from twentytwelve to twentythirteen comments not working

text: I have a wordpress blog located HERE. A couple of days ago I changed the child theme from this blog over from twentytwelve to twentyfourteen. As a result now, my comments box at the bottom of each blog post no longer works. I click it but nothing happens. I am rather new to wordpress design and willing to learn.


title: How to control template resolution if both Author and Category filter in place?

text: The following url resolves to the category template: http://localhost/author/myusername/?category_name=somecategory I have a `category-somecategory.php` template and just a generic `author.php` template. Is there any way to make such a url use the `author.php` template instead of the `category-somecategory.php`? If not how can I filter on both category and author and force it to use the author template?


title: How to create custom anchore to specific past category with feature image?

text: I created wordpress website and add 6 statics banner. Now i want to dynamic so i created a add category and add featured image as a banner but dont know how add anchore please give me idea or aany suggestion.


title: Is it possible for a plugin to prevent certain plugins from being installed?

text: Or perhaps if it can't prevent it, can the plugin disable certain plugins in the admin area and prevent them from being activated, sort of like the reverse of disabling plugin deactivation? **Edit** : Changed the question from 'is it possible for a theme' to 'is it possible for a plugin'.


title: Displaying shortcode output through Options Framework

text: I'm hoping someone might be able to help me. I'm using the Options Framework Plugin to customise my site, but I'm having difficulty with using a shortcode in one of the custom fields. I've created an 'editor' field, and called it in my theme like so:               <?php        if ( of_get_option('footer_contact_form') ) {         echo of_get_option('footer_contact_form');       }     ?>      But it outputs the shortcode (gravity forms) as raw text, like so: https://dl.dropboxusercontent.com/u/4676147/shortcode-output.png Is it possible to achieve what I'm trying, or will I have to hard code the form into the theme? Many thanks in advance!


title: Using Multisite with a CDN?

text: I'm running Wordpress Multisite hosted with Bluehost, and only have 5 low volume sites. My site load time has been awful recently, so I've used Lazy Load, DB optimization, Smush.it, and Quick Cache to try to remedy the speed issue. Spending a lot of time looking for a good CDN, and apparently, there ISN'T a CDN that easily implements with WP Multisite. Every one requires W3 Total Cache, which can't be activated across the network. There are risky-looking tutorials on how to create a mirror static page, etc., but nothing that makes a clear and simple installation. My choice CDN would be MaxCDN, but even they require W3TC. Does anyone have a definitive answer on how to put a Multisite installation in the cloud, or on a CDN service?


title: Problem with registering menus - What to do when other solutions aren't working?

text: I'm not able to get nav menus to register - and I'm not sure what else to try when posted solutions are not working? I've tried the solution in this post: register_nav_menus() won't register menus And have also followed the instructions in: http://codex.wordpress.org/Function_Reference/register_nav_menus and http://wptuts.org/how-to-add-menu-to-wordpress-theme/ I cannot get this to work - I still get this message: > "The current theme does not natively support menus, but you can use the > “Custom Menu” widget to add any menus you create here to the theme’s > sidebar." Currently in my functions.php file (keeping it simple - but isn't working):               register_nav_menu('primary_navigation', 'Primary Navigation');     add_action('after_setup_theme', 'hchw_setup');      This isn't working for me either (hchw is my theme name):               register_nav_menus(array(         'primary_navigation' => __('Primary Navigation', 'hchw'),         'sub_navigation' => __('Sub Navigation', 'hchw'),     ));     add_action('after_setup_theme', 'hchw_setup');      My navigation template (header-top-navbar.php):               if (has_nav_menu('primary_navigation')) {         wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav'));     }      The include: `<?php get_template_part('templates/header-top-navbar'); ?>` The entire functions.php file:               // Use 'static' instead of 'wp-content'     function rename_wp_content($path) {       return str_replace('wp-content', 'static', $path);     }     add_filter('template_directory_uri', 'rename_wp_content');          // Is this an auth page?     function is_auth_page() {       return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));     }          // Change login logo     function login_css() {       wp_enqueue_style('login_css', get_template_directory_uri() . '/css/login.css');     }     add_action('login_head', 'login_css');          if (!defined('__DIR__')) { define('__DIR__', dirname(__FILE__)); }          require_once locate_template('/lib/utils.php');           // Utility functions     require_once locate_template('/lib/config.php');          // Configuration and constants     require_once locate_template('/lib/activation.php');      // Theme activation     require_once locate_template('/lib/cleanup.php');         // Cleanup     require_once locate_template('/lib/htaccess.php');        // Rewrites for assets, H5BP .htaccess     require_once locate_template('/lib/widgets.php');         // Sidebars and widgets     require_once locate_template('/lib/scripts.php');         // Scripts and stylesheets     require_once locate_template('/lib/post-types.php');      // Custom post types     require_once locate_template('/lib/metaboxes.php');       // Custom metaboxes     require_once locate_template('/lib/custom.php');          // Custom functions     //require_once locate_template('/lib/wp-admin-menu-classes.php'); // Load the Admin Menu Classes               /**      * Load the Options Panel     **/     if ( !function_exists( 'optionsframework_init' ) ) {         define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/' );         require_once dirname( __FILE__ ) . '/admin/options-framework.php';     }          function hchw_setup() {          // Make theme available for translation     load_theme_textdomain('hchw', get_template_directory() . '/lang');          // Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)     //register_nav_menus(array(     //    'primary_navigation' => __('Primary Navigation', 'hchw'),     //    'sub_navigation' => __('Sub Navigation', 'hchw'),     //));               register_nav_menu('primary_navigation', 'Primary Navigation');     add_action('after_setup_theme', 'hchw_setup');               // Add post formats (http://codex.wordpress.org/Post_Formats)     // add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));          // Tell the TinyMCE editor to use a custom stylesheet     add_editor_style('assets/css/editor-style.css');          /**      * Custom images size     **/       // Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)     // This is then pulled through to your theme useing the_post_thumbnail('custombig');      add_theme_support('post-thumbnails');       set_post_thumbnail_size(150, 150, false);       add_image_size('category-thumb', 300, 9999); // 300px wide (and unlimited height)       add_image_size('postfull', 504, 334); // Blog Post Full-Size       add_image_size('customfeatins', 248, 165, true); //hp featured inset       add_image_size('customfeatblg', 290, 192, true); //int featured inset       add_image_size('customfeed', 136, 90, true); //feed thumbnails       add_image_size('customparade', 176, 98, true); //logo parade          }          // Remove the link and 'Powered by WordPress' from the login page     function login_header_unlink() {       return null;     }     add_filter('login_headerurl', 'login_header_unlink');     add_filter('login_headertitle', 'login_header_unlink');               /**      * Add class to body tag if has sidebar     **/     function wpfme_has_sidebar($classes) {         if (is_active_sidebar('sidebar')) {             // add 'class-name' to the $classes array             $classes[] = 'has_sidebar';         }         // return the $classes array         return $classes;     }     add_filter('body_class','wpfme_has_sidebar');      Can anyone tell me what it is I'm missing, or if there is something incorrect with my code? Thanks in advance for your any help or direction!


title: Remove double space after a period

text: I run a multiple author platform with more than 1000 writers. Most users writer their content externally (Microsoft Word, OpenOffice etc) and paste it into the Visual Editor. Around 20% of the articles have a double space after every single period. Feedback from the users tells me that some versions of these programs adds two spaces after full stop instead of one. I initially linked these users to tutorials of how to address this in the external application itself however the growth of the platform is making this a ridiculously exhausting task. **Is there a way to remove all double spaces and convert them into single space on the post page**? Maybe upon clicking publish. It would be ideal if it happened on the backend post page rather than the front end (through some styling fix) - although I am open to ideas. On a personal note, I find it quite astonishing that this feature is not a part of the core functions of Wordpress given that at least 20% of my authors are experiencing it.


title: Assigning the same custom meta box to multiple post types

text:
I currently have videos set up as a custom post type and I have also created a custom meta box for it that allows users to enter the ID of either a youtube/vimeo video - the video is then displayed on the front end. I want to re-use this meta box for another custom post type. How would I do this? The function for the current meta box is:               // Create the Video Information Meta Box by hooking into the admin menu for a post         add_action('admin_menu', 'video_add_box');                   function video_add_box(){         add_meta_box('video_information', 'Video Information', 'video_information', 'videos', 'normal', 'high');         }              //function to populate the meta box added above         function video_information(){         global $post;              // Noncename needed to verify where the data originated         echo '<input type="hidden" name="video_noncename" id="video_noncename" value="' .         wp_create_nonce( plugin_basename(__FILE__) ) . '" />';              //adds the custom field _youtubeID plus some other stuff         $youtubeID = get_post_meta($post->ID, '_youtubeID', true);         if ( empty($youtubeID) ) {         $youtubeID = '';         }              //adds the custom field _vimeoID         $vimeoID = get_post_meta($post->ID, '_vimeoID', true);         if ( empty($vimeoID) ) {         $vimeoID = '';         }              //add the box         echo '
';         echo 'Youtube ID:  <input type="text" name="_youtubeID" value="' . $youtubeID  . '" size="20" maxlength="30" />';         echo '
';         echo 'Vimeo ID:  <input type="text" name="_vimeoID" value="' . $vimeoID  . '" size="20" maxlength="30" />';         echo '
';         } //end video_information function              //save_video_meta is called below with the action "save_post" and saves your IDs to the post         function save_video_meta($post_id, $post) {         // verify this came from the our screen and with proper authorization,         // because save_post can be triggered at other times              if ( !wp_verify_nonce( $_POST['video_noncename'], plugin_basename(__FILE__) )) {         return $post->ID;         }              // Is the user allowed to edit the post or page?              if ( !current_user_can( 'edit_post', $post->ID )){         return $post->ID;         }              $video_meta['_youtubeID'] = $_POST['_youtubeID'];         $video_meta['_vimeoID'] = $_POST['_vimeoID'];         foreach ($video_meta as $key => $value) { // Cycle through the $video_meta array         if( $post->post_type == 'revision' ) return; // Don't store custom data twice              $value = implode(',', (array)$value); // If $value is an array, make it a CSV              if($value) {         update_post_meta($post_id, $key, $value);     } else          delete_post_meta($post_id, $key); // Delete if blank     }         } //end save_video_meta              //save the video custom fields         add_action( 'save_post', 'my_save_postdata' );     function my_save_postdata($post_id){         $video_meta['_youtubeID'] = $_POST['_youtubeID'];         $video_meta['_vimeoID'] = $_POST['_vimeoID'];         foreach ($video_meta as $key => $value) { // Cycle through the $video_meta array             if(  $_POST['post_type'] == 'revision' ) return; // Don't store custom data twice             $value = implode(',', (array)$value); // If $value is an array, make it a CSV                  if(get_post_meta($post_id, $key, FALSE)) { // If the custom field already has a value                 update_post_meta($post_id, $key, $value);             } else { // If the custom field doesn't have a value                 add_post_meta($post_id, $key, $value);             }             if(!$value) delete_post_meta($post_id, $key); // Delete if blank         }//endforeach video meta      }


title: Wordpress Defined Memory Limit

text: Running a dedicated managed server with 2 GIGS of RAM. How much memory can I define in `wp-config.php` Currently I have               define('WP_MEMORY_LIMIT', '256M');      I suspect a plugin that resizes images when they are being uploaded, that might cause the server to crash, but I am not sure yet. How can I allocate more memory for this plugin to operate? Many thanks Andy


title: Display selected parts from selected pages on the frontpage?

text: I'm build a site for my company and want to display four (of my choise) of our special deals on our frontpage. A special deal is a page. I want to grab:   * Featured Image   * Page Title   * Price (taking from a custom field or something)   * Read More (link to the page)   * +I want to be able to determine whether the page will be displayed on the frontpage or not. The sitemap look like this   * Home Our    * Special Deals      * Special Deal #1     * Special Deal #2     * Special Deal #3     * Special Deal #4     * Special Deal #5     * Special Deal #6     * Special Deal #7    * Info    * Contact Can someone help me with this?


title: Best way of getting a a series of custom fields into an array?

text:
I've a series of custom fields attached to certain pages. These fields are named slide1, slide2, side3, slide4, slide5, slide6. These are images which are going to be used as a slideshow (I'm using jflow slider for this - http://net.tutsplus.com/articles/news/using-the-wonderful- jflow-plugin-screencast/ ) (I don't want to call them all 'slide' and put them in an custom field array because there may be captions for each slide, and when both slides and captions are custom field arrays, the order may not match up) Now, sometimes there will be only 3 slides entered (slide1 to slide3), and sometimes all 6 slides (slide1 to slide6). Not being very PHP savvy, I wonder what the best way best way to stick these custom fields into a PHP array, and then iterate thru them to print out the code, which looks a bit like the below?

        The code to print, for instance slide1's image, would be something like:               <img src="<?php echo wp_get_attachment_url($slide1); ?>">


title: link wordpress and stackoverflow

text: how do i link stackoverflow widget in wordpress to my profile in stackoverflow to show badges, reputaions ??


title: Does WP show me if I'm logged in from multiple locations?

text: Does word press show me if I'm logged in in another location? Related: Limiting sessions to one IP at a time


title: How to set "lang" attribute for post/page title?

text: I am creating multilingual website in Urdu & English lanugage on Wordpress. Major part of site is in English. Only article's body (i.e paragraph & headings etc) are in Urdu. To assign Urdu fonts to urdu content, when writing article, I just switch to HTML Mode and insert lang="ur" attribute with elements and style them in CSS by :lang() pseudo selector. Now I get problem that how I can specifie lang attribute for Post/Page title? Any idea? I hope you will understand what I want to say. Thanks


title: How to add dynamic inline style?

text: I want to add dynamic CSS, so currently I am adding directly to the div, ie:               $color = "#000000";     echo '<div style="background:'.$color.'">      Is it bad to add code like above? I have read in some forum that it adds server burden and it is not recommended by WordPress coding standards. I should use `wp_add_inline_style()`. So I am trying to use that but it does not work. Here's what I'm trying: functions.php:               function add_custom_css() {             wp_enqueue_script('custom-css', get_template_directory_uri() . '/custom.css');                   }     }     add_action( 'wp_enqueue_scripts', 'add_custom_css' );      single.php               $color = "#000111";     $custom_css = "         .mycolor{                 background: {$color};         }";          wp_add_inline_style( 'custom-css', $custom_css );      It does not add any code in the custom.css file. What am I doing wrong?


title: Grouped custom taxonomy query

text: I have created   * 1 custom post types: image-gallery   * 1 custom taxonomy: media-category   * 2 categories (under Media Categories): categoria-uno and categoria-due I need to print the records grouped by category, example: Categoria uno   * record 1   * record 2   * record 3 Categoria due   * record 1   * record 2   * record 3 Anybody could please help me with this query? Thank you in advance


title: How to add editor's name to entry meta byline?

text: I have one multi-authored blog site and a few editors. What I want is to display the name of the editor along with the author's name in a post, so that it would read like: Posted by , Edited by Is it possible?


title: Returning website screenshot based on Custom Field

text: I am trying to return a screenshot from websites using this               <img src="<?php echo 'http://s.wordpress.com/mshots/v1/'.urlencode('http://domain.com/').'?w=200' ?>" />      This works fine for the current domain.com, I am trying to combine this with a custom field where I normally enter               <?php the_field('website'); ?>      I have tried the following               <img src="<?php echo 'http://s.wordpress.com/mshots/v1/'.urlencode(the_field('website'); ').'?w=200' ?>" />      But it doesn't seem to work. Any ideas? Thanks Richard


title: How to modify Media Library images DPI [ image quality down to make small in size ]

text: I wonder if there any code or hook out there to manage the image DPI, for example when we use photoshop or other image editing software we use export and image quality to 0-100%, now i am looking for a plugin or code to define the media library'r image DPI to make them small in size. This is i want store two version one with smaller size[DPI] and one for HD quality. Anyone Can help ?


title: How to use existing hook in twentytwelve to all theme of wordpress?

text:
I Recently tried to read the tutorial for `wp_footer` and also `twentytwelve_credits` for creating a sample wordpress plugins. `wp_footer` hook to display the footer beneath the page area. `twentytwelve_credits` hook display the footer in the page footer on a white background. **For Example:** I tried this code to show the footer with custom message.               <?php     function your_function() {         echo '
This is inserted at the bottom
';     }     add_action('wp_footer', 'your_function');     ?>      I tried this code after switching a theme to twenty twelve.               <?php     function your_function() {         echo '
This is inserted at the bottom
';     }     add_action('twentytwelve_credits', 'your_function');     ?>      I find the difference when using different hooks. `wp_footer` hook is working for all themes but it is in bottom of the site. `twentytwelve_credits` is working for the twentytwelve theme only. I beleive twentytwelve_credits is the efficient way rather than wp_footer. but its hard to change the hook for every theme. I am not sure is the way to show of the footer with every theme with twentytwelve_credits. Any Possibilities like `do_action('twentytwelve_credits');`. Any Suggestion would be great.


title: Post type to calendar

text: I have a custom post type called "events" How can I use the date on that post type to create a ics feed so users and subscribe to upcoming events?


title: Custom column for changing post status via ajax

text: I'm currently trying to implent a new custom column at the page manage screen that will let me change the status (published/pending) of the different pages via an easy toggle link. From what I've gathered I need to use $post->post_status, ' _status_ 'in someway, probably toggle with jQuery or something. But I can't figure out how I tie it together with ajax. Thought I'd get some help looking at the default post status modifier in the edit post screen, but I realized that it's not ajax based, I the status updates when you press "update" (obviously, duh). Here's my lousy try for an attempt so far:               function wp_change_page_status_link() {         $status = get_post_status($ID);         if($status == 'publish'){             $status = 'On';             //$post->post_status, 'pending'         }         elseif($status == 'pending'){             $status = 'Off';         }         return $status;     }      Would be really grateful if someone could point me in the right direction..


title: comment_form - show all fields when logged in

text: I'm using the http://codex.wordpress.org/Function_Reference/comment_form in my comments. If logged in I'm seeing only the textarea for my comment, **not the fields for e-mail and name.** **Question** Is it possible to make them visible even when logged in? Why would I want to do that? I'm designing themes and it would be easier for me as a designer to see what visitors see.


title: Fixing media links after importing to multisite

text: When i imported all posts and media from a old site to new site which on wordpress multisite. The image links on posts are got broken because how media are stored on a multisite is quite different from a single installation wordpress site. And also the links in the contents are static so it don't change when imported. Single installation example: `http://oldsite.com/wp-content/uploads/2010/07/image.jpg` Multisite installation example: `http://mysite.com/files/2010/07/image.jpg` So, you see if i can go through all posts replace old links with the new links in all image/media links it is going to work. We need to change the first part of the url. the name and the date of the media will be same as the importer will use the same publish date and name when imported. **My question is:** Is there any plugin which can do that? or some other way i can do it?


title: Limited number of paging to 10 "pages: 1 ... 10"

text:
How to limit the function of paging down to stop at number 10? Eg: pages: 1 2 3 4 5 6 7 8 9 10.               function kriesi_pagination($pages = '', $range = 2)     {        $showitems = ($range * 2)+1;             global $paged;      if(empty($paged)) $paged = 1;           if($pages == '')      {          global $wp_query;          $pages = $wp_query->max_num_pages;          if(!$pages)          {              $pages = 1;          }      }              if(1 != $pages)      {          echo "
";          if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "«";          if($paged > 1 && $showitems < $pages) echo "‹";               for ($i=1; $i <= $pages; $i++)          {              if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))              {                  echo ($paged == $i)? "".$i."":"".$i."";              }          }               if ($paged < $pages && $showitems < $pages) echo "›";            if ($paged < $pages-1 &&  $paged+$range-1 < $pages && $showitems < $pages) echo "»";          echo "
\n";      }     }      I appreciate any help.


title: How to add TinyMCE keyboard shortcut

text: The most thorough documentation I can find of how to add a new keyboard shortcut to TinyMC is at this page: http://www.lifeinsuranceonmyterms.com/other/custom-keyboard-shortcuts-for- tinymce-how-to It involves adding this code to the main TinyMCE source file, tiny_mce_src.js (and then recompressing):               t.addShortcut([keyboard command], [shortcut name], [command name]);      Is there a way to add a shortcut without hacking the core/TinyMCE? > Update: Specifically, I want to add shortcuts to apply h2/h3/h4 or other > TinyMCE button actions to selected text in TinyMCE.


title: Sort WP_Query by one meta key and post_date

text: I want to order by post to check for the existence of a meta key ('featured') and include those posts first and as a secondary option I want to sort by post_date, similar to 'sticky' posts on a discussion forum. I first tried this straightforward method ...               $args = array(       'store'         => 'walmart',       'post_type'     => 'post',       'showposts'     => '-1',       'orderby'       => 'featured date',       'order'         => 'desc',       'meta_key'      => 'featured'     );      It almost worked but instead of having the 'featured' posts at the top of the order it had them at the bottom, and no simple toggling could get it to work. I then researched some more and came across this method http://dotnordic.se/sorting-wordpress-posts-by-several-numeric-custom-fields/, but I can't get this to work for the life of me. I would prefer to use this filter as I have one other customization that this might help with, can anybody show me what I'm doing wrong. Here's what I have now ...               add_filter('posts_orderby','customorderby');     $args = array(         'store'         => 'walmart',         'post_type'     => 'post',         'showposts'     => '-1',         'meta_key'      => 'featured',         'meta_query'    => array(             array(                 'key' => 'featured'             )         )     );          $query = new WP_Query($args);     remove_filter('posts_orderby','customorderby');      and in my functions.php               add_filter('posts_orderby','customorderby');     function customorderby($arg) {         global $wpdb;              $arg = 'mt1.meta_value DESC, post_date+0 DESC';         return $arg;     }


title: Filter plugin posts by meta value

text: I am a WordPress beginner, but have a few years of software development experience. I have a WordPress plugin used to display custom data via a custom post type. The index page contains something like this to display this data:               <?php if ( have_posts() ) : ?>             <ul>                 <?php while ( have_posts() ) : the_post(); ?>                     <?php get_template_part( 'content', get_post_format() ); ?>                 <?php endwhile; ?>             </ul>              <?php endif; ?>      I need to filter this data based on the value of a cookie that corresponds to a meta value set on this post type. So in the `functions.php` of my plugin, I have something like this:               function modify_post_query($query)     {         if ($query->get('post_type') == 'my_post_type' && !is_admin())         {             if (isset($_COOKIE["my_key"]) && $_COOKIE["my_key"] == "val1")             {                 $query->set('meta_key', 'my_meta_key');                 $query->set('meta_value', 'meta_value_1');             }             else             {                 $query->set('meta_key', 'my_meta_key');                 $query->set('meta_value', 'meta_value_2');             }         }     }     add_filter('pre_get_posts', 'modify_post_query');      I got this mostly from this post. And it doesn't have any effect. I've already figured out that the cookie value is not available at this point in the page cycle (how to get at that data is a separate question), but that just means I'll always end up in the `else` case, and even that doesn't have any effect on what's being rendered in the list. And I know the `else` case is being executed, because I've added `error_log` statements to check. What am I doing wrong? What exactly needs to go where?


title: permalink /category/post-name with custom post type and taxonomy

text: I want to use custom post types with a custom taxonomy for different types of posts on my page. I have registered a custom post type called "portfolio" and a taxonomy for this post type.               function my_custom_post_portfolio() {       $labels = array(         'name'               => _x( 'Portfolio', 'post type general name' ),         'singular_name'      => _x( 'Portfolio-item', 'post type singular name' ),         'add_new'            => _x( 'Add New', 'portfolio' ),         'add_new_item'       => __( 'Add New Item' ),         'edit_item'          => __( 'Edit Item' ),         'new_item'           => __( 'New Item' ),         'all_items'          => __( 'All Items' ),         'view_item'          => __( 'View Item' ),         'search_items'       => __( 'Search Items' ),         'not_found'          => __( 'No items found' ),         'not_found_in_trash' => __( 'No items found in the Trash' ),          'parent_item_colon'  => '',         'menu_name'          => 'Portfolio'       );       $args = array(         'labels'        => $labels,         'description'   => 'Holds our portfolio items',         'public'        => true,         'menu_position' => 5,         'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt', 'comments' ),         'taxonomies'    => array('category'),               'has_archive'   => true,       );       register_post_type( 'portfolio', $args );      }     add_action( 'init', 'my_custom_post_portfolio' );              function add_custom_taxonomies() {         register_taxonomy('portfolioitems', 'portfolio', array(             'hierarchical' => true,             'labels' => array(                 'name' => _x( 'Portfolioitems', 'taxonomy general name' ),                 'singular_name' => _x( 'Item', 'taxonomy singular name' ),                 'search_items' =>  __( 'Search items' ),                 'all_items' => __( 'All items' ),                 'parent_item' => __( 'Parent item' ),                 'parent_item_colon' => __( 'Parent item:' ),                 'edit_item' => __( 'Edit item' ),                 'update_item' => __( 'Update item' ),                 'add_new_item' => __( 'Add new item' ),                 'new_item_name' => __( 'New item name' ),                 'menu_name' => __( 'items' ),             ),             'rewrite' => array(                 'slug' => 'portfolio',                 'with_front' => false,                 'hierarchical' => true             ),         ));     }     add_action( 'init', 'add_custom_taxonomies', 0 );      I have template files for both of them, a archive-portfolio.php, the "starting page" of the portfolio posts, a single-portfolio.php for the display of the single portfolio item, and a taxonomy-portfolioitems.php for displaying all posts related to one "tag" (technically a custom taxonomy item) It is working now fine, except that I get a 404 when trying to view the portfolio post. My permalink structure is: /%category%/%postname%/ and I have the FV Top Level Categories plugin active to remove the "category" (like /category/portfolio/portfolio-post) from the url. When I try to view my "normal" blog posts its working fine, the url is /blog/blog-categoryname/post-name But my custom post type items give me 404 when trying to call /custom-post- type/post-name (I have also a menu link called "portfolio" and its pointing to the category portfolio, which is registered with the custom post type.. could this be intefering somehow?) Thanks so much!


title: How do I do a page break?

text: Is there a way to add a page break into length pages? Preferably automatically, but doesn't really matter. Ideally without a plugin.


title: Where to replace short code

text:
Hey I am new to wordpress and web design in general. I just downloaded a plugin that helps edit navigation menus. The plugin is called Simple Responsive Menu. They are asking me to " Add shortcode in your theme(header.php) or replace your current menu.               [srMenu theme_location=primary]      OR               <?php echo do_shortcode('[srMenu theme_location=primary]');?>      The theme I am using is DonateNow, and would like to know what exactly in the header.php code I should replace. The header.php code is as follows:               <!DOCTYPE html>                         <html <?php language_attributes(); ?>>              <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />     <meta name="viewport" content="width=device-width, initial-scale=1">     <title><?php wp_title( '|', true, 'right' ); ?></title>     <link rel="profile" href="http://gmpg.org/xfn/11" />     <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />     <?php wp_head();            global $page, $post, $paged;             ?>               <body <?php body_class(); ?> >     <?php if (function_exists('AWM_generate_linking_code'))AWM_generate_linking_code(); ?>               <?php     $title_bg=get_post_meta($post->ID, "m_title_backgrounds", true);     $title_sub=get_post_meta($post->ID, "m_title_sub", true);     $title=get_post_meta($post->ID, "m_title_on", true);     $header=get_post_meta($post->ID, "madza_header_type", true);     $headerp=get_post_meta($post->ID, "m_page_background", true);      $_bacground_image_page=get_post_meta($post->ID, "m_page_background", true);      $breadcrumbs = get_post_meta($post->ID, "m_title_bred", true);     $pagination_navigation = get_post_meta($post->ID, "madza_portfolio_navigation", true);                    /*-----------------------------------------------------------------------------------*/     /*  BG IMAGE     /*-----------------------------------------------------------------------------------*/          $_background_exist = "no";     if ( $_bacground_image_page !="") { if (  $_bacground_image_page['background-image'] !="" ) { $_background_exist = "yes"; } }          $_background_exist_r = "no";     if ( $_bacground_image_page !="") { if ( $_bacground_image_page['background-repeat'] !="" ) { $_background_exist_r = "yes"; } }          $mt_homepage_bg = ot_get_option('mt_homepage_bg');      if (is_front_page()){           if ( ! empty( $mt_homepage_bg )) {               if ($mt_homepage_bg['background-repeat']=="" and $mt_homepage_bg['background-image']!=""){                        $mt_homepage_bg = ot_get_option('mt_homepage_bg');                       ?><img id="background" src="<?php echo $mt_homepage_bg['background-image']; ?>" alt=""  /><?php                   }         }     } else if ( $_background_exist == "yes" and $_background_exist_r ="no" ) {                     ?><img id="background" src="<?php echo $_bacground_image_page['background-image']; ?>" alt=""  /><?php                } else if($_background_exist == "no" and $_background_exist_r ="no") {                $mt_homepage_bg = ot_get_option('mt_defaultpage_bg');                   if ( ! empty( $mt_homepage_bg )) {                      if($mt_homepage_bg['background-repeat']=="") {                          ?><img id="background" src="<?php echo $mt_homepage_bg['background-image']; ?>" alt=""  /><?php                           }             }          }                                   function mt_logo() {              if(ot_get_option("theme_logo")!="") { $logo_image = ot_get_option("theme_logo"); } else { $logo_image = get_template_directory_uri()."/images/donatenow_logo.png";  }         if(ot_get_option("responsive_logo")!="") { $logo_image_responsive = ot_get_option("responsive_logo"); } else { $logo_image_responsive = get_template_directory_uri()."/images/donatenow_logo.png";  }              ?>         <a class="visible-desktop" style="margin-top:<?php if(ot_get_option("logo_style_margin")!="") { echo ot_get_option("logo_style_margin"); } else { echo "20"; } ?>px" id="logo" href="<?php echo home_url();?>">                  <img width="<?php if(ot_get_option("logo_style_width")!="") { echo ot_get_option("logo_style_width"); } else { echo "225"; } ?>" height="<?php if(ot_get_option("logo_style_height")!="") { echo ot_get_option("logo_style_height"); } else { echo "40"; } ?>" src="<?php echo $logo_image; ?>"  alt="<?php bloginfo('name'); ?>" />                            <a class="hidden-desktop" style="margin-top:<?php if(ot_get_option("logo_style_margin")!="") { echo ot_get_option("logo_style_margin"); } else { echo "20"; } ?>px" id="logo" href="<?php echo home_url();?>">                  <img  width="<?php if(ot_get_option("logo_style_width")!="") { echo ot_get_option("logo_style_width"); } else { echo "225"; } ?>" height="<?php if(ot_get_option("logo_style_height")!="") { echo ot_get_option("logo_style_height"); } else { echo "40"; } ?>" src="<?php echo $logo_image_responsive; ?>" alt="<?php bloginfo('name'); ?>" />                       <?php     }          add_filter('mt_logo','mt_logo');               function mt_social() {              ?>
 <?php                  if(ot_get_option('soc_facebook')!="") {?>
<a class="facebook" href="<?php echo ot_get_option('soc_facebook'); ?>">Facebook
<?php }              if(ot_get_option('soc_twitter')!="") {?>
<a class="twitter" href="<?php echo ot_get_option('soc_twitter'); ?>">Twitter
<?php }              if(ot_get_option('soc_vimeo')!="") {?>
<a class="vimeo" href="<?php echo ot_get_option('soc_vimeo'); ?>">Vimeo
<?php }              if(ot_get_option('soc_youtube')!="") {?>
<a class="youtube" href="<?php echo ot_get_option('soc_youtube'); ?>">Youtube
<?php }              if(ot_get_option('soc_linkedin')!="") {?>
<a class="linkedin" href="<?php echo ot_get_option('soc_linkedin'); ?>">LinkedIn
<?php }              if(ot_get_option('soc_google')!="") {?>
<a class="gplus" href="<?php echo ot_get_option('soc_google'); ?>">GooglePlus
<?php }              if(ot_get_option('soc_dribbble')!="") {?>
<a class="dribbble" href="<?php echo ot_get_option('soc_dribbble'); ?>">Dribble
<?php }              if(ot_get_option('soc_skype')!="") {?>
<a class="skype" href="<?php echo ot_get_option('soc_skype'); ?>">Skype
<?php }             if(ot_get_option('soc_delicious')!="") {?>
<a class="delicious" href="<?php echo ot_get_option('soc_delicious'); ?>">Delicious
<?php }              if(ot_get_option('soc_pinterest')!="") {?>
<a class="pinterest" href="<?php echo ot_get_option('soc_pinterest'); ?>">Pinterest
<?php }              if(ot_get_option('soc_yahoo')!="") {?>
<a class="yahoo" href="<?php echo ot_get_option('soc_yahoo'); ?>">Yahoo
<?php }              if(ot_get_option('soc_amazon')!="") {?>
<a class="amazon" href="<?php echo ot_get_option('soc_amazon'); ?>">Amazon
<?php }              if(ot_get_option('soc_rss')!="") {?>
<a class="rss" href="<?php echo ot_get_option('soc_rss'); ?>">Rss
<?php }               ?>
 <?php     }          add_filter('mt_social','mt_social');               function mt_header_html() {              ?>
<?php echo ot_get_option('mt_top_html'); ?>
<?php     }          add_filter('mt_header_html','mt_header_html');                    function mt_menu() {         wp_nav_menu( array('theme_location'=>"header_menu",  'menu_class' => 'sf-menu',  'menu_id' => 'menu', 'echo' => true, 'depth' => 0));           wp_nav_menu( array('theme_location'=>'select_menu', 'fallback_cb' => false, 'walker'=>new select_menu_walker(), 'items_wrap' => '<select class="select-menu" id="sec-selector" name="sec-selector" onchange="location.href = document.getElementById(\'sec-selector\').value;">%3$s</select>',  'container_id' => 'mobile_menu_secondary' ));     }          add_filter('mt_menu','mt_menu');                    function mt_menu_html() {              if(ot_get_option('right_area_search')=="html") { ?>

<?php do_action('icl_language_selector'); ?>

<?php echo ot_get_option('mt_menu_html'); ?>

              <?php  }      }          add_filter('mt_menu_html','mt_menu_html');          ?>          <?php if(get_post_meta($post->ID, "mt_style_header", true)!="style_default" and get_post_meta($post->ID, "mt_style_header", true)!="")  {?>                        <?php if(get_post_meta($post->ID, "mt_style_header", true)=="style_4") { ?>

<?php mt_logo(); ?>

<?php mt_menu_html(); ?>

<?php mt_header_html(); ?>

Donate Today!

<?php mt_menu(); ?>

              <?php } else if(get_post_meta($post->ID, "mt_style_header", true)=="style_2") { ?>

<?php mt_logo(); ?>

 <?php mt_menu(); ?>

Donate Today!

                                 <?php } else if(get_post_meta($post->ID, "mt_style_header", true)=="style_3") { ?>

<?php mt_logo(); ?>

 <?php mt_menu(); ?>

Donate Today!

                                 <?php } else  { ?>

<?php mt_logo(); ?>

                                  <?php mt_header_html(); ?>                             <?php mt_social(); ?>

Donate Today!

                              <div class="<?php if(ot_get_option('right_area_search')=="search") { echo "span12"; } else { echo "span8"; } ?>"><?php mt_menu(); ?>
                         <?php if(ot_get_option('right_area_search')=="search") { } else { ?>
<?php mt_menu_html(); ?>
<?php } ?>

              <?php } ?>          <?php } else { ?>              <?php if(ot_get_option("mt_style_header")=="style_4") { ?>

<?php mt_logo(); ?>

<?php mt_menu_html(); ?>

<?php mt_header_html(); ?>

Donate Today!

<?php mt_menu(); ?>

              <?php } else if(ot_get_option("mt_style_header")=="style_2") { ?>

<?php mt_logo(); ?>

 <?php mt_menu(); ?>

Donate Today!

                                 <?php } else if(ot_get_option("mt_style_header")=="style_3") { ?>

<?php mt_logo(); ?>

 <?php mt_menu(); ?>

Donate Today!

                                 <?php } else { ?>

<?php mt_logo(); ?>

                                  <?php mt_header_html(); ?>                             <?php mt_social(); ?>

Donate Today!

                              <div class="<?php if(ot_get_option('right_area_search')=="search") { echo "span12"; } else { echo "span8"; } ?>"><?php mt_menu(); ?>
                         <?php if(ot_get_option('right_area_search')=="search") { } else { ?>
<?php mt_menu_html(); ?>
<?php } ?>

              <?php } ?>          <?php } ?>          <?php     /*-----------------------------------------------------------------------------------*/     /*  Slider     /*-----------------------------------------------------------------------------------*/     if (is_front_page()){                  if(ot_get_option('home_slider_type')=="home_slider_flex"){                            function_slider_flex();                   }                   if(ot_get_option('home_slider_type')=="home_slider_shortcode"){                          echo '
';  echo do_shortcode(ot_get_option('home_slider_shortcode_code')); echo "
";              }          } else {                       if(get_post_meta($post->ID, "mt_page_slider_type", true)=="flex_slider"){                           function_slider_flex();              }                   if(get_post_meta($post->ID, "mt_page_slider_type", true)=="shortcode_slider"){                           echo '
'; ;  echo do_shortcode(get_post_meta($post->ID, "mt_page_slider_shortcode", true));  echo "
";                   }     }           ?>          <?php if ( !is_front_page() and $title=="on" or !is_front_page() and $title=="" ) { ?>               <div id="header-title" <?php if( $title_bg != "" or ot_get_option("title_background") != "" ) {  ?>              style="background-image: url(<?php if( $title_bg == "" ) { echo ot_get_option("title_background"); } else { echo $title_bg; } ?>)!important; background: center; "<?php } ?>>

                              <?php if (is_singular("tribe_events")) {  ?>

<?php the_title(); ?>

<?php next_post_link('%link','

'); previous_post_link('%link','

');  ?>
                                   <?php } else if (is_singular("portfolio") ) {  ?>

<?php the_title(); ?>

<?php next_post_link('%link','

'); previous_post_link('%link','

');  ?>
                                   <?php } else if (is_singular('causes')){ ?>

<?php the_title(); ?>

<?php next_post_link('%link','

'); previous_post_link('%link','

');  ?>
                              <?php } else if (is_single()){ ?>

<?php the_title(); ?>

<?php next_post_link('%link','

'); previous_post_link('%link','

');  ?>
                               <?php } else if (is_search()){ ?>

<?php printf( __( 'Search Results for: %s', "madza_translate"  ), '' . get_search_query() . '' ); ?>

                              <?php } else if (is_404()){ ?>                                   <divclass="span8">
<?php printf( __( '404 page', "madza_translate"  ) ); ?>

                              <?php } else if (is_category()){ ?>

<?php single_cat_title( $prefix = '', $display = true ); ?>

<?php if ( ot_get_option('bredcrumb')=="on" AND $breadcrumbs == "on"){  dimox_breadcrumbs(); } ?>
                              <?php } else if (is_tag()){ ?>

<?php single_cat_title( $prefix = '', $display = true ); ?>

<?php if ( ot_get_option('bredcrumb')=="on" AND $breadcrumbs == "on"){  dimox_breadcrumbs(); } ?>
                              <?php } else { ?>

<?php                                   if(function_exists( 'tribe_is_event' ) ) {                                           if (tribe_is_event() && !tribe_is_day() && !is_single()) {                                                    printf( __( 'Events', "madza_translate"  ) );                                            } else {                                                   the_title();                                      }                                   } else {                                       the_title();                                   } ?>

<?php if ( ot_get_option('bredcrumb')=="on" AND $breadcrumbs == "on"){  dimox_breadcrumbs(); } ?>
                              <?php } ?>

            <?php } ?>

 <?php           Any and all help is appreciated. Thank You!


title: Developing, Testing and Releasing

text: How do you develop, test and deploy-to-live your Wordpress sites? Its always a bit of a faff I find, especially where databases are concerned - mainly due to the fact that having a testing site needs a whole new database to be deployed which can sometimes be EXACTLY the same, except all the links are changed to the testing site url, instead of the live site. Similarly any uploads that users have uploaded since the last time you needed to fix a bug or develop something new will have to be copied across to the testing site. How do others do it? Do you just put up with the faff? Do you use clever version control systems which help? Thanks


title: Using Subversion to deploy WordPress

text: I use Subversion with my websites. Up until now, this has meant creating a new repo for each of my sites. However, this is wholly inefficient as it means me lugging around the whole WordPress source for each of the sites. It also has meant that I have to copy plugins between repos and thus duplicate the code each time. So what I wanted to do was have a repo which only really contained my theme file (and possibly other site-specific directories such as site-specific plugins). This would then have a link to the tagged WordPress repository for the WordPress version I would be building against and a link to my other shared plugin repos, so that in order to release or deploy for testing I would only have to do a `svn checkout svn://path/to/site/repo` and it would download the whole WordPress repo, all my plugins and all the site-specific stuff too. Is there any way to do this? Or is this a bad idea? Is there an easier/better way to do this at all? How do others do it?


title: Why are authors allowed to approve comments on their posts? How to revoke privilege?

text: I was under the impression that only admins/editor roles can approve comments however our authors are able to do so as well on their own posts. I want to disable the ability for an author to approve comments on their posts. Under dashboard settings > discussions > Before a comment appears-- Selected: Comment must be manually approved   Unselected: Comment author must have a previously approved comment


title: get_post_meta slowing down my page load (in a plugin)

text: I've been working on this project where I need to load events (custom post type) and a whole bunch of meta data for every event. The problem is that page loading times are getting longer and longer when more and more events get added. At the start with only a few events this wasn't a problem at all, but now when there are 100+ events in the system page loads take up to 6 seconds which is too long. Example of what I'm doing: Show all the events in the system (All below is done inside a plugin) I load all events with get_posts and specify the custom post type. I loop through all the posts and get all the meta data with `get_post_meta` in a single call. When testing where the bottleneck was, I found out that when I remove `get_post_meta` execution time went down from 4.5 seconds to 14ms. I also tested what would happen if I load every meta data separately like so: `get_post_meta($post->ID, "meta_value", true);` If I have a view where I only need a few meta values this speeds up the process to where I could cut 20% of the loading time, but when I need almost all, there was no change in loading times. I also noticed that using `get_post_custom` doesn't really help in this case. After looking around online (here, blogs, etc..), people pointed out that when you do a `get_posts`, all meta data is automatically retrieved and cached. But it seems this isn't true when I look at the execution time and amount of queries that are processed. Is there any way of speeding this up further via php/mysql? One thing I was thinking of was: is there a way of getting all posts and meta data for each post in a single call. But I didn't have any luck of finding something online that would help me achieving this.


title: Get value of a key from a Plugin Serialized array

text:
I want to get details about a plugin hosted on WordPress.org Repository by making a call to API at http://api.wordpress.org/plugins/info/1.0/ I have pasted below the code I used and the output. I am not good with PHP and just wanted to know the way to retrieve and output just one piece of information from the array such as Download count.               $payload = array(       'action' => 'plugin_information',       'request' => serialize(         (object)array(             'slug' => 'i-recommend-this',             'fields' => array(                 'downloaded' => true,                 'description' => false                      )          )        )     );     $body = wp_remote_post( 'http://api.wordpress.org/plugins/info/1.0/', array( 'body' => $payload) );          var_dump( unserialize($body['body']) );      This outputs data in below way:               object(stdClass)[320]       public 'name' => string 'I Recommend This' (length=16)       public 'slug' => string 'i-recommend-this' (length=16)       public 'version' => string '2.4.2' (length=5)       public 'author' => string 'Harish Chouhan' (length=57)       public 'author_profile' => string 'http://profiles.wordpress.org/hchouhan' (length=38)       public 'contributors' =>          array           'hchouhan' => string 'http://profiles.wordpress.org/hchouhan' (length=38)           'dreamsonline' => string 'http://profiles.wordpress.org/dreamsonline' (length=42)           'dreamsmedia' => string 'http://profiles.wordpress.org/dreamsmedia' (length=41)           'Benoit "LeBen" Burgener' => string '' (length=0)       public 'requires' => string '3.3' (length=3)       public 'tested' => string '3.5.2' (length=5)       public 'compatibility' =>          array           '3.6' =>              array               '2.4.0' =>                  array                   ...               '2.4.2' =>                  array                   ...       public 'rating' => float 92.4       public 'num_ratings' => int 13       public 'downloaded' => int 7673       public 'last_updated' => string '2013-08-25' (length=10)       public 'added' => string '2012-04-25' (length=10)       public 'homepage' => string 'http://www.harishchouhan.com/personal-projects/i-recommend-this/' (length=64)       public 'sections' =>          array       'description' => string '
This plugin allows your visitors to simply like/recommend your posts instead of comment on it.

This plugin includes

A counter to display the number of "like" and to vote.

A widget and a function to display the X most liked posts.

A preference pane with some options.

Saves Cookie as well as users IP address to disable voting on the same post again

Advanced Options

Hide count if count is zero

Set a default messages w'... (length=1694)           'installation' => string '

Upload the directory /i-recommend-this/ to the /wp-content/plugins/ directory

Activate the plugin through the 'Plugins' menu in WordPress

Click on the Settings link below the plugin name on the plugins page

To display the recomment/like link other than at the bottom of individual post, you would have to add below code in your template

<?php if( function_exists('dot_irecommendthis') ) dot_irecommendthis(); ?&#62'... (length=586)           'changelog' => string '
= 2.4.2     * Bug fix. Thanks to @mmaxim

= 2.4.1     * Fixed undefined index error.

= 2.4.0     * Added filter dot_irt_before_count to be able to allow custom content or icons before the count.

= 2.3.0     * Added option to hide count if count is zero     * Added option to disable saving of IP address in the database

= 2.2.0     * Added option to customize the link title. You can now remove the word recomment and add anything you like. Ideas suggested by Krystina Montemurro.

= 2.1.5     * Sup'... (length=2216)           'faq' => string '
Take a look at the official "I Recommend This" FAQ.

You can also visit the support center and start a discussion if needed.
' (length=294)       public 'download_link' => string 'http://downloads.wordpress.org/plugin/i-recommend-this.2.4.2.zip' (length=64)       public 'tags' =>          array           'dribbble-like' => string 'dribbble like' (length=13)           'heart' => string 'heart' (length=5)           'like' => string 'Like' (length=4)           'love' => string 'love' (length=4)           'post' => string 'Post' (length=4)           'rate' => string 'rate' (length=4)           'rating' => string 'rating' (length=6)           'recommend' => string 'recommend' (length=9)


title: Listing registered scripts

text: Back story : We have a number of wordpress web sites experiencing issues when viewed on _some_ IE8 browsers. The errors include the page loading but not being displayed (either a blank screen is displayed or the previous page isn't cleared), we think it's down to IE8 and Javascript but want to test that by deregistering each script until 1) it works or 2) we run out of scripts to deregister. So to the questron : is their an API call that will list the handle of every front end registered script? I have a back-up of the site's including themes and plugings so I could grep them but I may well miss something and, being lazy, I was hoping I could get wordpress to generate the list for me.


title: How do I set a custom WordPress update repository?

text: I'm co-authoring a white paper on utilising WordPress as a foundation for a web-app, I would like to change the repository that the core WordPress updates from, the latest additions of automatic updates in 3.7 are very nice, but how would I go about pointing some installations at a custom server repository of mine? I understand the principals behind custom plugin and theme repositories, but updating the core is a necessity. I think that it queries api.wordpress.org, but what about the server-side code? Is this available anywhere? If this isn't possible, how would I go about having my WordPress core fetch updates through another manner? Using git/SVN on these other installs won't be an option unfortunately and neither will deploying to them directly, it needs to be via the internal WordPress protocols as this whole paper is about showing that WordPress is a very solid foundation to build upon. I guess you could consider this a custom fork of WordPress aimed at office usage. Thanks in advance, Hamual


title: Gravity Forms Salesforce field mapping for custom objects

text: I'm using the Gravity Forms plugin on my site, along with the Gravity Forms Salesforce plugin, which connects the forms to Salesforce. I can set a dropdown box to populate with choices from Salesforce, but I don't see how to let it use custom objects. Does anyone know how to do that?


title: Active menu also for single array

text:
For our (new) website I figured out how to make menu's active. The only problem is that I want multiple pages, singles and categories under one active menu (just to remind people in what section they are). How do I get this working? Example: Below the menu gets the status 'active' when viewing the category- app-functies.php.
                        <li<?php if ( is_category('app-functies')) { echo ' class="current"'; } elseif ( is_singular( 'augmented-reality' )) { echo ' class="current"'; } ?>><a href="<?php echo site_url(); ?>/app-functies/">App Functies

      Also when viewing url.com/app-functies/X/ I like to make the menu active aswell. Is this possible?


title: using wp_update_post for updating custom post type

text: I'm trying to update post_parent of wp_posts in WordPress database. I've created a custom post type with capability_type = post , but I want it to behave like a page: hierarchical, allowing parent to be specified. Since I'll have a lot of entries, I couldn't set my custom post type as **hierarchical**. So I decided to update manually my custom post type **post_parent** entry. **From the codex :** > Note for hierarchical: this parameter was planned for Pages. Be careful, > when choosing it for your custom post type - if you are planning to have > many entries (say - over 100), you will run into memory issue. With this > parameter set to true WordPress will fetch all entries of that particular > post type, together with all meta data, on each administration page load for > your post type. Here is my code: I tried `$wpdb->update`, but no success               if( get_field('_page_parent') )     {         $infos_page = get_field('_page_parent');              $parent_id = $infos_page[0];              // $wpdb->update( $table, $data, $where, $format = null, $where_format = null );               //$wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE ID = %d", $parent_id, $child_id);               $my_post_infos = array(               'ID'          => $child_id,               'post_parent' => $parent_id           );                // unhook this function so it doesn't loop infinitely             remove_action('save_post', 'set_dossier_parent');                  // update the post, which calls save_post again             wp_update_post( $my_post_infos );                  // re-hook this function             add_action('save_post', 'set_dossier_parent');          }      Any help would be greatly appreciated.


title: Wp Nav Menu div containers

text:
Hi I'm wanting to create a custom navigation menu that will require creating div containers to hold the SUB-MENU set. In other words I want to do this:

             Kurumsal

Hakkımızda

Misyon Vizyon

Satın Alma

Kariye

Bayilik Başvurusu

             Ürünlerimiz

İnce Taneli Kumlar

İri Taneli Kumlar

Yalıtım Malzemeleri

Yapı Kimyasalları

      How would I go about adding this into the wp_nav_menu function? Do I add a filter in functions.php, or do I create a separate PHP file to do this? Any helpful suggestions would be greatly appreciated.


title: Show Custom Post Type Results

text:
Hopefully someone can help me here. I have a custom post type and with this post type I am able to show the title in a select option. Now what I want to happen is when that title is selected it will show the rest of the content in a results div. I am actually able to achieve this but it does not show one result at a time, it will instead show multiple instances of the same post type. Below is what I have so far:                //Create and Register Post type     function dh_productcomparison_post_type() {     $labels = array(          'name'               => _( 'Product Comparison' ),         'singular_name'      => _( 'Product Comparison' ),         'all_items'          => __( 'Product Comparison' ),         'view_item'          => __( 'View Products' ),         'parent_item_colon'  => 'Product Comparison:',         'menu_name'          => 'Product Comparison'     );     $args = array(          'labels'        => $labels,         'taxonomies' => array('category'),         'public'        => true,         'show_in_menu'  => 'edit.php?post_type=dh_products',         'supports'      => array( 'title', 'editor', 'thumbnail' ),         'has_archive'   => true,     );     register_post_type(__( 'dh_productcomparison' ), $args);      }     add_action( 'init', 'dh_productcomparison_post_type' );               // Post type shortcode to use on wp page.     function dh_productcomparison_shortcode( $atts ) {          // define attributes and their defaults     extract( shortcode_atts( array (         'type' => 'post',         'order' => 'date',         'orderby' => 'title',         'posts' => -1,         'category' => '',     ), $atts ) );          $args = array(         'post_type' => 'dh_productcomparison',         'orderby' => 'title',         'order' => 'ASC',         'posts_per_page'=> -1,         'category_name' => $category,     );     $productcomparison = new WP_Query( $args );     if( $productcomparison->have_posts() ):         $output .='<form action="" method="post" id="product-cmp">';         $output .='<select name="category" id="category">';         while ( $productcomparison->have_posts() ) : $productcomparison->the_post();                 $output .= '<option value="'.get_the_title().'">' . get_the_title() .'</option>';         endwhile;         $output .='</select>';         $output .='<input type="submit" name="submit" id="submit" class="submit" value="Search"/>';         $output .='</form>';         $output .= '
';         foreach ( $productcomparison as $result ) : setup_postdata( $result );                 $output .= get_the_title();         $output .= get_the_post_thumbnail( $productdisplay->post->ID, 'medium');         endforeach;          $output .= '
';          endif;     wp_reset_postdata();     return $output;     }     add_shortcode( 'productcomparison', 'dh_productcomparison_shortcode' );      UPDATE: I think I might have figured this out, but if someone sees a better way of doing this, please let me know. Basically I am just running the "while" loop again and in the "while" loop if the posted "posted" category is equal to the wp title, come back true.               while ( $productcomparison->have_posts() ) : $productcomparison->the_post();             if($_POST['category'] == get_the_title()){                     $output .= '
';                          $output .= get_the_title();             $output .= get_the_post_thumbnail( $productdisplay->post->ID, 'medium');                     $output .= '
';             }                     endwhile;


title: Theme Options: If There is No Input, Don't Display?

text: I have built a custom options panel which allows site owners to enter their social profiles. I then use the second code to make the links appear in the theme. **When no link is entered in the options panel, I would like there to be no link called on the page where the code is being called. Currently, it provides me with a link to the homepage of my site.** Take a look: http://themeforward.com/demo2/ \- the green box is the facebook link, the purple is the google link I know what you're thinking - why not just leave it the way it is? Because, I'm styling each link with a background image rather than using normal text links... so if I just leave it this way we will still have an image showing up advertising a social site presence, but it won't be linked. The styling can be found here: http://pastebin.com/m3PrBDae I think that may be affecting this. In my functions               array( "name" => "Facebook Page",         "desc" => "Enter your Facebook address. (Must include http://)",         "id" => $shortname."_facebook",         "type" => "text",         "std" => ""),          array( "name" => "Google Plus",         "desc" => "Enter your Google Plus address. (Must include http://)",         "id" => $shortname."_google_plus",         "type" => "text",         "std" => ""),      How I call them               <a href="<?php echo get_option('to_facebook'); ?>">     <a href="<?php echo get_option('to_google_plus'); ?>">


title: Help with enqueing scripts in footer after init action

text: In my functions.php, I have set a register_scripts() and load_scripts(), and hooked them to the 'init' action. I have registered all the scripts to be loaded in the footer, in order to optimize page load. Some of the scripts I've registered in register_scripts() are not enqueued in load_scripts() because I only want to load them when / if they are needed. So for example, if the page being rendered includes the template part 'gallery.php', which needs 'jquery-gallery', I would like to enqueue it from that file, but only after the rest of the footer scripts have been loaded. I also need to do this with inline scripts. Hope I explained myself well... If not please ask.


title: Styling last item in ul

text:
I'm looking to format the bullets for the last item of the list. I'm using Firebug to pinpoint where the menu item is and I have two options in front of me: Screenshot 1 Screenshot 2 - Includes bullet Now I'm looking at either using CSS or jQuery to select the last item. I tried using this CSS and it applies to the last TWO items.               ul.children li:last-child{      color: red;      list-style-type: circle;     }      Screenshot 3 - Output I'm thinking maybe I need to use jQuery but I haven't had luck with that either. * * * Here is my custom walker that displays $output:               $output .= $indent .      '

ID) . '" title="' .      esc_attr( wp_strip_all_tags( apply_filters( 'the_title', $page->post_title,      $page->ID ) ) ) . '">' .      $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) .      $link_after . '' . $MetaOutput . '
';      I'm going to make a conditional that asks if $MetaOutput's children = 0 , apply this style. I am going to try and make a class for the * at the beginning. Ideally, I'd like to replace the list-style-image for each li class. I'll edit this again and let you know how it goes.


title: Need help changing back the correct wordpress url

text: Hello I've just recently installed wordpress today on a development linux server. Everything seemed ok until when I stupidly changed the wordpress url. Initailly it was just http://localhost/ but I changed that to http://localhost/wordpress in the settings area. Now I cannot seem to login again, because everytime I login, it takes me to a page 404 error. So is there another way to change the wordpress url?


title: Vimeo Froogaloop API, working in Fiddle but not WP

text:
I'm trying to harness Vimeo's Froogaloop API to pause video embeds whenever a user clicks a certain element. I have it working perfectly in my Fiddle but it wont work in my Wordpress environment. I took some code from this thread to create a simplified version of the site I'm working on; **HTML**

          Pause      **jQuery**               function pauseAll() {     $('iframe[src*="vimeo.com"]').each(function () {         $f(this).api('pause');     });     }      As I say, it works perfectly in my Fiddle but not in my WP based site It also seems to just be Google Chrome where it doesn't work in WP which is making me scratch my head even more. If anyone has any ideas it would be a great help.


title: Redirect old permalinks to new permalinks

text: I changed the permalink structure from `/%category%/%postname%/` to `/%year%/%monthnum%/%postname%//` How can I redirect all old posts to the new ones (eg: via htaccess)?


title: How to display the names of users from a specific group with a shortcode?

text: I have in the database a table with the `user_id` and corresponding `group_id` values, so each row contain the ID of the user that is a member of a group and the related group ID. **The question is** : How to display the names of users from a specific group, plus some metadata, with a shortcode, for example `[group_members group_id=1]`? With the bellow function, that I try to adapt for this without success, I can to display only the user ID or the group ID.               add_shortcode( 'group_members',  'group_members_shortcode_handler' );          function group_members_shortcode_handler ( $atts, $content = null ) {                global $wpdb;       $querystr = "SELECT * FROM wp_groups_user_group";       $users = $wpdb->get_results($querystr, OBJECT);            foreach ($users as $user) {         $output .= $user->group_id;       }           return $output;     }


title: Search Page Returns Nothing

text:
I'm currently working on this website and a test shows that the search page isn't working properly. Every time someone searches for something, it comes up blank. The code for the search page is as shown below. **Search Form:**               <form role="search" method="get" id="searchform" action="/search/" >
Search for:         <input type="text" value="" name="s" id="s" />         <input type="image" src="<?php bloginfo('stylesheet_directory'); ?>/images/searcher1.png"id="searchsubmit" value="Search" />
         </form>       **Search Page:**               <?php         if ( isset( $_REQUEST[ 'search' ] ) ) {             // run search query             query_posts( array(                 's' => $_REQUEST[ 'search' ],                 'post_type' => $_REQUEST[ 'post_type' ],                  ) );                  // loop             if ( have_posts() ) : while ( have_posts() ) :                 // loop through results here             endwhile; endif;                  // return to original query             wp_reset_query();         }


title: delete post meta from db, even if does not exist?

text: it is not the first i see that we "delete" a post meta even if it does not exist : example :                   $count = get_post_meta($postID, $count_key, true);         if($count==''){             $count = 0;             delete_post_meta($postID, $count_key);             add_post_meta($postID, $count_key, '0');      So if $count is empty, so if it does not exist in the database, we first delete the post meta? Why ? Thanks for your answer


title: If searched in a category show different 404 page

text: Is this possible? I have a `searchform` that searches for certain categories. If there is no post, it will show me a `404 page`... Can I change this page to something else? If so, how do I do that?


title: Change Wordpress comments url / word

text: Is this possible? For example, I want to change               http://mysitesitesite.com/post-name/comment-page-1/#comment-452      to               http://mysitesitesite.com/post-name/custonname-1/#customname-452      What should I do to get it working? Is there any chance to fix this?


title: wp_enqueue doesn't load dependencies

text: I'm trying to load style.css but rest.css should be included first. I don't understand why reset.css is not included               function addMyScript() {         wp_register_style('style', get_template_directory_uri().'/style.css');         wp_register_style('reset', get_template_directory_uri().'/reset.css');         wp_enqueue_style('style', get_template_directory_uri().'/style.css', array( 'reset' ),  );     }     add_action('wp_head', 'addMyScript');      Also I've seen on some blogs that people often don't register the stylesheet or javascript before to enqueue... is that ok?


title: What table is the media's sort order stored?

text: I see that your can sort media by a numbered order in the media gallery for a post. But what table is this order stored in? I want to use this order to also order the images the same way in my posts.


title: jQuery is not defined

text: jQuery is not defined      When I try to edit a post, rearange categories the "jQuery is not defined" keeps poping up in firebug. But If I change my theme to another it allows me to change the categories and stuff like that. I checked my functions.php there is no line about jquery...


title: Preset Widgets ONLY after site is initially created

text: I want to preset some widgets using functions included in my theme ONLY after a site is initially created (my theme is the default for all new sites in my instance of WordPress). I DO NOT want my preset widgets to replace existing widgets when a user activates my theme UNLESS their existing widget areas are different from those in my theme. I've modelled my widgets_init function on the one found in the Thematic theme framework. Thematic adds preset widgets using the following conditional:               if ( isset( $_GET['activated'] ) )      Thus when Thematic is activated, it wipes out existing widgets and adds its own preset widgets... I want my theme to use existing widgets if they are in widget areas my theme supports (i.e. a user switches from one child theme to another, both of which use my theme as their parent) I know there is register_activation_hook but that seems to be designed for plugin functions and not functions included in themes... Here are questions:   1. Is there an action that is run ONLY after a site has been initially created?    2. Alternatively are their conditions I can check to determine whether a site has just been created?


title: How to import database table as custom post type and custom fields?

text:
I have a sql table that contains vehicle information. When I import the database table to my WordPress website, I need the information to be imported as custom fields for a custom post type. For example, I created the vehicle custom post type and the custom fields:               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'vehicle',             array(                 'labels' => array(                     'name' => __( 'Vehicles' ),                     'singular_name' => __( 'Vehicle' )                     ),                 'public' => true,                 'has_archive' => true,                 )             );      }          add_action("admin_init", "admin_init");          function admin_init() {         add_meta_box("vehicle_info-meta", "vehicle Information", "vehicle_info", "vehicle", "normal", "low");     }          function vehicle_info() {         global $post;         $custom = get_post_custom($post->ID);         $stockNumber = $custom["stockNumber"][0];         $vin = $custom["vin"][0];         $make = $custom["make"][0];         ?>
Stock Number:         <input name="stockNumber" value="<?php echo $stockNumber; ?>" />

Vin Number:         <input name="vin" value="<?php echo $vin; ?>" />

Make         <input name="make" value="<?php echo $make; ?>" />
         <?php     }          add_action('save_post', 'save_details');          function save_details() {         global $post;              update_post_meta($post->ID, "stockNumber", $_POST["stockNumber"]);         update_post_meta($post->ID, "vin", $_POST["vin"]);         update_post_meta($post->ID, "make", $_POST["make"]);     }      Now that the custom post type is created, when I import my database table, I need a new vehicle post to be created for each vehicle in the database table. I also need the custom fields for each vehicle to be populated.


title: How would I use this filter to change the output of the date format to "Twitter time"?

text: I'm using a plugin called Latest Tweet Widget to display the latest tweet. The tweet date gets displayed by the month and day (Mar 22). However, I want it to be in "Twitter time" meaning words like "3 days ago, 1 hour ago, etc.". I asked the developer of the plugin at the WordPress forums and he said that I need to "use the `latest_tweets_render_date` filter to perform my own relative date representation." The filter in question is here under the "Custom HTML" section (also quoted below): https://wordpress.org/plugins/latest-tweets- widget/other_notes/#Theming               add_filter('latest_tweets_render_date', function( $created_at ){         $date = DateTime::createFromFormat('D M d H:i:s O Y', $created_at );         return $date->format('d M h:ia'); }, 10 , 1 );      However, I am new to PHP and unable to understand what exactly needs to be written in order for "Twitter time" to work. Can somebody please show me the way?


title: Can't order the query result as given posts id's array

text: I want to order a query result by the same order as the post id's array given. E.g. I have:               $arrayPostsIds = array(30,5,17,10);      and I want to get the posts in that order. So after trying this:               add_filter('posts_orderby', 'edit_posts_orderby');          function edit_posts_join_paged($join_paged_statement) {         global $arrayPostsIds_id;         $join_paged_statement = 'FIELD(ID,'.implode(',',$arrayPostsIds).')';         return $join_paged_statement;        }      and then I get the new result, which should match the above order:               $temp = $wp_query; // assign ordinal query to temp variable for later use       $wp_query = null;     $wp_query = new WP_Query( array( 'post__in' => $arrayPostsIds, 'ignore_sticky_posts' => true, 'date_query' => $date_query ) );       but I'm getting the result **ordered by ID** , so it's not keeping the desired order. Am I forgetting anything?


title: Excluding posts from a category but only if they're not in multiple categories

text: I am looking to exclude a category in Wordpress. I am referring to the Wordpress Codex page on `wp_query` but I am having the following problem:   1. I want to exclude posts from category 1,   2. but if a post is in category 1 and category 2 (or any other category other than 1), then I still want it to show. So, I only want posts to be excluded if they're exclusively in category 1.


title: Hierarchy in multisite

text: I'm looking into building a multi site (sort of like blog portal) but with a hierarchy. So there's a mother organization (with own content) with different "chapters" (say 10, each with own content) and then each chapter have "bloggers". So on a blog it should read "Part of chapter X" and a list of other bloggers in the same chapter. So I need a way to group the bloggers and put them in a hierarchy. I'm not sure about the URL structure but some bloggers will have own top domains but most will have subdomains (WordPress MU Domain Mapping will help with this). I'm looking for some thoughts about how this could be solved, as well as tips on plugins. I found Network Sites Hierarchy: http://wordpress.org/extend/plugins/wpmswpmu- network-sites-hierarchy/ which looks promising but has very little activity. Also WP Multi Network http://wordpress.org/extend/plugins/wp-multi-network/ seems to be of help. Any help before I jump into the "install and test a bunch of plugins"-phase is highly appreciated. Thanks! Dennis