title: Wordpress Child Category Display All Posts

text:
I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it only shows the 5 most recent posts in the child category instead of all of them. In my Wordpress account I have 7 posts which should be displaying. How should I retrieve the posts so it displays them all.
           <?php     $categories = get_categories( 'child_of=2' );       foreach  ( $categories as $category ) {              echo '

'.$category->name.'

';              $cat_posts = get_posts( 'cat='.$category->term_id );         $end = count( $cat_posts ) - 1;         $i = 0;         foreach ( $cat_posts as $post ) {             setup_postdata( $post );             $face = get_field( 'face' );             $name = get_field( 'fullname' );                  if ( $i % 6 === 0 ) {                 echo '
';             }           echo '
';                  echo wp_get_attachment_image($face)                 . '
'.$name.'
';                  echo '
';                     if ( $i % 6 === 5 ) {                 echo '
';             }                    $i++;         }     }?>
      //css               div.grid-row {         width: 100%;             height: 100%;         position: relative;         overflow: hidden;     }     div.obj{     float: left;         position: relative;         padding-right: 10px;     }     .faces{         width: 1000px;          }      ![enter image description here](http://i.stack.imgur.com/3y6si.png) ![enter image description here](http://i.stack.imgur.com/AbzyI.png) ![enter image description here](http://i.stack.imgur.com/BYDpB.png) REVISED TO POST BELOW: ![enter image description here](http://i.stack.imgur.com/TISUl.png) REV FOR POST BELOW:               <?php     $categories = get_categories( 'child_of=2' );       foreach  ( $categories as $category ) {              echo '

'.$category->name.'

';         $args1 = array( 'posts_per_page' => -1, 'cat='.$category->term_id );         $cat_posts = get_posts( $args1 );         $end = count( $cat_posts ) - 1;         $i = 0;         foreach ( $cat_posts as $post ) {         $post_category = get_the_category($post->ID);         if($post_category->cat_name == $category->name){             setup_postdata( $post );             $face = get_field( 'face' );             $name = get_field( 'fullname' );                  if ( $i % 6 === 0 ) {                 echo '
';             }           echo '
';                 echo '
';            echo wp_get_attachment_image($face);            echo '
';               echo '
';               echo $name;               echo '
';                  echo '
';                     if ( $i % 6 === 5 ) {                 echo '
';             }             }                    $i++;              }     }?>


title: WP_Query retrieve custom posts but not the post showing

text: I am developing a custom post type which shows releated posts which are within the category which is working perfect but I cant seem to get the right query to make it not show the current post which is being viewed. The code I have at present is:               $args = array(             'post_type' => 'custompostname',             'tax_query' => array(                 array(                      'taxonomy' => 'custompostname-categories',                     'field' => 'id',                     'terms' => $categoryIDs                 )             ),             'post__not_in' => $post->ID,             'posts_per_page' => 20         );         $q = new WP_Query($args);      Could anyone please shed some light on why this is not working. If I remove the:               'post__not_in' => $post->ID,      It works apart from it shows the post which is on the page already Thanks


title: How to show a featured image inside a post in only 1 single category

text: Been walking around with my problem now for days and i decided to just go ahead and ask it. My theme is set that a featured image is not shown in a post, which is what i want. The problem is, in 1 category, i don't want this. So, what do i have to do so that if i set a featured image, it shows in the post. But ONLY for 1 specific category? Regards


title: Altering "posts_per_page" for defaut loop

text: I am trying to alter `posts_per_page` value in default wordpress loop on-the- fly, not for a custom loop.               global $wp_query ;     // $wp_query->query_vars['posts_per_page'] = 1000 ;     $wp_query->set('posts_per_page',1000) ;     while ($wp_query->have_posts()) {         $wp_query->the_post() ;         // other operations     }      How to do that?


title: Custom plugin breaks css.php on Multisite

text:
I got a strange problem on a Multisite Install I run. Everything works perfectly fine (Domain Mapping, Caching, whatever functions and Plugins I use, both forced and chooseable). To enhance the experience for my customers, I installed a simple autoexpiry plugin that I wrote myself quite a while ago. It is not the best solution of entering a date, but apart from the UI it just works. In my plugin I include two files:   * cronjobs.php (containing the function for the one-off event to set the post to draft)   * metaboxes.php (containing the custom metabox for the post, as well as the save-function, and the hooks to use them). Now the strange part: In WordPress-Admin everything works just as expected. The scheduling of the events to set a post to draft, and the metabox. The Theme for my Multisite contains a `css.php`, rendering the custom CSS from the Theme options. If the Plugin is activated, **only this file** gets a `404`. I already built a workaround, including the file for the metaboxes just in admin. Now the `css.php` works. My main plugin file looks like this now:               include('inc/cronjobs.php');     if ( is_admin() ) { // I just include the metaboxes.php in the admin section now         include('inc/metaboxes.php');     }      Without the conditional for the `include` of the metaboxes file, the debug throws this Error:               PHP Fatal error:  Call to undefined function wp_get_current_user() in /www/htdocs/w009bb74/landingpages/wp-includes/capabilities.php on line 1342      Has anyone had a similar problem? I can't figure out what's the problem here. On singlesite installs there is no problem whatsoever. The `css.php` in the theme does not even work if the `metaboxes.php` is **completely empty** Here are the two files: `cronjobs.php`               function f711_autoexpiry_set_draft( $post_id ) {         $post = array(             'ID' => $post_id,             'post_status' => 'draft'         );         wp_update_post( $post );     }     add_action( 'f711_autoexpiry_event', 'f711_autoexpiry_set_draft', 10, 1 );      `metaboxes.php`               add_action( 'add_meta_boxes', 'f711_autoexpiry_expiry_add_custom_box' );     add_action( 'save_post', 'f711_autoexpiry_expiry_save_expirydata' );          function f711_autoexpiry_expiry_add_custom_box() {         add_meta_box(              'f711_autoexpiry_expiry_sectionid',             __( 'Ablaufdatum', 'f711' ),             'f711_autoexpiry_expiry_inner_custom_box',             'angebote' ,             'side',             'high'         );     }          function f711_autoexpiry_expiry_inner_custom_box( $post ) {            // Use nonce for verification       wp_nonce_field( plugin_basename( __FILE__ ), 'f711_autoexpiry_expiry_nonce' );            $expirydate = get_post_meta( $post->ID, '_f711_autoexpiry_expirydate', true );            if ( get_post_meta( $post->ID, '_f711_autoexpiry_expirydate', true ) != "" ) {         $expirydate = strtotime( get_post_meta( $post->ID, '_f711_autoexpiry_expirydate', true ) );         $expiryday = date( 'd', $expirydate );         $expirymonth = date( 'm', $expirydate );         $expiryyear = date( 'Y', $expirydate );         $expiryhour = date( 'H', $expirydate );         $expiryminute = date( 'i', $expirydate );       }            $styles = 'style="width: 40px;margin-right:8px;"';       $styleslabel = 'style="width: 40px;margin-right:10px;float:left;"';       // The actual fields for data entry       echo '';            _e("Tag", 'f711_du' );       echo ' ';       echo '';            _e("Mon.", 'f711_du' );       echo ' ';       echo '';            _e("Jahr", 'f711_du' );       echo ' ';       echo '';            _e("Stu.", 'f711_du' );       echo ' ';       echo '';            _e("Min.", 'f711_du' );       echo '
';       echo '<input type="text" id="f711_autoexpiry_expiry_tag" name="f711_autoexpiry_expiry_tag" value="' . $expiryday . '" size="2" ' . $styles . ' />';       echo '<input type="text" id="f711_autoexpiry_expiry_monat" name="f711_autoexpiry_expiry_monat" value="' . $expirymonth . '" size="2" ' . $styles . ' />';       echo '<input type="text" id="f711_autoexpiry_expiry_jahr" name="f711_autoexpiry_expiry_jahr" value="' . $expiryyear . '" size="2" ' . $styles . ' />';       echo '<input type="text" id="f711_autoexpiry_expiry_stunde" name="f711_autoexpiry_expiry_stunde" value="' . $expiryhour . '" size="2" ' . $styles . ' />';       echo '<input type="text" id="f711_autoexpiry_expiry_minute" name="f711_autoexpiry_expiry_minute" value="' . $expiryminute . '" size="2" ' . $styles . ' />';       echo '

';       echo '<input type="checkbox" id="f711_autoexpiry_clear_expiry" name="f711_autoexpiry_clear_expiry" value="clear"> Ablaufdatum löschen';       echo '

';       echo '
Format: z.B. 31 03 2014 07 00
';     }          /* When the post is saved, saves our custom data */     function f711_autoexpiry_expiry_save_expirydata( $post_id ) {            if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )            return;            if ( !wp_verify_nonce( $_POST['f711_autoexpiry_expiry_nonce'], plugin_basename( __FILE__ ) ) )           return;            if ( $_POST['f711_autoexpiry_clear_expiry'] == 'clear' || $_POST['f711_autoexpiry_expiry_tag'] == "" ) {           delete_post_meta( $post_id, '_f711_autoexpiry_expirydate' );           wp_clear_scheduled_hook( 'f711_autoexpiry_event', array( $post_id ) );           return;       }            $tag = $_POST['f711_autoexpiry_expiry_tag'];       $monat = $_POST['f711_autoexpiry_expiry_monat'];       $jahr = $_POST['f711_autoexpiry_expiry_jahr'];       $stunde = $_POST['f711_autoexpiry_expiry_stunde'];       $minute = $_POST['f711_autoexpiry_expiry_minute'];            if( substr( $tag, 0, 1 ) != "0" && $tag < 10) $tag = "0" . $tag;       if( substr( $monat, 0, 1 ) != "0" && $monat < 10) $monat = "0" . $monat;       if( substr( $stunde, 0, 1 ) != "0" && $stunde < 10) $stunde = "0" . $stunde;       if( substr( $minute, 0, 1 ) != "0" && $minute < 10) $minute = "0" . $minute;       $usedate = $jahr . '-' . $monat . '-' . $tag . ' ' . $stunde . ':' . $minute . ':00';       if ( $jahr > 2000 && $tag > "00" && $monat > "00" && $usedate != "1970-01-01" ) {           update_post_meta( $post_id, '_f711_autoexpiry_expirydate', $usedate );       }       $offset = '-' . get_option('gmt_offset') . ' hour';       $thisdate = strtotime( $offset , strtotime( $usedate ) );         wp_clear_scheduled_hook( 'f711_autoexpiry_event', array( $post_id ) );         wp_schedule_single_event( $thisdate, 'f711_autoexpiry_event', array( $post_id ) );     }


title: Enable "CSS Classes" for menus by default

text: I'm wondering if it's possible to enable "CSS Classes" for Appearance > Menus by default when a theme (or a plugin) is activated? Like:               function my_theme_activate_css_classes_for_menu(){         // What would go here?     }     add_action( 'after_setup_theme', 'my_theme_activate_css_classes_for_menu' );      It should only happen once on theme activation.


title: WordPress URLs without posts

text: We are working on larger system, which is based on WordPress, but WordPress is used only for "static" content, the main part of the system should be consuming the external API and displaying the data. My point is: am I able to somehow tell URL rewriting not to use the WordPress internal system for some URLs and use something else? E.g. `mysite.com/news/news-title` would show the post, but `mysite.com/customcontent/anotherlink` would call some mechanism to load data from API and display it. I don't know if this is even possible with WordPress.. Thanks for your points.


title: Form Submit Post Front-end with Meta Boxes Included from Custom Post Type Called Testimonial

text:
Before I post this question, I've seen many questions in here but I guess, it still makes me confused and have no idea to implemented it. Case: I've just made Testimonial Custom Post Type by WPtuts Tutorial. I have made and set it up well on my template. But Now I need a Front-end Form for that. But I don't know to make and from where to start it. In case, In testimonials custom post type, I have 3 custom meta boxes that needed to show and can be submitted well. Please kindly your help for this, I'm sorry for my bad English. This is the code what i've made, but didn't work               if( 'POST' == $_SERVER['REQUEST_METHOD'] &&  !empty( $_POST['action'] ) && $_POST['action'] == "post_action") {          if (isset($_POST['submit'])) {         $error = "";              if ($_POST['location'] != null) {         $location = trim(strip_tags($_POST['location']));         } else {         $error .= 'Put location.
';         }                }                   $testimonial_data= $_POST['_testimonial'];             $client_name= $_POST['client_name'];             $source= $_POST['source'];             $link= $_POST['link'];              if (empty($error)) {            $new_post = array(   //insert form inputs, set var and define array         'post_content'  =>  $description,         'post_status'   =>  'draft',         'post_author'   =>  '2',         '_testimonial'        => $testimonial_data,         'client_name'        => $client_name,         'source'        => $source,         'link'     => $link,         'post_type' => 'post'         'post_category' => array($_POST['testimonials']),  // Usable for custom taxonomies too              // assigning tags and categories are no issue         );              $pid = wp_insert_post($new_post);          //ADD OUR CUSTOM FIELDS      add_post_meta($pid, '_testimonial', $testimonial_data, false);                               add_post_meta($pid, 'client_name', $client_name, false);             add_post_meta($pid, 'source', $source, false);             add_post_meta($pid, 'link', $link, false);             }      }      and this is the code for the form
Nama Anda
                     <input type="text" id="client_name[]" value="" tabindex="1" size="20" name="client_name" />

Title Website Anda
                     <input type="text" id="source[]" value="" tabindex="1" size="20" name="source" />

Link Website Anda
                     <input type="text" id="link[]" value="" tabindex="1" size="20" name="link" />

Testimonial
                     <textarea id="description" tabindex="3" name="description" cols="50" rows="6"></textarea>
                           <input type="hidden" name="action" value="post_action" />                      <input type="submit" name="submit" id="submit" value="PROCEED"/>                      <?php wp_nonce_field( 'new-post' ); ?>


title: Excluding CPT generated by a plugin from the loop

text: I am working on a plugin which creates a custom post type. The custom post type generates a google map, and plots the location specified in the post of the CPT on to a google map. I'd like to remove this CPT from displaying `the_content();` and `the_title();` etc. in the regular loop. Since the post type I've created has the ability for the user to click the pin on the map to display `the_content();` there is no need to have this information displayed in regular text format on the page, like a regular post type would look. Is there a solution that will eliminate this post type from the loop on the page templates of any theme that I can use in my plugin code? Edit: I have constructed a shortcode, that can display the CPT map on any page. Inside the shortcode it loops through each post of the CPT to get its location and plot it on the map. What is happening is, if I insert the short code on any given page, the map works great, but the page is also displaying the title and content of the CPT underneath the map as well. It appears that this is because the page I've posted the short code on is grabbing the loop from within the short code and applying it to the page template of page. This is duplicating content, it is displayed once on the map, and once in the loop of the page template.


title: How to get the meta box name and value

text: I have several meta field like Property Name----->bla bla, Property ID-------->1234, Property Address--->bla bla bla , and so on . I want to print all the meta box name and their value . How can I do that ?


title: How to let users recieve notification mails based on custom values

text: I'm working on a site which lets users post and search for rental apartments. Everything is handled from the front end - the user never sees the admin/backend area. I want to implement a feature which notifies users when a new post is published. I want users to have the ability to mark fields (e.g. check-boxes) which contain the meta keys from my custom post type. The custom post type contains several meta keys which would act as the filter for when an email is send. For example: A user wants to receive a mail when a new apartment with 4 rooms and 300 square-feet is published. The user fills out a form on the front end and hits submit. I hope i made myself clear. Any suggestions - plugin or code-wise on how to achieve this? Best regards Karsten Tietje


title: filter the_title problem in nav

text: Hi I have a problem with the_title filter: I have this code at my constructor:               add_filter( 'the_title', array($this, 'change_title') );      and this as callback (for testing purposes)                public function change_title($title)      {         return 'title';                       }      But is filtering my navigation items! instead of show home, pages, etc all changed to `'title'` ![screenshoot](http://i.stack.imgur.com/mLcfw.png) Any Ideas how to fix it?


title: How-to add rewrite rules to point the uploads folder to a subdomain

text: ## The goal Point the upload-folder to a static subdomain to serve adaptive images, that can get cached. ### WordPress Rewrite Rules You can read more in detail about rewrite rules API at Christopher Davis site. ### The how-to on adaptive-images.php Those are the steps needed ( _just to make the Q complete_ ): >   1. The HTML starts to load in the browser and a snippet of JS in the > writes a session cookie, storing the visitor's screen size in pixels. >   2. The browser then encounters an tag and sends a request to the server > for that image. It also sends the cookie, because that’s how browsers work. >   3. Apache receives the request for the image and immediately has a look in > the website's .htaccess file, to see if there are any special instructions > for serving files. >   4. There are! The .htaccess says "Dear server, any request you get for a > JPG, GIF, or PNG file please send to the adaptive-images.php file instead." > The PHP file then does some intelligent thinking which can cover a number of scenario's but I'll illustrate one path that can happen: >   1. The PHP file looks for a cookie and finds that the user has a maximum > screen size of 480px. >   2. It compares the cookie value with all $resolution sizes that were > configured, and decides which matches best. In this case, an image maxing > out at 480px wide. >   3. It then has a look inside the /ai-cache/480/ folder to see if a > rescaled image already exists. >   4. We'll pretend it doesn’t - the PHP then goes to the actual requested > URI to find the original file. >   5. It checks the image width. If that's smaller than the user's screen > width it sends the image. >   6. If it's larger, the PHP creates a down-scaled copy and saves that into > the /ai-cache/480/ folder ready for the next time it's needed. It and also > sends it to the user. > ### The question How would I set up the rewrite rules to point a subdomain to the the uploads folder and vice versa? Thanks.


title: How do I link an image in my plugin so it displays on WordPress?

text: I'm creating a plugin for a college project. The plugin is very simple: it searches for name of the site address and upon finding it in a post, it outputs the site address with an image. However, I cannot get the code working. I've tried this:               <?php     /*     Plugin Name: Murtaghs Trademark Plugin     Plugin URI: http://www.MurtaghsPub&Undertakers.ie     Description: Adds Murtaghs Logo Wherever name Of Business Displayed On Page.     Author: Connell Gray     Version: 1.0     Author URI: http://www.MurtaghsPub&Undertakers.ie     */     function Murtaghs_Trademark_Plugin($text) {              $site_name = get_bloginfo();         //the logo.jpg file is stored in a folder called images which i  have created in the plugins folder//         $new_site_name = $site_name . 'echo ' '';              $text = str_replace($site_name,$new_site_name,$text);              return $text;     }     add_filter('the_content','Murtaghs_Trademark_Plugin');          ?>


title: Plugin renders in preview but shortcode shows when published

text:
I was attempting to add this Flash Count Down plugin. The shortcode works fine in preview: ![enter image description here](http://i.stack.imgur.com/eOgwo.jpg) But when published the shortcode is rendered as text: ![enter image description here](http://i.stack.imgur.com/7JbEg.jpg) Is there a general solution to this problem or do I have to get someone from the publisher to answer this question? They have apparently abandoned supporting these as their link is a 404: http://premiumcoding.com/premiumcode-forum/wordpress-plugins-group1/wordpress- plugins-support-forum2/ Here is the template index file:               <?php     /*     Template Name: Index Page     */     ?>     <?php get_header(); ?>

                 <?php get_template_part('loop','index'); ?>

          <?php get_sidebar(); ?>          <?php get_footer(); ?>      Here's the main index file:               <?php     /**      * Front to the WordPress application. This file doesn't do anything, but loads      * wp-blog-header.php which does and tells WordPress to load the theme.      *      * @package WordPress      */          /**      * Tells WordPress to load the WordPress theme and output it.      *      * @var bool      */     define('WP_USE_THEMES', true);          /** Loads the WordPress Environment and Template */     require('./wp-blog-header.php');     ?>      loop.php:               <?php while (have_posts()) : ?>         <?php the_post(); ?>         <div id="post-<?php the_ID(); ?>" <?php post_class('append-clear'); ?>>

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

                      <?php                                      // padd_theme_share_button(); ?>                 <?php //the_excerpt();?>
     <?php endwhile; ?>


title: Wordpress wiget admin panel

text:
I'm trying to achive this thing in wordpress wiget admin panel : http://jsfiddle.net/George02/mkuxcwf5/1/ The problem is that the jQuery seems to not work .               public function form( $instance ) { ?>     <?php     wp_register_script('customscript', get_template_directory_uri() . '/widgets/custom_widget/widget.js', array('jquery'), null, true);     wp_enqueue_script('customscript');     ?>

             <select id="categories">                 <option>Option 1</option>                 <option>Option 2</option>             </select>
Add category

          <?php }      widget.js contains the code from the fiddle. If I `View Source` of the page It's seems that the script is there, in the head section, and if I open up the console I can see the log from document ready function . I think the problem is that wordpress doesn't allow me to add items into DOM, because when I inspect the $list element I can see that he has a `<li>` inside it.I'm right or it's something else?


title: Display cropped thumbnail not featured image

text: Currently i have these lines in functions.php and my home page respectively:               add_theme_support( 'post-thumbnails' );     add_image_size( 'square', 252, 252, true );      //               if ( has_post_thumbnail()):           the_post_thumbnail( 'square' );         endif;       Then regenerate thumbnails plugin resizes images to 252 x 252. How do I display cropped thumbnail images and not featured? Just to add , im using ACF custom fields plugin and part of that tinkers with the featured iamges, so it maybe possibly re-writing native logic in how to handle images. If anyone has been in a similar situation, please let me know if ou found a work around. Thanks!


title: How to calculate custom field value (average)

text: I want to calculate the average value (or other calculation if possible) of several custom field values in a post. For example, I have 4 custom fields in a post, custom1 to custom4, value from 1 to 4 and I want to display the average value. Is there any way to do that?


title: Child Pages on Mobile/Touch Screen not clickable

text: I have child pages under parent pages in page menu/header, they work fine when using a PC, but I cannot get them to work when using a mobile phone or touchscreen device such as an iPad. I am using the GamePress Pro theme. I asked this question on Stack Overflow too.


title: wp_nav_menu use #<slug> instead of permalinks

text:
I need help modifying the wp_nav_menu arguments so that it can generate a menu which has # instead of permalinks.. I know I can add custom link menu items, but I want the menu to be more dynamic ..

About Us

Services

FAQ

Contact Us


title: Getting data from database and use it to complete a form

text: I have the following files: Main plugin file:               <?php              /*         Plugin Name: FixFormData         Description: If you want to autocomplete a form with existing data, this plugin is for you.         Version: 1.1         Author: Stijn Aerts         Author URI: http://stijnaerts.be         License: GPL2         */              require( plugin_dir_path( __FILE__ ) . 'menu.php');         require_once( plugin_dir_path( __FILE__ ) . 'getuser.php');                   add_action( 'wp_enqueue_scripts', 'ffd_load_scripts' );              function ffd_load_scripts()         {             wp_register_script('ffd_js_script', WP_PLUGIN_URL.'/FixFormData/js/ffd_js_script.js', array('jquery'));             wp_localize_script('ffd_js_script', 'myAjax', array(                 'ajaxurl' => admin_url('admin-ajax.php')                 )             );                  wp_enqueue_script('jquery');             wp_enqueue_script('ffd_js_script', plugin_dir_url(__FILE__) . 'js/ffd_js_script.js');         }      getuser.php:               <?php      function getuser($str)     {         global $wpdb;              $myoption =  get_option( 'fixformdata_options' );         $myoptionValue = maybe_unserialize( $myoption );                  $result2 = $wpdb->get_row         (             $wpdb->prepare             (                 "SELECT * FROM {$myoptionValue[tablename]} WHERE personeelsNummer = %d", $str             )         );              if($result2)          {             echo  json_encode( $result2 );         }     }     ?>      ffd_js_script.js:               jQuery(document).ready(function($){         jQuery('#input_1_2').change(function()         {             jQuery.ajax({                 type : 'post',                 dataType : 'json',                 url : myAjax.ajaxurl,                 data : {action: 'getuser', this.value},                 succes: function(response){                     var parsed = JSON.parse(response);                     var arr = [];                     for(var x in parsed){ arr.push(parsed[x]);}                     jQuery('#input_1_3').val(arr[1]);                     jQuery('#input_1_4').val(arr[2]);                 }             })         });     });      How do I properly implement this? First time I'm making a plugin and I have read much about it and saw alot of examples, but I'm failing to implement this correctly.


title: Does WordPress create a new Linux user when creating a new WordPress blog?

text: I wonder if WordPress creates a new Linux user when creating a new WordPress blog? I am a NodeJS developer, but from what I know PHP scripts can also have access to entire file system. That's why I think that WordPress creates a new sytem user for every blog. Is this true? If not, how do they manage access between two WordPress blogs?


title: Capabilities and Custom Post Types

text: I have a custom post type that I'd like to restrict access to certain roles however, I've already added content using the custom post type and now I have to make them restricted. The capability_type was 'post'               'capability_type' => 'post'      Which is fine as the content show up in the backend however, now as soon as I add any capabilities the content disappears from the backend? I've tried customising the capability type to include plural definitions to construct my own but as soon as I remove or change capability types it's gone! full code:               add_action( 'init', 'register_cpt_gallery' );          function register_cpt_gallery() {     $labels = array(          'name' => _x( 'Galleries', 'gallery' ),         'singular_name' => _x( 'Gallery', 'gallery' ),         'add_new' => _x( 'Add New', 'gallery' ),         'add_new_item' => _x( 'Add New Gallery', 'gallery' ),         'edit_item' => _x( 'Edit Gallery', 'gallery' ),         'new_item' => _x( 'New Gallery', 'gallery' ),         'view_item' => _x( 'View Gallery', 'gallery' ),         'search_items' => _x( 'Search Galleries', 'gallery' ),         'not_found' => _x( 'No galleries found', 'gallery' ),         'not_found_in_trash' => _x( 'No galleries found in Trash', 'gallery' ),         'parent_item_colon' => _x( 'Parent Gallery:', 'gallery' ),         'menu_name' => _x( 'Galleries', 'gallery' ),     );          $args = array(          'labels' => $labels,         'hierarchical' => true,         'description' => 'Image galleries for teachers classes',         'supports' => array( 'title', 'editor', 'author'),              'public' => true,         'show_ui' => true,         'show_in_menu' => true,              'menu_icon' => get_bloginfo('template_url') . '/images/imagegallery.png',         'show_in_nav_menus' => true,         'publicly_queryable' => true,         'exclude_from_search' => false,         'has_archive' => true,         'query_var' => true,         'can_export' => true,         'rewrite' => true,         'capability_type' => 'post',         'capabilities' => array(             'edit_post' => 'edit_gallery',             'edit_posts' => 'edit_galleries',             'edit_others_posts' => 'edit_other_galleries',             'publish_posts' => 'publish_galleries',             'read_post' => 'read_gallery',             'read_private_posts' => 'read_private_galleries',             'delete_post' => 'delete_gallery'         )     );          register_post_type( 'gallery', $args );     }      I've also tested this with a completely new custom post type and regardless of the capability type I get the same issue eg even if I remove it and add my custom one:               'capability_type' => array('movie','movies');


title: htaccess 301 Redirect not working from aspx to new WP permalink

text: I'm fairly experienced with htaccess files and Rewrite/Redirect rules, however, this one has me stumped as to why it's not working. **NONE** of the following lines (used individually, not together) have any effect. I simply get the normal 404 page when attempting the old URL.               RewriteEngine On          RewriteRule  ^carpetcare/default.aspx$ /carpet-care/ [R=301,L]     Redirect 301 /carpetcare/default.aspx http://www.domain.com/carpet-care/     Redirect 301 /carpetcare/default.aspx /carpet-care/      The above lines all precede the typical WP htaccess rules here:               # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>     # END WordPress      I have other Rewrite rules that work perfectly, so it puzzles me why these simple redirects don't do _anything_. Here is the entire htaccess:               Options +FollowSymLinks     RewriteEngine On          #RewriteRule  ^carpetcare/default.aspx$ /carpet-care/ [R=301,L]     #RedirectMatch 301 ^/carpetcare/default.aspx$ /carpet-care/     Redirect 301 ^/carpetcare/default.aspx$ /carpet-care/               # Other rewrites     RewriteRule ^carpet-care/([-A-zA-Z]+)-cleaning(.*)/$ /loc.php?city=$1&cat;=1 [L]          # BEGIN WordPress          RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]          # END WordPress          # BEGIN wtwp_cache                   # Text         AddType text/css .css         AddType application/x-javascript .js         AddType text/html .html .htm         AddType text/richtext .rtf .rtx         AddType text/plain .txt         AddType text/xml .xml              # Image         AddType image/gif .gif         AddType image/x-icon .ico         AddType image/jpeg .jpg .jpeg .jpe         AddType image/png .png         AddType image/svg+xml .svg .svgz              # Video         AddType video/asf .asf .asx .wax .wmv .wmx         AddType video/avi .avi         AddType video/quicktime .mov .qt         AddType video/mp4 .mp4 .m4v         AddType video/mpeg .mpeg .mpg .mpe              # PDF         AddType application/pdf .pdf              # Flash         AddType application/x-shockwave-flash .swf              # Font         AddType application/x-font-ttf .ttf .ttc         AddType application/vnd.ms-fontobject .eot         AddType application/x-font-otf .otf              # Audio         AddType audio/mpeg .mp3 .m4a         AddType audio/ogg .ogg         AddType audio/wav .wav         AddType audio/wma .wma              # Zip/Tar         AddType application/x-tar .tar         AddType application/x-gzip .gz .gzip         AddType application/zip .zip                        ExpiresActive On              # Text         ExpiresByType text/css A31536000         ExpiresByType application/x-javascript A31536000         ExpiresByType text/html A3600         ExpiresByType text/richtext A3600         ExpiresByType text/plain A3600         ExpiresByType text/xml A3600              # Image         ExpiresByType image/gif A31536000         ExpiresByType image/x-icon A31536000         ExpiresByType image/jpeg A31536000         ExpiresByType image/png A31536000         ExpiresByType image/svg+xml A31536000              # Video         ExpiresByType video/asf A31536000         ExpiresByType video/avi A31536000         ExpiresByType video/quicktime A31536000         ExpiresByType video/mp4 A31536000         ExpiresByType video/mpeg A31536000              # PDF         ExpiresByType application/pdf A31536000              # Flash         ExpiresByType application/x-shockwave-flash A31536000              # Font         ExpiresByType application/x-font-ttf A31536000         ExpiresByType application/vnd.ms-fontobject A31536000         ExpiresByType application/x-font-otf A31536000              # Audio         ExpiresByType audio/mpeg A31536000         ExpiresByType audio/ogg A31536000         ExpiresByType audio/wav A31536000         ExpiresByType audio/wma A31536000              # Zip/Tar         ExpiresByType application/x-tar A31536000         ExpiresByType application/x-gzip A31536000         ExpiresByType application/zip A31536000                                Header set Pragma "public"             Header append Cache-Control "public, must-revalidate, proxy-revalidate"             Header unset ETag                                         Header unset Set-Cookie                   # END wtwp_cache          # BEGIN wtwp_security              RewriteEngine On         RewriteBase /         RewriteRule ^wp-admin/includes/ - [F,L]         RewriteRule !^wp-includes/ - [S=3]         RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]         RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]         RewriteRule ^wp-includes/theme-compat/ - [F,L]                   Order allow,deny         Deny from all          Options -Indexes     # END wtwp_security


title: WordPress MU Domain Mapping Just Redirects to Main Site

text: I have done the following: -- Installer WordPress and enabled MU on the main site (main.com). -- Changed wp-config.php of the MU to the following:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*)  [L]     RewriteRule ^(.*\.php)$  [L]     RewriteRule . index.php [L]      -- Changed the second domain (second.com)'s nameservers to be the same as the main domain. Then I added the second domain as an addon domain in cPanel. For web root of the second domain I choosed htdocs/main.com (the directory where WP MU is installed). I didn't just park it, because the WordPress MU is not installed in the root directory of the cPanel account and I am using shared hosting. -- Installed the WP domain mapping plugin: http://wordpress.org/plugins/wordpress-mu-domain-mapping/ -- Went to the Network admin in the main site and under Settings->Domain mapping, I've entered main.com in the "Server CNAME domain:" fields. -- Under Settings->Domains I've added the domain second.com as the main domain for the WP install with ID 2. -- Under Sites->All Sites I've edited site with ID 2 and changed its domain to be http://second.com, keeping the checkbox "Update siteurl and home as well." checked. Now when I visit second.com in my browser I simply get redirected to the main WP site - main.com, whereas it should show me the WordPress child site instead.


title: Displaying custom taxonomy in the admin list of a custom post type

text: I'm trying to list the terms of a custom taxonomy ('genre') in the overview table in the admin area for a custom post type ('station'). To get this, I tried the following code in my theme's functions.php file:               register_taxonomy('genre', 'station', array(         'labels' => array(             'name' => _x('Genres', 'taxonomy general name', 'loudfm_theme'),             'singular_name' => _x('Genre', 'taxonomy singular name', 'loudfm_theme'),             'search_items' => __('Search Genres', 'loudfm_theme'),             'popular_items' => __('Popular Genres', 'loudfm_theme'),             'all_items' => __('All Genres', 'loudfm_theme'),             'parent_item' => __('Parent Genre', 'loudfm_theme'),             'parent_item_colon' => __('Parent Genre:', 'loudfm_theme'),             'edit_item' => __('Edit Genre', 'loudfm_theme'),             'update_item' => __('Update Genre', 'loudfm_theme'),             'add_new_item' => __('Add New Genre', 'loudfm_theme'),             'new_item_name' => __('New Genre Name', 'loudfm_theme')         ),         'hierarchical' => true     ));     add_filter('manage_station_posts_columns', 'station_edit_columns');     add_action('manage_posts_custom_column',  'station_custom_columns');     function station_edit_columns($columns){         $columns = array(             'cb' => '<input type="checkbox"/>',             'title' => __('Station Title', 'loudfm_theme'),             'description' => __('Description', 'loudfm_theme'),             'genre' => __('Genre', 'loudfm_theme')         );         return $columns;     }     function station_custom_columns($column){         global $post;         switch ($column) {             case 'description':                 the_excerpt();                 break;             case 'genre':                 $genre = get_terms(array(                     'taxonomy' => 'genre',                     'include' => get_post_meta($post->ID, 'maingenre', true)                 ));                 echo 'name) . '">' . $genre[0]->name . '';         }     }      In my case I don't simply want to list all selected genres of a station, but only the main genre whose id is stored in the field 'maingenre' of the custom post type. That's why I'm using the `get_terms` function with the 'include' parameter. But sorrily I get an 'Invalid taxonomy' error back (as WP_Error object). Using `get_the_term_list` works without errors, but with this function I am not able to display only the main genre. Can anyone tell me, why `get_terms` is not working here and how I can get it to work? Thank you!


title: sort custom post type by display name

text: I am trying to sort my custom post type in a few different ways using a dropdown. When I try to sort it as the display_name it doesn't work.               $wp_query = new WP_Query(array('orderby' => 'display_name') );      It works well on a few other sort ways like 'title' 'comment_count' but when I want to sort from the authors real name and not username it doesn't work anymore. Any hint how this can be fixed?


title: Admin menu as submenu from another plugin

text: I would like to add my new developed plugin's admin menu to an existing plugin as sub menu. Would be possible to do this? In my first plugin I initilize the menus as follows:               function add_pages() {         // Add a new top-level menu (ill-advised):         add_menu_page(__('MyMenu','menu-test'), __('MyMenu','menu-test'), 'manage_options', 'menu-top-level-handle', array ($this , 'menu_toplevel_page' ) );              // Add a second submenu to the custom top-level menu:         add_submenu_page('menu-top-level-handle', __('Test Submenu','menu-test'), __('Test Submenu','menu-test'), 'manage_options', 'sub_page_test', array($this , 'test_sublevel_page2') );     }      The code in the second plugin:               function admin_menu () {             add_submenu_page( 'menu-top-level-handle', 'Lexikon', 'Lexikon', 'manage_options', 'lexikon-edit', array($this , 'lexikon_settings_page') );     }      Then I tried the following in my second plugin, but the page is wrong redirected instead: **`admin.php?page=sub_page`** redirects to **`/sub_page`**.


title: Parsing the post title to the media box page

text: I'm creating a media upload section in my metabox. One of the things I want to be able to do is to rename the filename of the media that is uploaded to the same as the post title. so for example, say now I uploaded a picture called, pic001.jpg to the post: "Test Post", in the process of the upload, I want to automatically rename the filename to test_post_1.jpg I've seen the following link: rename files during upload using variables However, I'm not too sure where you would post the data to? I've also found another link that demonstrates how you can rename the file - it's something similar to this:               function make_new_filename($filename){     $info = pathinfo($filename);         $ext  = empty($info['extension']) ? '' : '.' . $info['extension'];         $name = basename($filename, $ext);         $newname = "test";         return $newname . $ext;     }     add_filter('sanitize_file_name', 'make_new_filename');      So if there any idea how I would get the title posted through to the media_upload.php? Follow up: I have tried to send the data to the media_upload.php               jQuery('#upload_image_button_test').click(function() {             var postTitleVal = jQuery("#title").val();             if(postTitleVal == ''){                 jQuery("#title").after(' You forgot to enter the title');             } else{             jQuery('html').addClass('Image');             formfield = jQuery('#upload_image_test').attr('name');             tb_show('', 'media-upload.php?type=image&TB_iframe=true;title='+postTitleVal);             console.log('media-upload.php?type=image&TB_iframe=true;title='+postTitleVal);             }                  return false;         });              // user inserts file into post. only run custom if user started process using the above process         // window.send_to_editor(html) is how wp would normally handle the received data              window.original_send_to_editor = window.send_to_editor;         window.send_to_editor = function(html){                  if (formfield) {                 fileurl = jQuery('img',html).attr('src');                      jQuery('#upload_image_test').val(fileurl);                           tb_remove();                      jQuery('html').removeClass('Image');                  } else {                 window.original_send_to_editor(html);             }         };          });


title: Order custom fields alphabetically

text:
I've been trying to order the custom fields alphabetically, but I can't get the ordered list I want... this is the code I'm using:               <?php              $vMarca = get_field('tienda_marcas'  , false, false);             $post_objects = get_posts(array(                 'post__in'   => $vMarca,                 'order'   => 'ASC'  ,                 'orderby'   => 'title'               ));                  if($vMarca)             {                 echo '
' ;                 foreach($vMarca as $post_objects)                 {                     echo '
'  . $post_objects . '
' ;                 }                 echo '
' ;             }                  ?>      I need the custom fields to be ordered alphabetically.


title: Create Custom Attachment Template That is Processed from Plugin Folder?

text: I have made a custom image.php for a gallery plugin I'm creating. My dilemma is that I currently have to have my customized image.php in the theme folder for it to work. Is there a way to tell Wordpress to utilize a template file outside of the theme folder to process attachments?


title: Wordpress Multisite local: wp-login.php refreshes on login Chrome Browser

text: I just set up Wordpress Multisite on my local machine following this tutorial. When I try to login to the admin using Google Chrome, the page just refreshes. I've tried Firefox, and I'm able to login and use Wordpress Multisite normally and access the dashboard. I've tried clearing my cache, and using incognito mode in Google Chrome, to make sure that it wasn't a caching issue. Here are the steps I take to login:   1. I navigate to `http://dev-server/wp-admin`   2. I'm redirected to `http://dev-server/wp-login.php?redirect_to=http%3A%2F%2Fdev-server%2Fwp-admin%2F&reauth=1`   3. I enter my username and password, then click 'Log in'   4. I'm redirected to `http://m1/wp-login.php?redirect_to=http%3A%2F%2Fdev-server%2Fwp-admin%2F&reauth=1` I've also added to my wp-config.php as referenced here:               define('WP_HOME','http://dev-server');     define('WP_SITEURL','http://dev-server');      Is there anything else I can try? I'd like to be able to use both Chrome and Firefox.


title: Can't get title of latest post

text: I've just started learning PHP/Wordpress yesterday - here is one of my first plugins. Unfortunately, it's not working like it's supposed to - the title doesn't display. What's wrong with my code?               function show_title_on_dashboard() {              $newest_post_id = $post[0]->ID;              $title = $newest_post_id->post_title;              echo "Latest Post: $title";     }          add_action("admin_notices", "show_title_on_dashboard");


title: Display custom field outside the loop

text: Inside of my WordPress theme directory I have a standalone PHP file called image, this currently looks like this....               <?php       define('WP_USE_THEMES', false);       require('/home/mysite/public_html/wp-blog-header.php');     ?>          <?php       global $post;       $post_id = 288;       $header_image = get_post_custom_values('caption', $post_id);         echo get_post_meta($post_id, 'caption', true);     ?>      When I visit this site I want it to return the custom field value for 'caption' but I am getting nothing. I realise this page is outside of the loop but I thought I have included the wp-blog-header.php that it needed. Can anyone help?


title: Can't get expected result from a wpdb query

text: Having some trouble with my first attempt at a direct DB query using $wpdb. I'm using the WordTwit plugin, and trying to retrieve the short url extension for the current post that is created by the plugin. This is the code I have:               global $wpdb;     $short = $wpdb->get_var("SELECT url FROM $wpdb->prefix.'tweet_url' WHERE post_id = '$post->ID' ");      As I understand it, this should pull the value of the 'url' in the row where the 'post_id' equals the ID of the current post. However, when I echo $short to test, it's not returning anything. What am I missing?


title: Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?

text: I am using the following code to generate a JSON feed. I need to extract the excerpt from posts, but when I run get_the_excerpt() it takes 28 seconds (yes SECONDS!) to run on my local server versus 599 milliseconds when I change get_the_excerpt() to 'hi'. Does anybody have any idea why this is taking so long and what I can do to get it to load faster? This is on my local web server on the computer I'm using so it isn't due to a network issue.               $json = array();          while ( have_posts() ) {       the_post();       $yo = array('title' => get_the_title(), 'excerpt' => get_the_excerpt());     }          $json[] = $yo;     $json = json_encode($json);


title: How to delete custom field "suggestions" from dropdown list

text: When you use a standard custom field in WP you have to write the name of the cusotm fields the first time. The second time you use a custom field it sticks to the custom fields dropdown list. But, sometimes when you install plugins they ise ALOT of custom fields. This list becomes a bit long an it may "push" som of my custom fields out of tghe list. So, does anyone know how I can remove custom fields from my dropdown list in any easy way?


title: How to get multiple Action Hooks in an Array

text: Hi I am writing a small plug-in which I get some content from outside of WordPress and I want a small script to trigger whenever a new post, page or comment is added. Also if any Widgets, themes and Plug-ins are Activated or De-Activated. My guess is that I should be using the action hooks for this but since there are multiple actions so how to get all those actions in some array or so.               class getStatic {              var $_renderTasksOn =             array(                        <!-- How do I call those actions in an array here -->                  )          function gerStatic() {              <!-- Here goes the script to get external data -->     }          }      I am very new to programming hence kindly help with the code. How do I use those action hooks? Kindly help.


title: Adding Attachment Display Settings in custom media frame

text: I made my own custom media frame :               $('.add').bind('click', function(event) {         event.preventDefault();         // Create the media frame.         file_frame = wp.media.frames.file_frame = wp.media({             title: 'Select image to insert',             button: {                 text: 'Insert',             },             multiple: true          });         file_frame.open();     });      It opens the media manager alright but Attachment display setting part is missing. How can i get that?


title: How to Change wp-admin URL Slug in Admin Page

text: Is there a way to change wp-admin slug in admin url? I want http://example.com/admin-panel/edit.php instead of http://example.com/wp-admin/edit.php Any help would be very appreciated.


title: Multiple instances of nivo slider plugin

text: I’m using Wordpress as a CMS for this site http://www.seadragon.co.uk/new_site/portfolio.html ...and it’s the first time I’ve ever used wordpress so sorry if I get the terminology wrong.... My client needs to be able to add new projects (case studies) to the portfolio section, and each of them can have it’s own slideshow. I thought they could create a new post category for each project slideshow, and then a new page for each project. The problem I have is how to get my client to associate the post category with the project page (so I can pull the correct category posts in to the slideshow dynamically). I thought maybe I could try and get them to use the same naming convention for the category she creates (for the project sildeshow) and the page she creates (for the project)? Does this sound like it’ll work? Is there a better way I can do this, or another plugin that would be better suited. Here’s the code from my portfolio template... currently the categoryID is hard coded in the query.               <div id="slider">                 <?php                 //Reset Query                 //wp_reset_query();                 global $wp_query;                 $query = "post_type=post&cat=5";                 $wp_query = new WP_Query( $query );                      if ( have_posts() ) : while ( have_posts() ) : the_post();                           echo get_the_post_thumbnail($post->ID, 'large');                     ?>                      <?php                  endwhile; endif;                 ?>                   </div>                      <script type="text/javascript">                 $(window).load(function() {                 $('#slider').nivoSlider();                 });                 </script>      Hope that makes some sense? Many thanks. _**Edit: Fixed formatting so embedded code sample would display_**


title: simple wp_insert_post example

text: i've spent way too much time trying to use the `wp_insert_post()` function a `<form>` and i do not know why it is not working.               // Create post object       $my_post = array(          'post_title' => 'My post',          'post_content' => 'This is my post.',          'post_status' => 'publish',          'post_author' => 1,          'post_category' => array(8,39)       );          // Insert the post into the database       wp_insert_post( $my_post );      I'm probably doing something wrong. If possible can you please hook this to a form. Thanks verymuch. I just need an example to see what i am doing wrong. here is a link to where i previously asked. pls don't mark dupe.


title: Overwriting Core Wordpress Functions with Plugins

text: Is there a way to overwrite a core function is the Wordpress core using a plugin? I don't need to inject code, I need to replace the function entirely with a re-written version. The specific function is wp_nav_menu_item_post_type_meta_box() in /wp- admin/includes/nav-menu.php Basically there's a lack of functionality that is not meeting a clients need, so I need to overwrite this function with one I have created. I've made heavy modifications to the function, and I want to have the ability to overwrite the function with my own through a plugin instead of editing the file directly. I know this probably isn't much better than hacking the core, however its a temporary immediate solution.


title: Is there anyway to use relative link instead of absolute link?

text: I have working on xx.xyz.com then my project is move on xyz.com In which I have gave in project the previous link is as below xx.xyz.com/?page_id=634 And now my link is as belows xyz.com/?page_id=634 I have tried to put link relative like ../?page_id=634 but its not working any suggestion regarding this?


title: Set default screen option for appearance -> menus

text: Is it possible to have any control over the screen options for `Appearance>Menus`. I am working on a theme and with a fresh Wordpress install where I had never touched any of the screen options ( at least not under Appearance>Menus anyway ). I had 3 custom post types. Of these one was "missing". I investigated Screen Options and it turned out that one was unchecked, while the other two were checked. I don't know what I did to get it this way but I would like it to be _consistent_ for users anyway. Has anyone got any ideas or information on this front? Ideally I would like to know that all three custom post types would be checked on a fresh install or a new user.


title: Custom Post Type Archive Title Lowercase

text: Is there any reason that my custom post type archive title is all lower-case even though 'name' is defined as sentence-case? Here is the post type function I'm using:               function resources_post_type() {     $labels = array(         'name'               => _x( 'Resources, Help & Support', 'post type general name' ),         'singular_name'      => _x( 'Resource', 'post type singular name' ),         'add_new'            => _x( 'Add New', 'resources' ),         'add_new_item'       => __( 'Add New Resource' ),         'edit_item'          => __( 'Edit Resource' ),         'new_item'           => __( 'New Resource' ),         'all_items'          => __( 'All Resources' ),         'view_item'          => __( 'View Resource' ),         'search_items'       => __( 'Search Resources' ),         'not_found'          => __( 'No resources found' ),         'not_found_in_trash' => __( 'No resources found in the Trash' ),          'parent_item_colon'  => '',         'menu_name'          => 'Resources'     );     $args = array(         'labels'        => $labels,         'description'   => 'Holds our resources and resource specific data',         'public' => true,         'show_ui' => true,         'show_in_menu' => true,         'query_var' => true,         'menu_position' => 5,         'has_archive'   => true,         'rewrite' => array( 'slug' => 'resources' ),         'supports' => array(             'title',             'editor',             'author',             'thumbnail',             'excerpt'         )     );     register_post_type( 'resources', $args );        add_action('admin_init', 'flush_rewrite_rules');      } add_action( 'init', 'resources_post_type', 0 ); I'm using Thesis 2.0


title: How to show Disqus comment count number only without text?

text:
I'm using Disqus WordPress plugin. When the page is not fully loaded yet, there's only comment count but after that Disqus auto appends the string Comments to that which looks really ugly. ![snapshot](http://i.stack.imgur.com/d4sqC.png) From the theme:
           <a href="<?php the_permalink(); ?>#comments" class="comments-link"><?php comments_number('0', '1', '%'); ?>
      I couldn't figure out what went wrong.


I'm using javascript for the first time to do some simple animations on the home page of my website. So far I have added the following to my header.php file (which is only used for my home page), before the wp_head line.               <?php     function my_scripts_method() {         wp_enqueue_script('jquery');                 }              add_action('wp_enqueue_scripts', 'my_scripts_method'); // For use on the Front end (ie. Theme)     ?>      It's loading jquery into my page! I only need it on the home page, which is why I'm not calling it in functions.php or whatever. I just need to do some simple animations on my home page and need some advice. When the page loads, I want the logo to move down into position from off the top of the page, then I want the menu to appear underneath it using the Blind effect. When someone clicks a menu item I need the menu to hide using the blind effect, the background colour to change, the logo to move, and the logo to be transitioned from one png to another png (so that it appears to change color as well). The codex (http://codex.wordpress.org/Function_Reference/wp_enqueue_script) says _jQuery UI Effects is NOT included_ with the jquery-ui-core. **How do I get my page to load the jQuery UI Effects library?** _Alternately, perhaps someone can offer advice on a better js file to use for this than jQuery UI Effects?_


title: woocommerce product attributes

text: Forgive me if someone has asked this before, but i am trying to get some attributes displayed next to displayed content of product. I see the hook `woocommerce_before_single_product_summary` that displayed few attributes but not all. The `woocommerce_before_single_product_summary` let me back to directory structure in woo/templates/single-products/filename which is just                 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly          global $post, $product;     if ($product->is_on_sale()) :          apply_filters('woocommerce_sale_flash', ''.__( 'Sale!', 'woocommerce' ).'', $post, $product); ?>     endif;      Now i am lost, where do i go from here? How do i add my attributes to my product-catalog and single product page? Where do i go from the `apply_filters`? How do i find the generated html for the attributes?


title: translate iframe content- transposh filter

text: I am using transposh plugin to translate content. Its working fine but it is not able to translate iframe content. I want to show content of another site or remote url. I just want to translate these content using google translator. For this, i am using transposh plugin. I have used               // for iframes we will rewrite urls if we can         elseif ($node->tag == 'iframe') {             $node->src = call_user_func_array($this->url_rewrite_func, array($node->src));         }      in parser.php but nothing happened. Please help me


title: How to modify image editor dialog options on WordPress?

text: I am trying to hide the Alignment radio buttons for images uploaded to the post content area, but can't figure out how to add a custom CSS or JS file to the Image Editor dialog. I've successfully added a filter to the tiny_mce_before_init action hook to remove alignment buttons from the TinyMCE text editor, but am unsure how to do the same with the image editor. ![enter image description here](http://i.stack.imgur.com/1ZzoZ.png) I've tried a jQuery hack, but it doesn't seem to take:               $('.mceWrapper iframe').load( function() {         $(this).contents().find('tr.align').hide();     });


title: Videos via the video shortcode are always 640px wide?

text: I've run into a particular problem with the Video Shorcode of WP. I can't seem to change the size of the player with the attributes of the Shortcode. This happens on multiple sites with multiple templates (Twenty Thirteen included). Here's the visual : ![enter image description here](http://i.stack.imgur.com/HzwIx.jpg) So I have 2 video tags, one with a width of 720 and the other with a width of 930. ![enter image description here](http://i.stack.imgur.com/7PN0E.jpg) In the page, they are both the same size (640px wide) even if they still have place in their container (see orange box by the developper tools, meaning that there's untaken space on the right of the first video) and they both had different sizes over 640. I don't understand what is happening here. Do I give wrong arguments to the shortcode? I tried to give the width in pixels (720px) but had the same problem.


title: How to add source code into wordpress post really?

text: Ok, I have read and followed the instructions as written in this link: http://en.support.wordpress.com/code/posting-source-code/ I have tried all other the solutions, including reinstall the whole wordpress site, installing syntax highlighting plugins etc. but it just din't work ?! Below is my published post in Twenty Thirteen. My post still display the code block as plain text as you can see. ![My post still display as plain text](http://i.stack.imgur.com/n5WUj.png) Edit: I'm using self-hosted WP and installed (and activated) SyntaxHighlighter Evolved It worked with single line code, but below is what it showed when I typed multiple lines of code: ![enter image description here](http://i.stack.imgur.com/djqRP.png)


title: get video from content

text: I have a post with YouTube video in it. The content is inside `$content`. Currently I am doing `the_content()` and this displays full content on my page. The page contains the list of all videos. The problem is that sometimes the full content is too large to display in this list. So I want to limit the text in the content, but then still want show the first video: I want to   1. get text: take first 200 characters from the content, but without including video   2. get video: take just video link and show YouTube video under the text I am not sure how to archive this. Probably, I would have to use some Regexp and probably I can invent the wheel by my self, but I believe that there should be something already done in WordPress. As I am quite new in WP, I have not found anything yet.


title: WordPress Popular Posts Table Size Is Getting Big

text: I uninstalled WordPress Popular Posts plugin because it is getting slow lately. By digging to my database, I found that the table wp_popularpostsdatacache which is part of WordPress Popular Posts plugin is getting big. Currently it has 3,501,405 rows with 160.7 MiB used space. I am thinking that this record was not cleaned because I am using nginx instead of apache. This happens to me on my Drupal site also. But I cannot confirm this. So, do you think this is because of nginx? If not, why it is getting bigger and bigger? It seems that the record there is not deleted. I am using "Last 24 hours" option in Time Range option of this plugin. So I think a record of yesterday will be deleted automatically. But this is not the case. Any idea about this?


title: post author changes when editing post

text: I have the following function which alows me to set a post author, even if they are only a subscriber:               add_filter('wp_dropdown_users', 'MySwitchUser');     function MySwitchUser($output)     {              //global $post is available here, hence you can check for the post type here         $users = get_users('role=subscriber');              $output = "<select id=\"post_author_override\" name=\"post_author_override\" class=\"\">";              //Leave the admin in the list         $output .= "<option value=\"1\">Admin</option>";         foreach($users as $user)         {             $sel = ($post->post_author == $user->ID)?"selected='selected'":'';             $output .= '<option value="'.$user->ID.'"'.$sel.'>'.$user->user_login.'</option>';         }         $output .= "</select>";              return $output;     }      The subscribers can create posts from the front end of the site, but in some cases the admin will need to go into the post and update a few things via the wp backend. When the admin updates and publishes the post, the post author will change from the originally post_author to the admin. Is there a way i can get around this?


title: Help on setting up correct path for sites in multisite-setup

text: I have a multisite installation and I have the following sites:   1. Root(site path: `/`)    2. Root English(site path: `/en`)    3. About(site path:`/about`)   4. * _About English(site path:`/en/about`) *_ The problem is with 4, I can't get the path to work. This is a multilingual setup and I want to have `example.com/about` and `example.com/en/about` or `example.com/about/en`. Any ideas?


title: Infinite scroll and ajax not working properly

text: I have category page (work) which list all the work post in this category. I also plug infinite scroll plugin which load next post of the same page. On click I load content of that post. but in next page which loads from INFINITE SCROLL don't load the content in same manner               jQuery('.work-thumb').on('click',function(e){                 var project = jQuery(this).data('project');         if( $('.appendDiv').length >= 1 ){             $('.appendDiv').html(project);         } else {             $('<div class="appendDiv"><div>').html(project).appendTo('body');         }              /* Ajax Calls and data */         $href = $(this).attr('href');         console.log( $href );         e.preventDefault();         window.history.pushState("", "", $href );         jQuery.ajax({             url: $href,             type:'POST',             data:{currentUrl:currentUrl}         }).done(function( data ) {             var node = data;              jQuery('.work_ajax_div').html(node);             $('work').hide();             //aa();         });      i think .on('click') is not working. how do i resolve these issue. i also paste that code in infinite-scroll plugin file (footer.php)


title: Query for first 3 posts to change the look and feel

text: Is there a way to query for the first three recent posts and then change how they display on the front page? I want the first three posts of my blog to show differently than the rest of them i.e. they will have full images, and my other posts will just have thumbnail previews. Thanks for any help in the matter.


title: Creating Database Table vs. Adding MetaData to Post & User

text: I am creating some event functionality for my wordpress site. Each event will have a set of tickets associated with it. A user who is purchased at least one ticket will additionally have a set of bookings associated with it. My question: would it make sense to store the tickets in the post meta (an event is a custom post type) and the bookings in user meta? Or should I create a few more tables in the database? Are there any good resources about the caveats of creating new tables in a wordpress install?


title: RSS feed is empty

text: is anybody know about this issue? I have implemented RSS feed in functions.php file for two custom post types:               function myfeed_request($qv) {      if (isset($qv['feed']) && !isset($qv['post_type']))        $qv['post_type'] = array('news', 'commentary');      return $qv;     }     add_filter('request', 'myfeed_request');      than I have a link to Rss feed as : `<a href="<?php bloginfo('rss2_url'); ?>">Subscribe to RSS </a >` Once I click on the link I'm getting empty RSS feed and "page not found". Thanks in advance. DT


title: Permalink of Custom Post Type

text: I am trying to create a custom post type called an 'event' and have it's permalink structure be as follows: www.domain.com/events/238 where 238 is the post ID. However, when I navigate to the page, I get a 'no results found' page. Here is my code (I abbreviated the register_post_type call to include only the important elements).               add_action( 'init', 'initialize'));          function initialize() {     register_post_type('event',         array(         'labels' => array('name' => 'Events'),         'public' => true,         'publicly_queryable' => true,         'query_var' => true,         'rewrite' => false,         'show_ui' => true,         'has_archive' => true)         );          global $wp_rewrite;          $event_structure = '/events/%event_id%';     $wp_rewrite->add_rewrite_tag("%event_id%", '([0-9]+)', "event_id=");     $wp_rewrite->add_permastruct('event', $event_structure, false);     }          add_filter('post_type_link', 'handle_permalink', 10, 3);          function handle_permalink( $permalink, $post_id, $leavename ) {     $post = get_post($post_id);              if ( $post->post_type == jp_event::POST_TYPE ) {             $rewritecode = array( '%event_id%' );             $rewritereplace = array($post->ID);             $permalink = str_replace($rewritecode, $rewritereplace, $permalink);             return $permalink;     }         return $permalink;     }      How do I make this code work? What am I doing wrong?


title: Determine the category that an archive-page is for

text: On a _category archive page_ , how do I determine what category the archive page is for? I need either the _id_ or the _slug_ of the category. I am _not_ looking for `get_the_category()`. This will give me all categories of the _posts_ on this page (which can be subcategories of the category that the page is for). Instead, I want the category that the archive page is for. _How can I get this category?_


title: Is it possible to read a result if wp_update_user or update_user_meta fails?

text: I am using both wp_update_user() and update_user_meta() and I want to be able to check for an error, and if one occurs, output it to the user. Is this possible using something like $result = wp_update_user()? I don't want an integer though I want to read the text of the error.


title: Listing authors, discription and rss feed in alist

text: I'm trying to list my sites authors, their description, and rss feed link on a single page. I have experimented with the author_list functions with scattered results. Can anyone point me in the right direction.


title: Registering multiple copies of a widget

text: I'd like to be able to register multiple copies of the Quick Search Widget in the code below, so that I can have it multiple sidebars. The code has been taken from a plugin I've downloaded               function quickSearchwidgetform()          {            include(WP_DSP_ABSPATH . 'wp_search_wiget_form.php');          }                    function widget_dspquicksearch($args) {            extract($args);            echo $before_widget;            echo $before_title;?>     Quick Search<?php echo $after_title;            quickSearchwidgetform();            echo $after_widget;          }          function dspquicksearch_init()          {          wp_register_sidebar_widget(              'dsp_quick_search_widget',        // your unique widget id              'Quick Search Widget',          // widget name              'widget_dspquicksearch',  // callback function              array(                  // options                  'description' => 'A Quick Search widget that displays dsp dating quick Search form.'              )          );            }          add_action("plugins_loaded", "dspquicksearch_init");      Now I've read in the codex that the new updated method of registering a widget, should be done by register_widget() - however, when I update the code below to use this, the widgets page in my admin screen goes completely white. Admittedly I may be out of my depth here, but am keen to learn how to fix this. Any tips would be greatly appreciated. Thank you


title: NextGEN Gallery styles don't work

text: I am new to wordpress but I'm ambitious and I'm diving right into theme creation from scratch. So far so good until now... I've installed the nextGEN gallery but the styles wont work (i.e. Hovereffect styles). Everything works except the images just show in a plain column. If I add to the header.php the styles work but my header image gets messed up. What would be the proper way to code my theme to work with the styles of this plugin? Any help/suggestions would be greatly appreciated. Thanks!


title: Post Views Code Hacks

text: // Post views         function getPostViews($postID){             $count_key = 'post_views_count';             $count = get_post_meta($postID, $count_key, true);             if($count==''){                 delete_post_meta($postID, $count_key);                 add_post_meta($postID, $count_key, '0');                 return "0 View";             }             return $count.' Views';         }         function setPostViews($postID) {             $count_key = 'post_views_count';             $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');             }else{                 $count++;                 update_post_meta($postID, $count_key, $count);             }         }      The code above remembers and displays post views but there is two problems with it:   1. When there is 1 view it should produce the word "view" not "views" With all other numbers it should say "views" (as it currently does.)   2. No commas are added tot he number displayed. Instead of a number displaying as 1,234 it will display as 1234.


title: wp_signon gives error insufficient_permissions

text: This seems odd to me because if you're signing on a user you shouldn't already be signed in... therefore your permissions shouldn't matter. It may be a bit of an odd way of going about it, so that could be causing the issue. Here's the code:               function login( $user_name, $password ) {         $creds = array();         $creds['user_login'] = $user_name;         $creds['user_password'] = $password;         $creds['remember'] = false;              $user = wp_signon( $creds, true );              if( is_wp_error( $user ) ) {             $result = $user;         }         else {             /* do some other stuff */         }              return $result;     }      This is found on a separate page used for web services... this page loads the proper WordPress functions with:               require_once('../../../../../wp-load.php');      And is posted to via jQuery from the front end. Worth noting that other WP functions such as interaction with `global $wpdb` works in this file.


title: Admin sidebar customization

text: My new clients wordpress site does not have plugins, appearance or any of the other default items in the admin sidebar. Can anyone tell me how I get those to appear. The site is being run in a sub-directory of the main site. It has it's own wordpress installation. The theme is rttheme16 from themeforest. Thanks in advance.


title: Escaping quotes from shortcode attributes

text:
I have been trying to figure out how to escape quotes (single and double) from shortcode attributes. Basically the content is written by the user and therefore can potentially include " and ' quotes. Problem being, with " quotes it is stopping the shortcode attribute from functioning eg: attibute="some text here with "quotes" so it stops the attribute...." So instead of getting the entire string it is stopping at the second pair of quotes. Now, I know it could be possible to set it up with single quotes but that leaves the same predicament if a user uses single quotes in the text. I have looked at a variety of PHP/WP resolutions but I cant seem to get any of them to work, eg esc_html, htmlspecialchars, htmlentities. Maybe I have set it up wrong or am not actioning the encoding at the right place. This is currently what I am using (without encoding) as the shortcode (shortened a bit)               function aps_person_schema_shortcode( $atts, $content = null)   {          extract( shortcode_atts( array(                      'aps_person_description' => ''             ), $atts         )     );          $aps_person_return = '
';     $aps_person_return .= '
' . $aps_person_description . '
';     $aps_person_return .= '
';          return $aps_person_return;          }     add_shortcode('aps_person', 'aps_person_schema_shortcode');      I've tried adding in after the extract array things like               $aps_person_description = esc_html($atts['aps_person_description']);       but as the attribute is already broken (print_r displays that the string after the quote is separated into an array item for each word) escaping the string there doesnt work. Tried it before the array and it doesn't work either I get a Notice: Undefined index So, to clarify, how do you go about sanitizing user input for shortcode attribute data?


title: Truncating characters in Advanced Custom Fields works some places but not others?

text:
I'm using the Advanced Custom Field plugin - although I'm not positive that is relevant. Nonetheless, I can't get substr() to work at all using this method:               $givchars = 5;      $postgiv = the_sub_field('get_involved_text');      $modgiv = substr($postgiv, 0, $givchars);      echo ' ' .$modgiv. ' ';      However substr() does work when I do this:               $second_query = new WP_Query( $args );     if ( $second_query->have_posts() ):        while( $second_query->have_posts() ) : $second_query->the_post();             $titlechars = 5; // Character Limit        $posttitle = get_the_title();        $modtitle = substr($posttitle, 0, $titlechars);             $attachment_id = get_field('image');        $size = 'customfeatins'; // (thumbnail, medium, large, full or custom size)        $image = wp_get_attachment_image_src( $attachment_id, $size ) . 'http://placehold.it/136x90';              echo '

' . $modtitle .'

' . get_the_date() .'

         ';             endwhile;     endif;      I'm just learning WordPress and my php skills are pretty limited, am I totally overlooking something?


title: Custom widget using get_categories select menu dropdown

text:
I have created a custom widget that is supposed to display a select menu with all the categories the blog has. I have used get_categories to compile the list. This works fine and all categories appear in a drop down menu. Each time I save and refresh the widget page, the custom widget is not there anymore. I checked `function update` and everything is fine there. So I figured it must be the way I created the form. Any ideas? Thanks in advance. I didn't want to dump all the code, so I only pasted the function that creates the form. If you need more just drop a comment               function form( $instance ) {              /* Default Widget Settings */              $defaults = array(             'title' => 'Highlight Category',             'select'=> 'Option 1'         );              $instance = wp_parse_args( (array) $instance, $defaults );           ?>
             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e('Title:', 'lang') ?>             <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />

             <label for="<?php echo $this->get_field_id('select'); ?>"><?php _e('This is a select menu', 'lang'); ?>             <select name="<?php echo $this->get_field_name('select'); ?>" id="<?php echo $this->get_field_id('select'); ?>" class="widefat">                  <option value="<?php echo $this->get_field_name('select'); ?>"><?php echo $instance['select']; ?></option>                  <?php                   $categories=  get_categories('child_of=0');                   foreach ($categories as $category) {                     $option = '<option value="' . $category->cat_name . '" id="' . $this->get_field_id( 'select' ) . '">';                     $option .= $instance['select'];                     $option .= ' ('. $this->get_field_id( 'select' ) .')';                     $option .= '</option>';                     echo $option;                  }                 ?>             </select>
          <?php      }


title: Unable to add extra elements to the main navi (wp_nav_menu_items)

text:
I'm trying to get the list of authors to automatically appear on the main navi (without having to manually add them one by one as they are created). So far I added this on my functions.php, but no luck:               function wps_nav_authors ( $items, $args ) {     if ( $args->theme_location == 'Primary') {     $items .= '
Authors

' . wp_list_authors('show_fullname=1&optioncount=0&exclude_admin=0&orderby=post_count&order=DESC&number=8&echo=0') . '

';     }     return $items;     }     add_filter( 'wp_nav_menu_items', 'wps_nav_authors', 10, 2 );      I've also tried with simpler codes just to see if I was able to add a random li element to the menu, but also without result. I tried with:               add_filter( 'wp_nav_menu_items', 'your_custom_menu_item', 10, 2 );     function your_custom_menu_item ( $items, $args ) {     if ($args->theme_location == 'Primary') {     $items .= '
Show whatever
';     }     return $items;     }      Also, my main menu is called Primary. Any ideas? Thanks!


title: How does WordPress determine which multisite the user is on from the URL?

text: What is the file and line where WordPress determines which multi-site the user is on from the URL? I've been looking through the code all afternoon and can't figure out where it turns `mysite.com/blogbase/myblog` into `2` (the ID). There's a `get_id_from_blogname()` function, but it doesn't seem to be called on load?


title: Changing plugin options from theme functions file?

text: I am making a starting-point Wordpress theme that will be used on dev projects. In this theme, I am automating common plugin installs that are used on every project. I have been able to automate Wordpress Core settings using the `update_options()` function. What I now want to do is update options of plugins in the same manner, but I am not having any success. For example, I use Search Everything as a typical plugin. I have my own search keyword highlighter, so I want to make sure that the plugin setting for search term highlighting is always off (as to not interfere). Here is the code I'm working with:               add_action('admin_init', 'nebula_plugin_force_settings');     function nebula_plugin_force_settings(){         if ( file_exists(WP_PLUGIN_DIR . '/search-everything') ) {             //Tried the option slug in the array():             update_option('se_use_highlight'], false);                  //Tried hard-coding the array and key:             update_option('se_options["se_use_highlight"]', false);                  //Tried setting the array as a variable:             $se_options = get_option('se_options');                         update_option($se_options['se_use_highlight'], false);         }     }      None of those attempts worked. I feel like I'm getting close because when I `var_dump()` the array, or echo the `get_option()` I can see the setting, but I just can not update that setting. Any ideas?


title: Please help, cant publish in Wordpress

text: Im having a big problem. I can login as admin into my wordpress site but now I get a blank page.   I have the site since 2011 and never modified or change anything so thats why I dont know what happened. How can I fix this? See screenshot:![enter image description here](http://i.stack.imgur.com/ee0nc.png)


title: How do I count columns on a custom WPDB query?

text: How would I count the columns of a custom `WPDB` query? This does work although I need a different kind of output:               $sql_assoc = "SELECT * FROM test";     $num_cols  = count((array) current($sql_assoc));          echo $num_cols;          OUTPUT:      47      But what I would want is every `column`+the total as output, like so: `4712345678910111213141516171819202122232425262728293031323334353637383940414243444546` Usually you'd accomplish this by doing the following but of course this won't work in wordpress or at least I have no idea how to use `field_count` in wordpress since outputting query results of a custom `WPDB` goes differently like so in PHP:                $sql = "SELECT * FROM test"      if($result = $mysqli->query($sql))           {             $numcol = $mysqli->field_count;           }


title: How to limit posts to 1 from each term with tax_query?

text:
Need 1 post from each.               <?php               global $post; // required                  $args = array (                 'tax_query' => array (                     'relation' => 'AND',                     array (                         'taxonomy' =>'category',                         'field' => 'slug',                         'terms' => array ('economy','the-constitution','monetary-policy','liberty')                     ),                     array (                         'taxonomy' => 'highlight',                         'field' => 'slug',                         'terms' => array ('lead','featured'),                         'operator' => 'NOT IN'                      )                 )             );                  $posts = get_posts($args);                  foreach ($posts as $post) {                      setup_postdata($post); ?>
                     <?php if(has_post_thumbnail()): ?>
<?php the_post_thumbnail('PostThumbSideBar'); ?>
<?php else: endif; ?>
<?php the_category(' '); ?> <?php the_tags(' '); ?>
                     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
              <?php } ?>         <?php wp_reset_query(); // reset the query ?>


title: How to include in a child page url the parent slug?

text: I have this page structure: > Auto (parent) with child pages: Ford, Audi, Opel, etc. Normally accessing the opel page the url is               example.com/auto/opel       and I want to obtain               example.com/auto-opel      UPDATE 1: I tried so far :               function change_page_permalink( $post_link, $post ) {          if ( 'page' != $post->post_type )              return $post_link; $uri = '';         foreach ( $post->ancestors as $parent ) {            $uri = get_post( $parent )->post_name . "-" . $uri;         }         return str_replace( $uri, '', $post_link );      }      add_filter( 'post_type_link', 'change_page_permalink', 10, 2 );       but with no success.


title: Wordpress Multisite: Have the same header and footer of main-blog on all sub-blogs

text:
I'm trying to do the following: I have a Main-Blog and dozens of subblogs. I want all the subblogs to use the same theme (or child-theme, not sure yet) but have the same navigationitems of the mainblog on all subblogs? The same for the footer. How'd I do that? This is my Main-Blog and Landing-Page > ![enter image description here](http://i.stack.imgur.com/C4CdB.jpg) If I click on Subblogs and chose a Subblog i just want the content area to be affected, the header and the footer should stay the same over the entire network. > ![enter image description here](http://i.stack.imgur.com/koQxv.jpg) Inside the content-area of a subblog I'd than like to use the pages and posts of the subblog. What is the right way to do this? * * * Update:
         <?php                  //wp_list_pages('title_li=&depth=1&exclude=42,311');                  $args = array(                 'authors'      => '',                 'child_of'     => 0,                 'date_format'  => get_option('date_format'),                 'depth'        => 1,                 'echo'         => 0,                 'exclude'      => '42,311',                 'include'      => '',                 'link_after'   => '',                 'link_before'  => '',                 'post_type'    => 'page',                 'post_status'  => 'publish',                 'show_date'    => '',                 'sort_column'  => 'menu_order, post_title',                 'title_li'     => '',                  'walker'       => ''             );                  $menu = wp_list_pages( $args );             update_option('network_menu', $menu);             echo $menu;         ?>
      in my child-theme I do:
         <?php              $menu = get_option('network_menu');                 echo $menu;         ?>


title: Jetpack Running Locally

text: Wondered if anyone knew an easy way around this. The code behind my local dev version of a WordPress instance and the live version are in sync (as they should be). Problem is this means the "Jetpack" plugin is working on the live version (since it's a live blog that can connect to WordPress.com) but not on the local dev version. This means functionality is available on the live version (like the "Subscribe" sidebar widget) but not on the local dev version, thus they're out of sync.


title: Dynamic banner for use on external sites

text: Pro question: we would like to display our most current wordpress articles on external sites (something like advertisments or banners). I think this could be easily done with iFrames, but I doubt that other people are willing to integrate them. **Is there a way to dynamically create an image (png, jpg, whatever), which lists the recent articles?** Thanks :-)


title: Best way to handle redirects

text: I have number of pages that have had the urls changed, how can I setup a list of old urls and set the new urls they should point to? Thanks, Paul


title: Fallback_cb is messing around with containers

text:
I have the following code in place for a custom menu area:               $wp_nav_header = array(          'container' => '',         'menu_class' => 'sf-menu',         'fallback_cb' => 'wp_page_menu',         'theme_location' => 'primaryheader',         'depth' => 0,);     wp_nav_menu( $wp_nav_header);      It works fine when there **is** a menu in place, and outputs:

<li...      However, when it's **falling back** , it outputs:

<li...      Needless to say, this is throwing off my design as it's adding these classes (for which I have no styling) & stripping suckerfish , but makes my nav disappear (despite showing up in source). Anybody encounter this before? Thank you!


title: How long does it take to update a plugin page from the readme.txt?

text: So I updated my plugin this morning to a new version and made some changes to the readme.txt (basic FAQ, changelog info). But the plugin site isn't reflecting the changes. I updated the 'Stable tag' to version 0.0.2, then copied the trunk file to the tags/0.0.2 directory. The svn page shows the correct readme.txt . Am I missing a step?


title: Wordpress + bbPress registration user-unfriendly?

text: I'm testing Wordpress + bbPress (both latest versions): http://alexchen.info/ When I press Register it sends me to Wordpress' backend login page (I'm no longer in the site). If I click the Registration User page, and fill my username and email it sends me to Worpdpress' backend login page again and it says: `ERROR: The password field is empty.` Is there a way of letting the user just sign up while being on the site?


title: Can I use custom post types to create a parent/child relationship?

text: I'd like to store information about TV shows this way: series (general information about the series) --episode 1 (video of ep.1 + info about episode) --episode 2 (video of ep.2 + info about episode) ... --episode n Taxonomies could be used for some of the additional info, such as production year, actors, network, etc. I've currently set this up with a Page for each show and regular Posts for each episode. I link the episodes together with the Organize Series plugin. Is this possible using just custom post types? It seems like it would make things easier as the site grows. Thanks for any help.


title: Filter to modify post_title after image upload?

text: When I upload images, Wordpress 3.4.2 sets the Title to the base of the filename, such as "DSCN1234" or "IMG_1234". I'd like the Title to be left blank. The code that sets the Title during the upload seems to be in "wp- admin/includes/media.php" in the function `media_handle_upload()`, here:               // Construct the attachment array     $attachment = array_merge( array(        'post_mime_type' => $type,        'guid' => $url,        'post_parent' => $post_id,        'post_title' => $title,        'post_content' => $content,     ), $post_data );      If I just change it to `'post_title' => "",` it fixes it, but I understand that the core code shouldn't be modified. Is there a filter I can use to modify the Title after it's been set by the upload handler? I tried `wp_handle_upload` and `wp_handle_upload_prefilter` but they don't give me access to the `post_title` data. The filter `attachment_fields_to_edit` does give me access to `post_title`, but it's fired for every image when editing a gallery -- I just want to modify the `post_title` of a single image immediately after it's uploaded. (if the user manually sets the Title to the filename afterward, I don't want to remove it.) Any other ideas? * * * UPDATE: well, I just discovered that the `post_title` is set back to the file name every time the gallery is updated (re-sorting images, etc.) And even if I use the `attachment_fields_to_edit` filter to clear the `post_title`, it doesn't stay cleared because when I click Save Changes, something is apparently not liking the fact that I've set the Title field to be empty even though it's a required field (red asterisk next to it). Other ideas appreciated. Thanks!   Russell


title: author list not linking to correct page

text:
I have an odd problem with the author list. I am using the below code in my sidebar to pull in the gravatar and link to author's profile. However, the links it's actually generating are wrong. It just generates links to the page that it's on. So when you're on the blog page, all the author links are www.mysite.com/blog/. Any idea why this could be happening??               <?php         $order = 'user_nicename';         $user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users WHERE ID <> 1 ORDER BY $order"); // query users         foreach($user_ids as $user_id) : // start authors' profile "loop"         $user = get_userdata($user_id);         ?>
<?php echo get_avatar( $user->ID, '80' ) . 'user_url . '">' . $user->display_name . ''; ?>
         <?php         endforeach; // end of authors' profile 'loop'      ?>


title: $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies

text: It's easier if I made an example: I have a custom post type **MYPOSTTYPE** , with 3 taxonomies **TAX_1** , **TAX_2** and **TAX_3** If I have 3 terms: 'TERM_TAX_1' in **TAX_1** , 'TERM_TAX_2' in **TAX_2** , and 'TERM_TAX_3' in **TAX_3** , how can I count how many MYPOSTTYPE have all the 3 terms with a SQL query and $wpdb? I've tried with something like this, but it's not working... the counter is always at 0               SELECT COUNT($wpdb->posts.ID) AS counter     FROM $wpdb->posts          LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)         LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)         LEFT JOIN $wpdb->terms AS tax_one ON ($wpdb->term_taxonomy.term_id = tax_one.term_id)         LEFT JOIN $wpdb->terms AS tax_two ON ($wpdb->term_taxonomy.term_id = tax_two.term_id)         LEFT JOIN $wpdb->terms AS tax_three ON ($wpdb->term_taxonomy.term_id = tax_three.term_id)     WHERE 1=1         AND $wpdb->posts.post_type = 'MYPOSTTYPE'         AND $wpdb->posts.post_status = 'publish'         AND $wpdb->term_taxonomy.taxonomy  IN ('TAX_1', 'TAX_2', 'TAX_3')         AND tax_one.slug = 'TERM_TAX_1'          AND tax_two.slug = 'TERM_TAX_1'         AND tax_three.slug = 'TERM_TAX_1'      **UPDATE:** I've also tried with **tax_query** , but I had this problem Problem with get_posts, tax_query and counting the number of posts so I wanted to try to do a query directly to the database