title: Featured Image Size Conditional Tag?

text: Is it possible to check what image size has been selected for the featured image and only display that image.. For example.                   <?php if(has_post_thumbnail('small-image')): ?>                          <?php the_post_thumbnail('small-thumb') ?>small image is showing                  <?php elseif(has_post_thumbnail('full-thumb')): ?>                          <?php the_post_thumbnail('full-thumb') ?>large image is showing                  <?php endif ?>                  <?php the_post_thumbnail() ?>default image if none selected      Not sure if that makes sense..?


title: Conditional Ajax inclusion

text:
I have a custom interface that uses 30+ ajax files while running...   some files are only used in category.php while othere's are only   used in page.php... i include the ajax loader php files in my functions.php file **example:**               include TEMPLATEPATH . '/ajaxLoops/ajax-open_client_editform.php';     include TEMPLATEPATH . '/ajaxLoops/ajax-submit_client_editform.php';      It all works great but when i tried to conditionally load them   using is_page or is_category directly in my functions.php the ajax   functions stop working. example:               if(is_page()) {         include TEMPLATEPATH . '/ajaxLoops/ajax-open_client_editform.php';     }         include TEMPLATEPATH . '/ajaxLoops/ajax-submit_client_editform.php';      i guess this is a matter of loading order or some other issues i am   unaware of.... Could you help me understand the problem with my approach   or an alternative way of conditionally loading this files?... Cheers,   Sagive. **EDIT 1 (.PHP AJAX LOADER FILE):**               <?php     wp_enqueue_script( 'ajax-simple-example', get_stylesheet_directory_uri().'/ajaxLoops/ajax-simple_example.js', array('jquery'), 1.0 ); // jQuery will be included automatically     wp_localize_script( 'ajax-simple-example', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); // setting ajaxurl          add_action( 'wp_ajax_action_simple_example', 'ajax_simple_example' ); // ajax for logged in users     function ajax_simple_example() {              // just an empty example for my question         // in stackexchange              echo '
'.$successMsg.'
';              die(); // stop executing script     }     ?>


title: Apply permissions per post

text: We have a WordPress site where we have external authors for whom we have created usernames at the `Editor` level. We want these editors to be able to create new posts and modify their own posts, but occasionally we have posts in progress that we'd rather keep more private. It is a very small pool of users, and an even smaller number of posts to "protect," so I am okay with any technique that requires explicit GRANT for our own users or explicit DENY for the external users. DENY would be easier of course, but I am not going to get fussy.


title: Use PHP in stylesheet to specify a background image based on Category ID

text: In my stylesheet I'm hoping to use code like this...               background-image: url(/wp-content/images/' . $category->cat_ID . '.jpg);      ...to pull in a different background image for each category. So I'll have an image called 1.jpg and it'll show that image as the background to the li element I'm trying to style for Category 1. That approach works fine in template files like this...               <img src="/wp-content/images/' . $category->cat_ID . '.jpg">      ...but in the stylesheet it's not working for me. Any tips?


title: How to save WP widget instances and options

text: I'm a little confused about this, even though I have read all of the API and searched for hours. When I activate my plugin I add some values to the options database, e.g.               add_option('code','24');      How do I update that value or use it in the widget? I only see "instances" now, like the example on this page: http://wpcoderz.com/creating-a-multi-instance-widget-with-wordpress-2-8/ I don't really understand what instances are, the WP documentation doesn't provide much explanation about it.


title: how to stop wordpress from parsing specific urls?

text: I have this custom search url example.com/find?q=foo that I respond to by hooking into parse_request, but when, for example, echo some test phrase, WP still continues to parse that request and eventually throw 404 along with my echoed text. How can I stop WP from doing any sort of parsing on that specific url and instead do my custom handling and return my own template from plugin folder?


title: Delete old JetPack Site Stats? encrypted_search_terms in top search terms

text: I created a new baseball website. To create the site, I basically just duplicated my football site and changed/modified the theme. Being that I simply copied a site, all of the JetPack Site Stats reference the old football site stats. So, top posts, top seaches, total views, busiest, etc. all refer to the football traffic. How can I delete these old stats, everything prior to March 26, 2012? I should note that the old site used the Wordpress.com Site Stats plugin, but I updated to Jetpack after copying to the new site. I don't know if this makes a difference, but figured I should mention it. Also, encrypted_search_terms shows in the dashboard widget for "Top Searches". I imagine this is from the old search and traffic results. # UPDATE I contacted the JetPack developers about this. Their reply: > I can confirm that the two sites are establishing separate connections at > this point, so your stats should be correctly reported moving forward. > Unfortunately, there isn't a way to separate stats once they've already been > combined. > > In the future, please be sure to set up databases and install WordPress for > each instance separately. > > Feel free to drop us a line if we can be of any further assistance. I then asked: > Which table in the database controls the stats? So I can exclude it from > export when I decide to copy the site again? Their reply makes me believe that it is possible to remove old entries, but after multiple emails exchanged when I asked the initial question, they have not replied to my last question for three days.


title: 404 error on homepage when using Nginx proxying to Apache

text: I generally use Nginx to serve static content on my server, with Apache handling PHP content using PHP-FPM. However, I'm not able to get a Wordpress blog homepage to display and I've tried all the configuration examples I can find on the web without much luck. Here is my Nginx config:               server {                  listen   XXX.XXX.XXX.XXX:80;             server_name wptest.mydomain.com;              access_log  /var/log/nginx/testblog_access.log combined;         error_log /var/log/nginx/testblog-error.log;              proxy_set_header X-Real-IP  $remote_addr;         proxy_set_header Host $host;         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;              location / {                         proxy_pass http://127.0.0.1:80;         }              location = /50x.html {                 root   /var/www/nginx-default;         }              # No access to .htaccess files.         location ~ /\.ht {                 deny  all;         }          }      My Apache config is as follows:               <VirtualHost 127.0.0.1>         ServerName wptest.mydomain.com         ServerAdmin webmaster@mydomain.com         LogLevel warn         ErrorLog /var/log/apache2/testblog-error.log         CustomLog /var/log/apache2/testblog-access.log combined              Options +FollowSymLinks +ExecCGI -Indexes -MultiViews         AddHandler php-fastcgi .php         Action php-fastcgi /wordpress         Alias /wordpress /var/www/wordpress         FastCgiExternalServer /var/www/wordpress -host 127.0.0.1:9000         RewriteEngine on              DocumentRoot /var/www/wordpress         DirectoryIndex index.php                              <Directory />                                 DirectoryIndex index.php                                 AllowOverride All                                 Options +FollowSymLinks +ExecCGI +SymLinksIfOwnerMatch                         </Directory>                              <Directory /var/www/wordpress>                                 AllowOverride All                                 Options +FollowSymLinks +ExecCGI +SymLinksIfOwnerMatch                         </Directory>     </VirtualHost>      I am not able to view "http://wptest.mydomain.com/" or "http://wptest.mydomain.com/wp-admin" but "http://wptest.mydomain.com/wp- login.php" does work. What am I doing wrong? Version information: + OS: Debian 5/Lenny + Apache: 2.2.9 + Nginx: 0.7.65 + Wordpress: 3.1.2


title: Wordpress and event-driven programming - what is it about?

text: I want to state very clearly that this does **not** intend to revive the discussion about functional/procedural programming versus object-oriented programming. There is plenty said about that, on WPSE and all over the net. **But** a while ago I'm reading over some of the discussions about the programming foundations of Wordpress and I read something - I have to rephrase because unfortunately I didn't bookmarked it at the time - roughly like this: > One of the appealing things about using Wordpress is that they are > additionally working based on the **event-driven paradigm** of programming. From what I understand _event-driven programming_ in this context is pretty much _synonym_ to _signal_ or _dataflow_ _programming_. Furthermore - most likely oversimplifying it a lot - maybe the main apparent characteristic is the use of _hooks_ - actions and filters - as linchpin for the method. So far so good. Seems easy enough, but I'm not coming from a computer science background, so I'm pretty sure there is more to be said. I'm really interested in some input, like: What is it really about or is the above said pretty much it? Is it an extra paradigm? How does it relate to the other ones? Is it a core principle or just an addition? Those are just off the top of my head, clearly breaching the rules, by not asking one singular question that has one distinct answer, but maybe this will be forgiven for once.


title: Wordpress cache a menu with Transients_API

text: I want to plain to cache a page menu, that takes about 50 queries on page load. At the moment i have cahche setting code with `Transients_API`               <?php                             $housemenu = get_transient('housemenu_key');                                          if (!$housemenu) {                                              $housemenu = wp_nav_menu( array('menu' => '','menu_class' => 'sf-menu','menu_id' => 'nav','walker' => new description_walker()));                                         echo 'not-set';                                              set_transient('housemenu_key', $housemenu, 60*60*3);                                     }                                  echo $housemenu;                             ?>      `$housemenu = get_transient('housemenu_key');` returns a nothing. If i set like this:               $housemenu = 'return corrent'l     echo 'not-set';      All works perfect. Why this menu is not working? Menu can be a walker transient? Use: Wordpress 3.8


title: is_home() returns TRUE on page template

text: I'm wondering why my link: `http://localhost/?page_id=3433` returns TRUE on `is_home()` usage:               if(is_home()){         var_dump(is_home());                                     die('test');                                 }      It clearly has template-mycustomtemplate.php set under Pages > This Page in Admin Panel. Can anyone shed some light on that? UPDATE: it returns TRUE in the loop but FALSE outside the loop. So, I can use workaround but nonetheless, it looks like a bug to me if it returns TRUE in the loop that is present in that template file.


title: Removing a post from the results of a WP Query

text: We have a complicated database query and we would like to exclude some posts. We've tried to do it with SQL, but it's really complicated. The simplest solution seems to loop through the results after the query's made and then exclude a few posts. The problem is, i don't know where to do it! I've tried to unset posts in $wp_query->posts, but they still show up. Is there a proper way to do this? Is there another array WordPress uses that I should unset from?


title: the_excerpt - want to modify password protected output

text: I'm looking to modify the output of the_excerpt when there isn't an excerpt specified and the post is password protected. I already can modify the password protected form to whatever I want, but the_excerpt is outputting "There is no excerpt because this is a protected post.". The code for this lies in wp-includes/post-template.php:               function get_the_excerpt( $deprecated = '' ) {         if ( !empty( $deprecated ) )             _deprecated_argument( __FUNCTION__, '2.3' );              global $post;         $output = $post->post_excerpt;         if ( post_password_required($post) ) {             $output = __('There is no excerpt because this is a protected post.');             return $output;         }              return apply_filters('get_the_excerpt', $output);     }      An easy solution would be to simply change the code in there and move on, but as well all know, changing core files deserves more than a slap across the face! Can anyone help me figure out how to modify this code in my functions.php file? Thanks! **EDIT** : Here's the code I tried out, but it isn't working :(               add_filter('get_the_excerpt', 'improved_get_the_excerpt');     function improved_get_the_excerpt( $deprecated = '' ) {         if ( !empty( $deprecated ) )             _deprecated_argument( __FUNCTION__, '2.3' );              global $post;         $output = $post->post_excerpt;         if ( post_password_required($post) ) {             $output = __('This is some test content.');             return $output;         }     }      I'm completely new to the concept of filters, actions, hooks, etc so please bear with me! I appreciate the help!


title: Display title for search engine visitors

text: I read somewhere*) that there's some `q` part inside the wp_query object, that identifies search engine visitors and shows the keywords they searched for. I'm currently developing local, so i can't access/see `$GLOBALS['wp_query']->q;`. Could someone varify if this exists and/or has some alternate solution for retrieving:   * the search engine _name_   * the _search string_ searched inside the engine? *) Can't remember where, but it had something to do with "better search results page" & "hightlighting search terms". -- **EDIT** -- This is what i got so far:               // declare the server itself as invalid to only catch search engine results     $http_referer   = explode( "/", $_SERVER['HTTP_REFERER'] );     $http_referer   = $http_referer[2];     $home_url       = explode( "/", home_url() );     $home_url       = $home_url[2];          // Coming from a search engine: modify to a search string     if ( isset( $_SERVER['HTTP_REFERER'] ) && $home_url !== $http_referer )     {         // remove previous "s" search query args         remove_query_arg( 's' );              $string = parse_url( $_SERVER['HTTP_REFERER'] );         $query = $string['query'];         $query = explode( "&", $query );         foreach ( $query as $q )         {             $q = urldecode( $q );             $arr = explode( "=", $q );             if ( (string) 'q' === $arr[0] )                 $search_string = $arr[1];         }              // build a new "s" search query arg: if isset, from the string entered in the search engines input form         // in theory that should allow treating it like a normal search result         // the draw back is, that a search engine visitor would never get directly to a post or page          if ( isset( $search_string ) )             add_query_arg( array( 's' => $search_string ) );     }      Aside from the drawback that no search engine visitor would come to a result directly, i wouldn't catch all search engines that way. Google & Altavista got a `q=searchstring` query argument. Yahoo for eg. uses `p=`...


title: Website Address Keep redirect to website after migration attempt

text: I have a loclhost site that I heard I can migrate the site by just copy and paste the whole site from local to host if I changed WordPress Address (URL) and Site Address (URL) to my current hosted site address and then upload it to the host (which I am doing now) Problem is that now when I try to login my local site it will always redirect to my actual website. How can I fix my loclhost site setup so it back to its original loclhost address? ============UPDATE==================================== Added below files into the wp-config of the Wordpress:               define('WP_SITEURL', 'http://localhost/a02business');     define('WP_HOME', 'http://localhost/a02business');      Result: When try to login, the page will still be directed to the actual website not my local site.... Help plz


title: Custom Post Type Dilema - How do I categorise by country?

text: In a site I'm building currently I have a custom post type "story". Each story can be assigned a country. Now country could easily be a taxonomy- term but I'm thinking in the future of creating an editable profile page for each country using custom post type call "country" while retaining a list of stories on that page. What is the best way to do this? Dan


title: What problems maybe happen if I remove "wp-" prefix from wordpress folders and files?

text: I want to hide wordpress signs from my site. So I don't want other people know that I built the website via WordPress. So I decided to remove `wp-` prefixes from all wordpress folders and files. And I also removed `wp-` prefixes from file contents with Notepad++. So my question is what problems maybe happen if I removed `wp-` prefixes ? Thanks in advance.


title: Sub-Pages only of menu items in current branch using a custom menu

text: Although I did a thorough research I could not find a solution. Only solutions coming close. My custom menu ("top") shows this structure (you see a part of it):               page 1       subpage 1.1         category A         subsubpage 1.1.1         subsubpage 1.1.2       subpage 1.2         category B         subsubpage 1.2.1         subsubpage 1.2.2       subpage 1.3         category C         subsubpage 1.3.1         subsubpage 1.3.2     page 2     page 3      Without using CSS (the real structure is by far bigger) I would like to display this in the sidebar, when a user currently looks at page 1 (only its children items):                 subpage 1.1       subpage 1.2       subpage 1.3      And when the user currently looks at subpage 1.1 or any of its custom menu children (incl. posts in category A):                 subpage 1.1         category A         subpage 1.1.1         subpage 1.1.2       subpage 1.2       subpage 1.3      To put it in words: Visible menu items:   * menu items on level 2 (if there are any)   * children of level 2 menu items only for items in the current branch (current-menu-ancestor, current-menu-parent, current-menu-item) I tried a few Custom Walker classes presented in that forum, none of them did the trick. I also tried the plugin Advanced Menu Widget (http://wordpress.org/extend/plugins/advanced-menu-widget/), which comes very (!) close, but there seems to be a bug in it. Use of these settings would do the job generally:   * Show hierarchy: Only related sub-items   * Starting depth: 1 Unfortunately it does not provide the result looking at category A or it's posts in my example. Thank you in advance.


title: WordPress search: pretty URLs (permalinks), custom post types and pagination

text:
I have three separate search boxes on my website: `species` CPT search, `glossary` CPT search and a general search which I'd like to search `post` and `species` post types. My questions are threefold,   1. What's the most efficient/effective code to make pretty search URLs, and is there a reason that WordPress doesn't activate these by default?   2. Bearing #1 in mind, what code do I need to use in `searchform-species`, `searchform-glossary`, `search` and `searchresults` to specify that my species search will only return species results, glossary will return glossary results, etc.   3. How do I incorporate pagination? * * * The code I'm currently attempting is as follows: **CODE FOR #1**               add_action( 'template_redirect', 'my_rewrite' );     function my_rewrite() {              if ( is_search() and false === strpos( $_SERVER['REQUEST_URI'], '/search/' ) ) {             wp_redirect( get_bloginfo( 'home' ) . '/search/' . str_replace( ' ', '+', str_replace( '%20', '+', get_query_var( 's' ) ) ) );             exit();         }          }      **CODE FOR #2 & #3** _searchform.php_               <?php         $search_query = get_search_query();         if (!$search_query) {             $search_query = "SEARCH";         }     ?>     <form id="topbar_search" action="<?php echo home_url( '/' ); ?>" method="post">
SEARCH
         <input type="text" size="50" value="<?php echo $search_query; ?>" name="s" id="s" class="topbar_longinput default-value" />         <input type="submit" value="GO" class="topbar_submit" />
advanced search
     </form>      _searchform-species.php_
PROFILESEARCH
     <form id="profilesearch" action="<?php echo home_url( '/' ); ?>" method="post">         <input type="hidden" name="type" value="profile" />              <input type="text" size="50" class="default-value" value="SEARCH" name="s" />         <input type="submit" value="GO" class="profilesearch_submit" />                  <input type="checkbox" name="showthumbnails" id="showthumbnails" class="checkbox" <?php if ($_POST["showthumbnails"] == "on") { echo 'checked="checked" '; } ?>/>HIDE THUMBNAILS     </form>      _search.php_                   if (isset($_REQUEST["type"])) {             switch ($_REQUEST["type"]) {                 case "profile" :                     $post_type = "species";                     break;                 case "glossary" :                     $post_type = "glossary";                     break;                 default :                     $post_type = array( 'post', 'species' );                     break;             }         } else {             $post_type = array( 'post', 'species' );         }              $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;              $args = array(             's' => $search_term,             'post_type' => $post_type,             'paged' => $paged         );     ?>          <?php get_template_part('searchresults'); ?>      * * * **What's currently happening is this:** The individual searches work, but the pagination doesn't. When I click my `next/previous_posts_link` button, it adds `/page/2/` to the URL and does nothing. If I try to echo out the `get_query_var('page')` it returns `NULL`. If I try to echo out `'paged'` instead, it returns `0`. Additionally when a user clicks this link, the `$search_query` variable from _searchform.php_ is displaying as `page/bettas` (where `bettas` is the original query). * * * **Ideally what I'd like to happen is this:**   1. In the "general search", a user enters _betta_. The URL changes to `/search/betta` which lists any `post` or `species` content containing the word _betta_.   2. In the "species search", a user enters _betta_. The URL changes to `/search/betta/species` (or whatever is best for SEO) and displays a list of only `species` content containing the word _betta_.   3. The same user as #2 then clicks the **Next** button (`previous_posts_link`). The URL changes to `/search/betta/species/page/2` and the user gets to see the next 25 species listed. I'm a complete novice at WP rewriting and pagination so any assistance would be greatly appreciated.


title: How to make a textarea accept javascript in my settings apge?

text: I'm building a simple plugin that will allow us to add code to our site header by defining it on our settings page. However I haven't been able to make it allow scripts. This is my current code:               public function sanitize( $input )     {         $new_input = array();              if( isset( $input['code'] ) )             $new_input['code'] = sanitize_text_field( $input['code'] );              return $new_input;     }          public function code_callback()     {         printf(             '<textarea type="text" id="code" name="pl-analytics[code]">%s</textarea>',             isset( $this->options['code'] ) ? esc_attr( $this->options['code']) : ''         );     }      How can this be done?


title: Resize Admin Featured Image Thumbnail

text: I have a custom post type for a slider and I'm using the Featured Image thumbnail uploader to set the image. I've relocated the Featured Image meta box to be underneath the title section in the admin, and now I would like the Featured Image "thumbnail" to display in the admin post editor screen, at the proportionate dimensions of the image uploaded (in this case a slider image that's 800px wide by 300px high). Currently the image shows up at 266px width and I believe it is this function that is controlling it. I do realise that modifying this is only for ascetics and it won't affect the 'output' size of the image on the front end (I know how to control that). This is simply to show the user the image they have uploaded, in the right proportions. Currently I am using this to shift the featured image meta-box;               // move the featured image box and rename to      add_action('do_meta_boxes', 'wpse33063_move_meta_box');          function wpse33063_move_meta_box(){     remove_meta_box( 'postimagediv', 'slider-image', 'side' );     add_meta_box('postimagediv', __('Add Your Slider Image'), 'post_thumbnail_meta_box', 'slider-image', 'normal', 'high');     }      I have seen in this post, this one and this one (more related to TwentyTen), where others have suggested methods to show a re-sized "thumbnail" in the admin custom post edit screen. I've tried these methods and none of them seem to work / all return server error. I just want to show a larger featured image in the admin CPT edit screen! Seems simple, but am I seeking the Holy Grail ;-)


title: Common categories for two custom post types

text: can I use a category as common for more than one custom post types? In this case same category will have more than one type of posts..


title: How can I include scripts in a jquery loaded page, for a jquery wordpress widget?

text: Iam writing a wordpress widget with the following pages 1) I have master page (master.php) - is the main plugin page - Loads a second page (slave.php) with jQuery 2) The slave page - has php, jquery, css etc. - is an external page Below is part of master.php               <?php         add_action('init', 'register_masterscript');         function register_masterscript() {             wp_register_script( 'master_jquery', plugins_url('/js/master-script.js', __FILE__), array('jquery'), '2.5.1' );                 wp_register_script( 'master_jquery2', plugins_url('/js/master.js', __FILE__), array('jquery'), '2.5.1' );             wp_register_style( 'master_style', plugins_url('/css/master_style.css', __FILE__), false, '1.0.0', 'all');         }              // using the registered jquery and style above         add_action('wp_enqueue_scripts', 'enqueue_masterstyle');              function enqueue_masterstyle(){            wp_enqueue_script('master_jquery');            wp_enqueue_script('master_jquery2');            wp_enqueue_style( 'master_style' );         }         ?>      master.php loads slave.ph successfully but my problem is non of the jquery actions or links work. As slave.php is external I have tried               define('WP_USE_THEMES', false);         require('../../../wp-blog-header.php');      then                <?php          add_action('init', 'register_slavescript');         function register_slavescript() {             wp_register_script( 'slave_jquery', plugins_url('/js/jQuery1.7.1.js', __FILE__), array('jquery'), '2.5.1' );                 wp_register_script( 'slave_jquery2', plugins_url('/js/highlight.pack.js', __FILE__), array('jquery'), '2.5.1' );                 wp_register_script( 'slave_jquery3', plugins_url('/js/combined.js', __FILE__), array('jquery'), '2.5.1' );             wp_register_style( 'slave_style', plugins_url('/css/slave_style.css', __FILE__), false, '1.0.0', 'all');                  wp_register_script( 'slave_jquery4', plugins_url('/js/jquery.mousewheel.js', __FILE__), array('jquery'), '2.5.1' );                  wp_register_script( 'slave_jquery5', plugins_url('/js/jquery.jscrollpane.min.js', __FILE__), array('jquery'), '2.5.1' );          }                // use the registered jquery and style above         add_action('wp_enqueue_scripts', 'enqueue_slavestyle');              function enqueue_slavestyle(){            wp_enqueue_script('slave_jquery');            wp_enqueue_script('slave_jquery2');            wp_enqueue_script('slave_jquery3');            wp_enqueue_style( 'slave_style' );            wp_enqueue_script('slave_jquery4');            wp_enqueue_script('slave_jquery5');         }         ?>      If running the pages without wordpress and without enqueue - ing scripts, the whole code is working fine It looks like for slave.php enqueue -ing is not working, how can i do this the right way ?


title: How to 301 all posts

text: I am currently using domain/%postname%/ but I am looking to change it to domain/folder/%postname%/ - I unsure how to 301 all posts. If I was to use something like Redirect 301 /$ domain/folder/$ I am thinking this would probably also redirect all pages, archives etc to the same structure, which I do not want. How can I do this for posts only? Thanks


title: Custom taxonomy and WP User Frontend

text:
I faced with the following problem: I have custom taxonomy ‘Countries’, which has been defined as:               /* Taxonomies */     add_action( 'init', 'build_taxonomies', 0 );           function build_taxonomies() {          register_taxonomy(           'cf_country',           'post',           array(               'hierarchical' => true,               'label' => 'Country',               'query_var' => true,               'rewrite' => true           )       );       }      /*Taxonomies */      After a few manipulations in function.php in my template, it appeared in admin bar. If I am making posts from dashboard, it works perfectly. BUT An idea of the site is to give ability for users to post their own posts from frontend. This function is realiseted with WP User Front End Plugin. So, I added the following: *** wp-user-frontend/wpuf-functions.php***               function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC', $limit = '-1', $name, $show_option_all = null, $show_option_none = null ) {         $args = array(             'orderby' => $orderby,             'order' => $order,             'number' => $limit,                     'hide_empty'    => false,          );         $terms = get_terms( $taxonomy, $args );         $name = ( $name ) ? $name : $taxonomy;         if ( $terms ) {             printf( '<select name="%s" class="postform">', esc_attr( $name ) );             if ( $show_option_all ) {                 printf( '<option value="0">%s</option>', esc_html( $show_option_all ) );             }                  foreach ( $terms as $term ) {                 printf( '<option value="%s">%s</option>', esc_attr( $term->slug ), esc_html( $term->name ) );             }             print( '</select>' );         }     }      And : *** wp-user-frontend/wpuf-add-post.php***
               Country(-es):          <?php custom_taxonomy_dropdown( 'cf_country', 'date', 'ASC', '5', 'cf_country', 'Select All', 'Select None' ); ?>
Please, choose the right Country, where you want to put your banner.

      Now I have a custom dropdown menu in Add-Post form. And here I’ve got the trouble. When I am submitting the post, my custom choise does not apper in the post. I took the solution for the problem from the (Custom Field as Custom Taxonomy?) And it looks like this:               function save_taxonomy_data($post_id) {              /*           * verify this came from our screen and with proper authorization.         * your form should have a nonce <?php wp_nonce_field('wpuf-add-post','_wpnonce'); ?>         */         if ( !wp_verify_nonce( $_POST['_wpnonce'], 'wpuf-add-post' )) {             return $post_id;         }              // verify if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything         if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )              return $post_id;                   // Check permissions         if ( 'page' == $_POST['wpuf_post_type'] ) { // post type is a hidden field in wpuf_             if ( !current_user_can( 'edit_page', $post_id ) )                 return $post_id;         } else {             if ( !current_user_can( 'edit_post', $post_id ) )             return $post_id;         }              // Work on all post types         if ( isset( $_POST['cf_country'] ) )              wp_set_object_terms( $post_id, $_POST['cf_country'], 'country' );               }     add_action('wpuf_add_post_after_insert', 'save_taxonomy_data');      May be I missed something? Please, Help me! Q_Q


title: Optimizing multiple WP_querys into one call?

text: I have finished building my website and noticed due to the structure it takes 3 seconds to load the data due to each WP_query bouncing between different post types. I was wondering if I put these into one function run so I do not have to run a array each time, if this would have any beneficial effect? Sadly at moment i have tried:               function get_gametitle_info() {          global $post;          $game_terms = get_the_terms($post, 'games_titles');     $game_con = wp_list_pluck( $game_terms, 'slug' );          $game_info = array(         'post_type'=> 'game_information',         'posts_per_page' => 1,         'post_status' => 'publish',         'order'    => 'ASC',         'tax_query' => array(             array(             'taxonomy' => 'games_titles',             'field' => 'slug',              'terms' => $game_con,             ),          )     );                $game_info_query = new WP_Query( $game_info );     while ( $game_info_query->have_posts() ) : $game_info_query->the_post();          $gametitleID = get_the_ID();           if (has_term('3pegi', 'age_ratings', $post)){         $age_terms = array('3pegi'); }          if (has_term('7pegi', 'age_ratings', $post)){         $age_terms = array('3pegi', '7pegi'); }          if (has_term('12pegi', 'age_ratings', $post)){         $age_terms = array(array('3pegi', '7pegi', '12pegi')); }         if (has_term('16pegi', 'age_ratings', $post)){         $age_terms = array('3pegi', '7pegi', '12pegi', '16pegi'); }         if (has_term('18pegi', 'age_ratings', $post)){         $age_terms = array('3pegi', '7pegi', '12pegi', '16pegi', '18pegi'); }     endwhile;          return $gametitleID;     return $age_terms;     return $game_info_query;     }      This gives me a - Warning: Invalid argument supplied for foreach() in D:\xampp\htdocs\wp-includes\functions.php on line 2721 The game_info array only needs to be ran once, i would then love it to be able to use that data instead of doing a new run each times on all other matching querys when i switch the post type back after using a wp_reset_postdata(); Sorry if it is not clear. Another way to explain is I have: [post [A post] post post [A post] post [B post] [A post] ] The constant switching seems abit pointless to me when in truth I only need to do the wp_query once for A and B. Would this save on resources and reduce the 3 second load? Thanks Normal structure inside post file:               $currentID = get_the_ID();     $game_terms = get_the_terms($post->ID, 'games_titles');     $game_con = wp_list_pluck( $game_terms, 'slug' );     $args = array(         'post_type'=> 'game_information',         'posts_per_page' => 1,         'post_status' => 'publish',         'order'    => 'ASC',         'tax_query' => array(             array(             'taxonomy' => 'games_titles',             'field' => 'slug',              'terms' => $game_con,             ),          )/*Search above post type for taxonomy and if matches then proceed*/     );                  $the_query = new WP_Query( $args );     if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();     $gametitleID = get_the_ID();           if (has_term('3pegi', 'age_ratings', $post->ID)){         $age_terms = array('3pegi'); }          if (has_term('7pegi', 'age_ratings', $post->ID)){         $age_terms = array('3pegi', '7pegi'); }          if (has_term('12pegi', 'age_ratings', $post->ID)){         $age_terms = array(array('3pegi', '7pegi', '12pegi')); }         if (has_term('16pegi', 'age_ratings', $post->ID)){         $age_terms = array('3pegi', '7pegi', '12pegi', '16pegi'); }         if (has_term('18pegi', 'age_ratings', $post->ID)){         $age_terms = array('3pegi', '7pegi', '12pegi', '16pegi', '18pegi'); }         endwhile; else:  endif;  wp_reset_postdata();      To further clarifiy I am looking for a way to call the wp_query once on page load (specific to that page) and save the data as a variable to be used within the header, main, sidebar and footer. But NEEDS to be refreshed for each unique page load as the data is highly dynamic and needs to be the latest. At the moment i call multiple wp_query then reset the postdata each time (even if the wp_query calls the same data) due to the way I am required to switch between post types. Simplest way I can possibly manage to explain - Looking for a way to optimize multiple wp_query's of the same data into one call, but able to be used at multiple locations within a template.


title: how to get the post attachement image in full size?

text: Hi i am using the normal loop to get the post content. Objective is to show images or videos in the blog. I tried `the_content()` for the loop but am getting the thumbnail image i belive, What i want is the original image should be there. Here is the code               <?php if ( have_posts() ) :                   while ( have_posts() ) : the_post();                        the_content();//by this am getting the medium sized images from the post content as it is uploaded through add media                   endwhile;                   endif;             ?>      Now i want to show full size of the image for each post. How to do it. can anybody help?


title: using wp_tag_cloud with custom taxonomy

text: I'm building a site for an architect and each Project page has a custom taxonomy called Project Services where the client can add various tags. I want to display them in a tag cloud so I'm using this:               <?php wp_tag_cloud( array( 'taxonomy' => 'project_services', 'separator' => ', ') ); ?>      But - the problem is that on each Project page, it's displaying _all_ the various Project Services tags in the database, instead of on a per page basis. Any ideas?


title: How to modify specific parts of a post content in WordPress

text:
I'm trying to insert some custom code in each post in Wordpress, provided that it complies wit certain conditions. My problem is that the content needs to be added in an specific location that is not the top or the bottom. I know the HTML structure of the posts, since all follow a pattern. I'm guessing that I can use a filter, but I don't know how to actually access and modify the part I want. This is how the structure looks before the modification:

             ...My Content here

      ...and this is how I want it to look afterwards:

             ...My Content here

             ...more content here, added dynamically

      **[EDIT]** To provide a better idea, this is how the code in the template looks (only the relevant part):
         <?php the_content() ?>

                 <?php if(get_post_meta( $post->ID, '_pdf_lesson_version', true )) { ?>
<a href='<?php echo get_post_meta( $post->ID, '_pdf_lesson_version', true ) ?>'>SAVE LESSON
                 <?php } ?>                 <?php if(get_post_meta( $post->ID, '_word_lesson_version', true )) { ?>
<a href='<?php echo get_post_meta( $post->ID, '_word_lesson_version', true ) ?>'>CUSTOMIZE LESSON
                 <?php } ?>
                     <div class="fb-share-button" data-href="<?php echo get_the_permalink() ?>" data-width="200" data-type="button">

      Everything inside the `<ul class="lesson-right lesson-button navigation"></ul>` I need to move into the content of the post. It is outside now, but needs to be contained in the content structure. **[/EDIT]** Any help is appreciated. Thank you for taking the time to read.


title: Permalinks not working for subsite

text: I have a Wordpress multisite install on Nginx. Currently I have site1.com as main site. And I added a new site called site2.com as subdirectory. However, I noticed you can actually click on Network Admin > Sites > Edit (site 2), you can change the domain = site2.com and path=/. Instead of using domain=site1.com and path=/site2. I created to nginx vhost config files under sites-available. And site1 and site2 both work fine. Now you are asking me what is the problem? The problem is with the permalinks. If you put them to /blog/%postname%/ both site1 and site2 work fine. However if you enter site2.com/blablablablaIAMFAKE the server redirects to site1.com whereas it should remain on site2 and display a 404. If you enter site2.com/blog/blablalbalbla the 404 is displayed appropriately. One possible way to solve this is to remove the /blog from the permalinks. The tip given on the internet to change the permalink structure per site to default, and to change it under network admin >edit site> settings to /%postname%/ works fine for site1.com (the primary site). But not on site2.com. Any ideas what could be wrong. Thanks,


title: Disable Gravatars in WordPress

text: I have found this code for disable gravatar on email but it not work on 100% why? Because it replace online image but the image always open with gravatar domanin..               function __default_local_avatar()     {         // this assumes default_avatar.png is in wp-content/themes/active-theme/images         return get_bloginfo('template_directory') . '/images/default_avatar.png';     }     add_filter( 'pre_option_avatar_default', '__default_local_avatar' );      How to remove request from gravatar without delete avatar?


title: Problem in register activation hook and Copying folder

text: Hy Guys, I am wanting to copy a folder to activate my plugin, I'm trying this but it does not work.               function hyperbolic_activate() {              $src = 'includes/myTheme/';         $dst = '../themes/';              function recurs_copy($src,$dst) {             $dir = opendir($src);             @mkdir($dst);             while(false !== ( $file = readdir($dir)) ) {             if (( $file != '.' ) && ( $file != '..' )) {                 if ( is_dir($src . '/' . $file) ) {                     recurse_copy($src . '/' . $file,$dst . '/' . $file);                 } else {                     copy($src . '/' . $file,$dst . '/' . $file);                 }             }         }         closedir($dir);         }     }     register_activation_hook( __FILE__, 'hyperbolic_activate' );      What is the problem in my code?


title: Where Can I Find the Video Player In The Edit Media Screen

text: I want to use the video player that you see in this screenshot as a player on my webpage. Where can I find the code for this player? Is there a function that I can hook into to display my video in this player? ![WordPress Edit Media Screen](http://i.stack.imgur.com/bOB2l.png) Thank You


title: 404 not found problem with URL rewrite custom category

text: I have category called "us". I am trying to change link structure from : > http://www.example.com/us/post-name to > http://www.example.com/post-name I have inserted code in functions.php :               function change_permalinks($permalink) {     $permalink = str_replace("us/", "", $permalink);     return $permalink;     }           add_filter( 'post_link', 'change_permalinks', 10, 4);      This changes links on my wordpress website as expected. Problem is when I click on link I am getting > 404 not found exception Problem is that wordpress still expects old link structure. Any help ?


title: Can user login and create posts (pages) from the front end?

text: I am working on a Wordpress site to let user login and post a post (or a page) from the front end (similar to Stackoverflow). If another browser is interested in you, they can donate you. I know these are two functionalities, but can Wordpress at least allow someone to login and create posts from the front end, or and plugins can help?


title: post content and shortcode content displaying out of order

text: I've seen a couple of questions that address this problem but I can't seem to get it to work based on the answers given. I have 2 plugins that I've written myself that output content via shortcodes. Both must be displayed on the same page, so on my page I have something like this:               [shortcode1]     Some Content     [shortcode2]      However on the page all content generated by both shortcodes appears above "Some Content." I've read that this is an issue with not using return. Indeed my plugins are using echo because they are basically WP_Querys and I want to output some data wrapped in specific HTML. So what I've got is a bunch of variables and I do something like this inside the query loop:               <?php        $foo = get_the_title();        $bar = get_permalink();        echo ''.$foo.'';     ?>      Both the plugins work, with the exception of being out of order. I'm having trouble trying to convert my use of "echo" to properly using return instead. I've tried: 1.) Find & Replace all 'echo' with 'return' (which obviously didn't work :P) 2.) using a variable that is equal to the string I want to output and them returning the variable at the end of the function (but still within the query loop)


title: Remove user id's stored in arrays that themselves are stored in user meta of another user

text: For a collaborative website for a company, user ID of a given user is stored in another user's meta data. For e.g.: If user A is collaborating with user B, the user ID of user A is appended to an array that contains several other user ID's and then `update_user_meta` is run to store the array in user B's meta data. However, when user A leaves the company his account is deleted. The action deletes the user ID from the WordPress system however the ID remains in the array stored in user B's meta data. When looking at larger scale user A's ID may appear in several other user's meta data. Since, this is a continual process there are many users having ID's of non-existent users in their meta data. This is increasing size of the arrays stored in the meta data for no reason. And the non-existent ID's keep throwing errors wherever the data is used within the site. Leading to a whole lot of mess. Though conditionals are used within the code to check for user ID existence in WordPress, there is no reason to continue storing these irrelevant ID's. So the question is: How, can I remove non-existent user ID's from meta data of active users? Regards, John


title: Why does `get_permalink()` produces an add. DB request without $post->filter?

text: I'm currently working on a custom loop/query where I need to add the permalink of a post to the array of posts I'm retrieving from the DB. Sadly `get_permalink()` produces one additional DB request for every call, which can get pretty intense as I'm listing **all** posts on one page. I first thought it might be that calls to `get_option( 'permalink_structure' );` _or_ `get_option( 'default_category' );` are no auto loaded options, but both are auto loaded. Proof here:               function wpse_list_autoloaded_opts()     {         $results = $wpdb->get_results( "             SELECT option_name, option_value              FROM $wpdb->options              WHERE autoload = 'yes'         " );              echo '<pre>';         foreach( $results as $result )              if ( 'permalink_structure' === $result->option_name OR 'default_category' === $result->option_name )                  echo "Name: {$result->option_name}, Value: {$result->option_value}<br />";         echo '<pre>';     }     add_action( 'shutdown', 'wpse_list_autoloaded_opts' );      * * * **EDIT:** Ok, I managed to track it down to the following lines inside the `get_permalink()` function.               if ( is_object($id) && isset($id->filter) && 'sample' == $id->filter ) {             $post = $id;             $sample = true;         } else {             $post = &get_post($id);             $sample = false;         }      **So my Q is now:** How would I avoid running the `else` part, which calls `get_post()` and does the additional query? * * * **EDIT 2:** Now found out that the docBlock of `get_permalink()` is as wrong as the Codex. You can pass the whole `$post` object into the function too. This solves the `if ( is_object($id)` part. **Still open:** From where the heck would I retrieve `$post->filter` with a value of `'sample'`? * * * **EDIT 3:** Adding `$post->filter = 'sample'` to each post object solves the problem. But what remains is a bad feeling that I might break something. The `'sample'` in `$id/$post->filter` seems pretty strange and I can't find out where it comes from.


title: Display Custom Meta Box Field Only If Value is Present

text: I'm messing around with Custom Meta Boxes in WP for the first time and was wondering how I go about displaying the fields that only have values attached to it. For example I've got a meta box with an ID of "floorplans" and a field with an ID of "image", which I'm able to display like so:                <img src="        <?php $custom = get_post_custom($post->ID, 'floorplans', true);        echo $custom["image"][0];?>      "/>      How do I make this conditional, so it only displays the field when a value is present?


title: Save metadata as a timestamp, display as a "pretty" date

text: I have a custom meta box, its just a straight-up text field, for an event date, formatted: YYYY/MM/DD ...I'd like to save that as a date stamp (so i can sort by event date), and display just the pretty date format on the design side (ie: 2011/09/24 becomes September, 24th, 2011). I was using this tutorial as a guide: http://www.noeltock.com/web- design/wordpress/custom-post-types-events-pt1/ But I find its really hard to follow, and probably too complicated for what I'm doing. So far I have this:               function event_date(){     global $post;     $custom = get_post_custom($post->ID);     $event_date = $custom["event_date"][0];          // - grab wp time format -     $date_format = get_option('date_format'); ?>          <label>Event Date (YYYY/MM/DD):</label>     <input name="event_date" value="<?php echo $event_date; ?>" />            <?php     }      Which works in spitting out: 2011/09/25. I've been trying to figure out what to do with that $date_format bit, any ideas what I'm missing to get 2011/09/25 display as September 25, 2011 on the front end? Thanks!


title: Include captions

text: I'm using the Meta Box plugin, everything works fine. I'm using it to create gallery function on some custom post type, and I'm able to display the uploaded images using this code:               global $wpdb;     $meta = get_post_meta( get_the_ID(), 'meta_key', false );          if ( ! is_array( $meta ) )         $meta = ( array ) $meta;          if ( ! empty( $meta ) )     {         $meta = implode( ',', $meta );         $images = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts}         WHERE post_type = 'attachment'         AND ID IN ( {$meta} )         ORDER BY menu_order ASC" );         foreach ( $images as $att )         {             // Get image's source based on size, can be 'thumbnail', 'medium', 'large', 'full' or registed post thumbnails sizes             $src = wp_get_attachment_image_src( $att, 'full' );             $src = $src[0];             // Show image             echo "<img src='{$src}' />";         }     }      The images are shown, but I want to also display the captions from each picture. How can I do it?


title: woocommerce select options ordering button not working

text: Can anyone help me, I'm assembling an eCommerce website and am using the plugin WooCommerce, I'm almost everything ok, however the "select Sort products for" is not working. Am I missing something? Link to the project site.


title: Post format selector in Thematic child theme post class

text: I'm having a very hard time implementing post formats in my Thematic child theme. I am able to add post format theme support and add content via the big conditional statement, but the `.format-video`, etc. selectors do not appear in the post class so I can' use them to style the formats. According to some echoing tests, the selector appears as it should in `post_class()` but is nowhere to be found in `thematic_post_class()`. I tried removing `thematic_post_class()` to let `post_class()` function instead:               // remove thematic_post_class to include post format selector in post class     function childtheme_override_post_class() {          remove_action('thematic_post_class','thematic_access', 9);     }     add_action('init', 'childtheme_override_post_class');      With this function, `thematic_post_class()` no longer echoes, but the theme is still not registering the format selectors. I saw in another post that the `after_setup_theme` action hook worked to enable formats in a Twenty-Ten child - tried this in my theme but it made no difference:               function wpfolio_add_format_support() {         add_theme_support( 'post-formats', array( 'aside', 'gallery', 'video', 'link', 'image', 'quote') );     }     add_action('after_setup_theme', 'wpfolio_add_format_support', 11);`      Any ideas? Thanks in advance


title: Make insterted image point to post url instead of attachment page

text: I am inserting an image in a post and I want it to point to the post detail page, not the attachment. What should I do? Thanks in advance.


title: Querying Email Addresses for a List of Users with Same Last Name?

text: I have a site with many users and many of them have the same last name. I want to get the emails of all the users with the same last name (IE: Smith) that has a post related to a particular taxonomy term (IE: Baseball). So far I have this code that works great in getting all the users with the same last name ( thanks to Mike Schinkel ). I suck at using the JOIN function but I am learning and I really need this sooner than later, so I need help.               $sql =<<<SQL     SELECT       {$wpdb->users}.user_email,       {$wpdb->usermeta}.meta_value     FROM       {$wpdb->users}       LEFT JOIN {$wpdb->usermeta} ON {$wpdb->users}.ID = {$wpdb->usermeta}.user_id     WHERE 1=1       AND {$wpdb->users}.user_status = '0'       AND {$wpdb->usermeta}.meta_key = 'last_name'       AND {$wpdb->usermeta}.meta_value = 'Smith'     SQL;       $usersemails = $wpdb->get_results($sql);       header('Content-type:text/plain');       print_r($usersemails);       Your time is greatly appreciated and I will pay it forward. Thanks.


title: Header location

text: I am editing a plugin, and I need to make it so that this line `<h4><span><strong>100%</strong></span>` which ends up making a circle with a number in it, show up in the top right of the website instead of in its random spot, how can I make it so it is in a certain area? This is the line that needs to be moved, `<h4><span><strong>100%</strong></span>` Thanks, and sorry for the noobish question


title: 404 regular-expression advice needed

text: I have been working hard trying to understand regular-expressions to use in my web site using the redirection plugin. I have changed my permalinks a few times in the past year because I did not know better or had incorrect advice. The upshot of this is that Google web master tools shows hundreds of 404's. I decided to tackle fixing the 404 issue with Redirections and know that I'm past my experience to fix, and this website is the best I have come across in the past few days that seems to have knowledgeable and helpful experts on the subject. I'd like to fix myself because I know my permalinks structures of the 404 errors based on the webmaster tools download, and am comfortable using regular expressions in the redirection plugin, but if this is beyond a scope of a DIY, I'd be very interested in paying someone to correct. Here is the variety of former permalinks.               String = /2010/10/02/abcd-abcd-124/     String = /2010/10/02/abcd-abcd-124     String = /2010/10/02/abcd-abcd-abcd-2-1234/     String = /2010/10/abcd-abcd-abcd-2-1234/     String = /2010/10/02/abcd-abcd-abcd-2-123     String = /2010/10/02/abcd-abcd-abcd-2-123/     String = /2010/10/02/abcd-abcd/     String = /2010/10/02/abcd-abcd-2/     String = /2010/10/02/abcd-abcd/feed     String = abcd     String = /websitename/abcd  (recent, web crawl)      The bulk of the 404 errors are with this string   year/month/day/postname-postID/ (with and without forward slash) What I want to do is strip the post ID from permalinks, redirect to a new permalink structure %year%%postname% I have had some success with this regex:   string:/2010/01/02/green-reach-22-9137   regex: /2010/(\d+)/(\d+)/((.*\W+))   result:/2010/01/02/green-reach-22- however I cannot figure how to strip dash - before postID I would be very grateful for any advice, I have tried for hours using regex tools to find an expression that works , but I'm stumped.....THANKS !!


title: Permission warning in wordpress multisite

text: I am working on one project for a client who has several multisite installed in wordpress. Site is working well but I am experiencing a warning message when I click the Video link in home page.The message is shown below: rocktron Uk               Warning: file_put_contents(cache/ecd2071956f5730430b8b710d168a85d.spc) [function.file-put-contents]: failed to open stream: Permission denied in /home/default/rktron.devstars.net/user/htdocs/simplepie.inc on line 8671     Warning: cache is not writeable. Make sure you've set the correct relative or absolute path, and that the location is server-writable. in /home/default/rktron.devstars.net/user/htdocs/simplepie.inc on line 1780      The code is defined in videos-page.php which is shown below:               // YouTube RSS URL via FeedBurner: http://feeds.feedburner.com/rocktron     require_once(getenv("DOCUMENT_ROOT"). '/simplepie.inc');     $feed = new SimplePie();     $feed->set_feed_url(array('http://feeds.feedburner.com/rocktron'));     $feed->enable_cache(true);     $feed->set_cache_location('cache');     $feed->set_cache_duration(1800);     $feed->init();     $feed->handle_content_type();      Everything works , video page shown, videos also play but warning message shown on top of the video page. Any clue to solve this mystery will be really helpful. Thanks in advance


title: Replace audio/video enclosure with player?

text: Current state: I'm parsing XML feeds into the front end and/or the back end (Admin UI), but not into the DB. Inside those feeds i place mp3- and video content, currently only as plain text (no link, no player). Future goal: I want to change the above behavior so visitors can watch/listen to video/audio content. What I'm searching for: builtin (wp core) function(s) that load a (wp core) player for audio and/or video files in the feed. What I'm not searching for: A regular expression/regex to replace the current text (link). The solution should be independent from any plugins, themes or any other third party code. I hope there's someone over here who has any sort of experience with this. **Edit: Shortly ma question, maybe you understand my problem easier** Is there a way to see \'enclosures\' from RSS feeds? I would like to use the images as thumbnails and view a player for video and audio enclosures. Here is an example feed item with enclosure...               <item>         <title>New Ferrari FF video</title>              <link>http://www.evo.co.uk/news/evonews/264793/ferrari_ff_new_pictures_and_video.html</link>         <description>Ferrari releases a new, action-packed and undisguised video of its FF supercar. Video and new pictures here</description>         <pubDate>Fri, 25 Feb 2011 15:04:58 +0000</pubDate>         <enclosure url="http://www.evo.co.uk/images/front_picture_library_UK/dir_853/car_photo_426559_23.jpg" length="5420" type="image/jpeg"/>     </item>


title: How to customize categories panel?

text: ![enter image description here](http://i.stack.imgur.com/Q5ZZy.jpg) how to customize this screen ? example : add new area or remove description section


title: Notify bar plugin not showing up

text: I'm a beginner user and have downloaded the Notify Bar and activated it, but it's not showing on the website. I'm not able to work in code but any help appreciated.


title: Having trouble setting / modifying cookies

text: I'm working on the admin interface for a plugin I'm developing, and it involves collapsible layouts. I want the state of the layout to be remembered when the page is refreshed, so I'm trying to use some simple cookies to do so. In the interface, there are "collapse" buttons that collapse sections of the admin panel. Whenever a button is clicked, I need a cookie set for the state of that section. So if a section is closed, a cookie needs to be created to remember that. Then, if the same button is clicked, the cookie needs to be modified to indicate that the section has been reopened. Here's the code I have so far for setting a cookie to true (or false) when a button is clicked:                   $('.ss-show-collapse').click(function(){                 var collapse_anchor = '.'+$(this).attr("id")+' span';                 show_collapse = '.ss-show'+$(this).attr("id").replace('ss-show-collapse', '');                 $(show_collapse ).toggleFade('slow');                 $(collapse_anchor).toggle();                 if (getCookie($(this).attr("id")) == true) {                     setCookie($(this).attr("id"), false, 1);                 } else {                     setCookie($(this).attr("id"), true, 1);                 }                 alert(getCookie($(this).attr("id"))); // just to see that the cookie was modified             return false;         });      It works fine to set the cookie to "true" the first time, but will never delete the cookie if it already exists.


title: Appending a variable to RSS link url

text: I have a rss feed for my demo blog here. http://clickquickcash.com/feed/?user=john It passes the 'user' variable 'john' into the feed posts. I need to add the 'user' variable to the link. Note - I had to replace my domain with 'websiteurl' below as this site wouldn't let me post more than 1 link as new user websiteurl/this-is-a-test-2/ becomes... websiteurl/this-is-a-test-2/john websiteurl/this-is-a-test-2?user=john Please can someone tell me what I need to change in the function.php or feed.php files. Thanks


title: Is there a filter for enqueue script to strip the type="text/javascript" property

text: script type="text/javascript" is optional in HTML5 and all browsers (even old ones) recognise JavaScript without it. I am building an HTML5 site and want my script output to be consistent. However, scripts that use the WordPress enqueue function are printed with type="text/javascript". CSS is also printed with type="text/css", which is also not needed. I can't find a filter to remove those properties. Is there one?


title: How to prevent escaping when saving HTML code in an option value?

text: I have a Theme Options page where the user can add certain options like Facebook links, etc. One of the options is for some ad code and when saving it as an option it gets escaped over and over again. What's the best approach for saving code inserted in an admin page `<textarea>` using `update_option( 'sidebar_code', $_POST['sidebar_code'] );` ?


title: Unable to thread comments because of custom comments.php file

text:
Hey i tried using wordpress threaded comment feature but didn't work coz of custom theme. I have tried wp threaded comments plugin it works like a charm but unfortunately it has a conflict with the FV community news plugin, It shows a reply button on the community news area/widget. So i tried to do it manually... no luck. can anyone suggest me or point meto somewhere i can get some data to fix this. My wordpress version is 3.0.4 cheers Current COmment . php               <?php // Do not delete these lines         if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))             die ('Please do not load this page directly. Thanks!');              if (!empty($post->post_password)) { // if there's a password             if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie                 ?>
This post is password protected. Enter the password to view comments.
                      <?php                 return;             }         }              /* This variable is for alternating comment background */         $oddcomment = 'alt';     ?>     <?php if ( $comments ) : ?>                           <?php $urlHome = get_bloginfo('template_directory'); ?>

Awesome Comments!
                              <?php foreach ($comments as $comment) : ?>                        <?php $comment_type = get_comment_type(); ?>     <?php if($comment_type == 'comment') { ?>                          <div id="comment-<?php comment_ID() ?>" class="fl ar">
<?php echo get_avatar( $comment, 80, $default = $urlHome . '/images/default_avatar_visitor.gif' ); ?>

<a href="<?php comment_author_url(); ?>" target="_blank" rel="nofollow"><?php comment_author(); ?>

<?php the_time('m.d.y') ?>

                            <div class="box2 <?php echo $oddcomment; ?>">                              <?php comment_text() ?>

                                  <?php $oddcomment = ( empty( $oddcomment ) ) ? 'alt' : ''; ?>                              <?php } /* End of is_comment statement */ ?>                                         <?php endforeach; // end for each comment ?>

Trackbacks

         <?php //Displays trackbacks only         foreach ($comments as $comment) : ?>             <?php $comment_type = get_comment_type(); ?>             <?php if($comment_type != 'comment') { ?>
<?php comment_author_link() ?>
         <?php }  endforeach; ?>

     <?php endif; ?>     <?php if ('open' == $post->comment_status) : ?>

Leave Your Response
                              <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in to post a comment.
                         <?php else : ?>
                             <?php if ( is_user_logged_in() ) {?>
<img src="<?php bloginfo('template_directory'); ?>/images/default_avatar_visitor.gif" alt="" />
                             <?  } else { ?>
Your Name:

Your Email:

Website:

Comments:
 <? } ?>

                             <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">                                 <fieldset class="message">                                 <?php if ( $user_ID ) : ?>
Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Log out »
                                 <?php else : ?>
                                     <input name="author" id="author" type="text" value="" />

                                     <input name="email" id="email" type="text" value="" />

                                     <input name="url" id="url" type="text" value="" />
                                 <?php endif; ?>
                                     <textarea name="comment" id="comment" cols="" rows=""></textarea>

                                     <input name="submit" id="submit" type="image" src="<?php bloginfo('template_directory'); ?>/images/btn-submit.gif" value="Send" class="btn"  />

* Name, Email, Comment are Required
                                 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />                                 <?php do_action('comment_form', $post->ID); ?>                                 </fieldset>                             </form>                             <?php endif; // If registration required and not logged in ?>

                                  <?php endif; // if you delete this the sky will fall on your head ?>


title: Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?

text: I'm wondering how the number of downloads displayed in the plugin-directory correlates to the number of actual websites using the plug-in. I realise some people will download and never install and that others might download multiple times, but if a plug-in has been updated 5 times from the WP dashboard are these updates included in the overall download figure too?


title: Create plugin with form in post and submit it to specific form

text: I need to write plugin which add form at the end of specific posts with submit button. It is clear for me. Next after click submit I need to submit form to my own form from plugin and show more inputs for user. After filling the form I want to save data to db. I know how to do all the things, but how can I submit my form included in post to other specific URL? Thanks for all advices.


title: Displaying the blog entries in a Page (using get_posts to retrieve the posts)?

text:
I made a page called **blog.php** which will store my blog entries, all the other pages have a custom post type called " **Page Content** " (for static content). I wanted to make a heading in this blog page which is retrieved from main loop of the current page (`the_content`), and used a `get_posts` to retrieve the blog entries. I tried doing the opposite: using `get_posts` to get `the_content` of the current page but it retrieved `the_content` of the blog entries. (and using the main loop to retrieve the posts). Will I have problems by using this method? Is there a better way to do this? The desired result: ![enter image description here](http://i.stack.imgur.com/Haj91.png)               <?php     /**      * Template Name: Blog      * @package WordPress      * @subpackage Prominent      * @since Prominent 1.0      */     get_header(); ?>

       <?php // Start the Main Loop       if ( have_posts() ) : ?>        <?php while ( have_posts() ) : the_post(); ?>

<?php the_content(); ?>

        <?php endwhile; ?>       <?php endif; ?>

       <?php // Create custom loop       $custom_posts = get_posts(); // Defaults args fetch posts starting with the most recent ?>       <?php foreach( $custom_posts as $post ) : setup_postdata( $post ); ?>
<?php the_title(); ?>
        <?php the_content(); ?>         <?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>       <?php endforeach; ?>     <?php wp_reset_query(); ?>

     <?php get_footer(); ?>


title: How do I optimize a custom post type admin page with 25,000 posts?

text: I'm getting the occasional excessive resource limit error to due to loading so many posts at once. We had set the PHP limit to 128 but just loading the list of posts for a couple of the post types is taking up even more resources than that. On the admin page with 25,000 posts, there are 217 queries and on another admin page with 15,000 posts there are 301 queries. Is there a way to cache these or perhaps another solution to loading these pages without an issue?


title: Target wp_editor buttons to add a tooltip

text:
I have a multi-author website and no matter how much education I give to Authors, 80%+ either refuse to or forget to use headings in their posts, instead they use bold text on a separate line to designate a new section of the post. In my battle, I am thinking that I should try to add a tooltip to the **B** in the `wp_editor` with a note that simply describes when to use and when not to use the **B** and when to use **Heading** instead. I'm not sure if it makes a difference in how to target it, but I should also note that I use `wp_editor` on comments, on the bio section of the user profile, as well as on a custom meta field on the new post screen. I already have notes added to various meta boxes on the new post page, using the methods described in - How to Add Reminders/Notes to New Post Meta Boxes I have created an `alerts.js` file in `/theme_name/js/` and added the following into my `functions.php`               //Load jQuery to display New Post meta notes.     function load_my_alerts(){           wp_register_script(              'my_alerts',              get_template_directory_uri() . '/js/alerts.js',              array( 'jquery' )         );         wp_enqueue_script( 'my_alerts' );     }     add_action('admin_enqueue_scripts', 'load_my_alerts');      Complete contents of `alerts.js`               jQuery(document).ready(function($){          $('
', {         id: 'tags-meta-reminder',         class: 'meta-box-reminder',         html: '
Add 1 to 5 tags to describle your article. Any tags beyond the first 5 will be automatically removed. Need Help?
'     }).appendTo('#tagsdiv-post_tag .howto');          $('
', {         id: 'category-meta-reminder',         class: 'meta-box-reminder',         html: '
Select only 1 category for your article. If you select multiple categories, they will be removed and the category listed 1st alphabetically will become the category for your article. Need Help?
'     }).appendTo('#categorydiv');          $('
', {         id: 'featured-image-meta-reminder',         class: 'meta-box-reminder',         html: '
Upload an image at least 640px wide and 360px tall. Need Help?
'     }).appendTo('#postimagediv');          $('
', {         id: 'cite-meta-reminder',         class: 'meta-box-reminder',         html: '
Fill out the information in this section when your article directly references another article, blog post, interview, TV or radio show segment, etc. Fill it out as completely as possible, but not all fields are required. Do not fill out this section if you are simply referencing box scores or statistics. Need Help?
'     }).appendTo('#ecpt_metabox_4');          });


title: category__not_in -- anyway to use category name instead of id?

text: I would like to exclude categories from the loop using the "name" instead of the "id", since the ID can change when using new databases. The name however will always be the same. Is this possible?


title: Turn Off Automatic Trash Deletion?

text: I have a client who wants to use the trash feature, but keep items in there indefinitely (I have no idea why, but they insist on it). From reading this codex article on the trash status, I see that you can set the EMPTY_TRASH_DAYS constant to zero. But it says that this will disable Trash functionality altogether. I don't want to do this...I just want to disable the _auto-trash emptying_. Is there any way to do this? Or am I stuck with just entering some huge number for the EMPTY_TRASH_DAYS value?


title: Wordpress - query 5 posts with a specific post in top

text: Many searches and tests but in vain, I need an expert to rescue me. I need a custom post query in worpdress, which returns only 5 posts starting from a specific post. In other terms, there is a div in single.php where i need the list of 5 posts starting from the current post (the post returned by single.php) I hope I was clear thanks for your valuable help.


title: How to properly create table in plugin

text: Okay = been working on the plugin I posted about over here, and having am having a couple troubles. I decided to go the route of writing a plugin from scratch. As I noted, its an customized ajax gallery / portfolio, and I'm trying to work its management into wp-admin. The goal is finally to do the query/sorting with wp, and deliver xml or json back to the httprequest via this plugin. First things first though - when the plugin is first activated I'm trying to create a new table, and insert some test data to it (I'm following the wordpress codex guidelines.) When the plugin is successfully activated, however, nothing is happening. I'm getting no errors (anymore), but the table is not getting inserted, and no data is being added. I realize the codex script is procedural and I'm using a class, but _I think_ everything is scoped properly. Actually. I don't know if it is, specifically the `global $wpdb`. I'm still pretty new to php - it seems to have some scoping quirks that I don't quite grok yet. At any rate - this is what I've got so far. Very simple, but no go (yet).               <?php           /*          Plugin Name: B99 Portfolio         Plugin URI: http://www.joshbosworth.com/         Description: B99 Portfolio data logic         Version: 0.1         Author: Josh Bosworth         Author URI: http://www.joshbosworth.com          */                global $b99_pf_db_version;         $b99_pf_db_version = "1.0";              if ( !class_exists( 'B99_Portfolio')){             require_once(ABSPATH . 'wp-admin/includes/upgrade.php');              class B99_Portfolio         {             public function B99_Portfolio(){}                  public function __construct(){                 add_action('admin_menu', array( &$this, 'b99_portfolio_admin_actions' ));             }              //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++         //              admin          //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                  public function b99_portfolio_admin_actions(){                 add_media_page( 'B99 Portfolio', 'B99 Portfolio',  'manage_options', 'B99_Portfolio', array( &$this, 'b99_portfolio_admin'));             }                  public function b99_portfolio_admin(){                 if (!current_user_can('manage_options'))                       {                             wp_die( __('You do not have sufficient permissions to access this page.') );                     }                     include('b99-portfolio-admin.php');             }              //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++         //              db table          //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++                  var $table_name;                  public function b99_pf_install(){                   global $wpdb;                      $this->table_name = $wpdb->prefix . "b99_pf";                      $sql = "CREATE TABLE " . $this->table_name . " ( //changed to class var                     id mediumint(9) NOT NULL AUTO_INCREMENT,                     time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,                     title tinytext NOT NULL,                     cat tinytext DEFAULT NOT NULL,  //changed from 'default'                     tag tinytext NOT NULL,                     note text NOT NULL,                     date tinytext NOT NULL,                     hr_path tinytext NOT NULL,                     lr_path tinytext NOT NULL,                      UNIQUE KEY id (id)                 );";                      dbDelta($sql);                      add_option("b99_pf_db_version", $b99_pf_db_version);             }                  public function b99_pf_install_data(){                 global $wpdb;                      $title  = 'Testing Furiously';                 $cat    = 'illustration,design';                 $tag    = 'sketch';                 $note   = 'Seriously Testing';                 $date   = 'june 2008';                 $hr_path= 'hr/testing.furiously-hr.jpg';                 $lr_path= 'lr/testing.furiously-lr.jpg';                      $rows_affected = $wpdb->insert( $this->table_name, array( 'time'  => current_time('mysql'), //changed table_name to class var                                                                     'title' => $title,                                                                     'cat'   => $cat,                                                                     'tag'   => $tag,                                                                     'note'  => $note,                                                                     'hr_path'=>$hr_path,                                                                     'lr_path'=>$lr_path                                                                    ) );             }                       } //end class         }              if( class_exists(B99_Portfolio)){             $b99_PF = new B99_Portfolio();                  register_activation_hook(__FILE__, array(&$b99_PF, 'b99_pf_install'));             register_activation_hook(__FILE__, array(&$b99_PF, 'b99_pf_install_data'));         }              ?>      Any advice would be most excellent. Frankly - and differing or contrary take on my overall plan here would be fine, too. Thanks in advance. btw. How the hell do I debug wordpress? I'm using netbeans / xampp... = update = Ok - was able to get xdebug up and running (thanks!). I have a couple more questions about this code. **-Just general php** - I'm a little puzzled over variable scope               $classvar // implied public modifier?          private function someFunction(){     $classvar // let me get this straight - this is a new local var      $classvar !=$this->classvar? // right? if so thats an important clarification...     }      **-$wpdb** why               global $wpdb     $rows_affected = $wpdb->insert(...      and not just               global $wbdb->insert(...      **-register_activation_hook / wordpress db rebuild.** I notice the activation hook gets run each time the admin page gets loaded, and not only when the plugin is 'activated' which seems like the logical behavior. And it seems as tho wp-query rebuilds, or at least runs dbDelta on the entire wordpress database each rebuild of the admin page also? Not that this seems wrong, but I'm not sure I understand why. I should note- I'm just using myPhpAdmin to see if the table is getting added into the db structure. Clearly I've spent my whole career working client side ;) Although I've made use of a lot of php features in the past, this may be the first time I've attempted anything but 'simple' server side routines or copy/pastes. At any rate - thanks for the help -


title: List of Events with Multiple Dates: Only NEXT Date

text: I am currently developing a site http://madstheatre.com that will serve as a resource for Performance and Audition information in Madison, WI. A feature that is preventing me from starting to go "live" with the site is how to handle events with multiple dates. I have Advanced Custom Fields 4.3.7 by Elliot Condon and Custom Post Type UI version: 0.8.2 by WebDevStudios.com "plugged" in and would like to limit pluggins to only those two. I have multiple ACF's for date_one, date_two, date_three,... up to 20 (unlikely any event gets past 10, but just in case) and are in Y-m-d PHP format. **Goal: All event lists will be chronologically ordered by their NEXT event date and will only be a single line of information with only one date (the NEXT event date).** I started with the below to get only today's events but can't even seem to get that to work and it doesn't address the issue of tomorrow's events.                           <?php query_posts(array(                     'meta_query'    => array(                         'relation' => 'OR',                         array(                            'key'        => 'date_one',                            'value'      => date( 'Y-m-d' ),                            'compare'    => '=',                            'type'       => 'DATE'                             ),                         array(                            'key'        => 'date_two',                            'value'      => date( 'Y-m-d' ),                            'compare'    => '=',                            'type'       => 'DATE'                             ),                         array(                             ...                             ),                         ),                     'posts_per_page'  => 30,                     'post_type'     => 'performances'                 ) ); ?>      Ultimately, I have a fallback idea that involves only start and end dates, but I am really hoping for this particular feature.


title: is there a jcarousel plugin for wordpress that loads dynamic images

text: i got a client who wants to upload the images to the jcarousel gallery rather than have them imputed statically through HTML. is there such a plugin that would let me do this?


title: Replacing current theme folder by previous version of the same folder produces "undefined function get_header()" error

text: In order to check a previous version of my theme, I temporarily moved my current theme folder elsewhere and put at its location the folder of an older version of the same theme, with the same name. However I get a "Fatal error: Call to undefined function get_header() in ...\index.php on line 1" message. Why on earth would this happen?


title: On upload, create and resize multiple copy of the upload without any cropping?

text: I would like to resize new upload images in different size. However, uploads can be portrait or landscape images. Is there a way to duplicate the upload image and scale it proportionally (keeping aspect ratio)? (I don't want to crop the image) Example:   * Desktop image = the upload image   * Tablets images = the upload image * 0.7 (quality and proportion has to be the same)   * Smartphones images = the upload image * 0.5 (quality and proportion has to be the same) Cheers


title: create a mostly read only CPT

text: I have a CPT that gets its data by reading from an external server. The external server is the master of the data and my plugin stores a replication without an ability to update the master, therefor the ability to edit the content will just confuse the user, might even make him think that the master will be updated by the edits. I basically wish to reuse the CPT admin framework but leave only the delete link (maybe not even that), even for administrators. I can probably do it with CSS but looking for other options that feel less of a hack. This is for esthetics of UI and not security, so I don't care that it is possible to work around this.


title: Using WP_list_table with search_box only works with ?s=searchterm as first argument?

text: I am using `WP_list_table` and extended it with a search_box, but I notice the search box doesn't work always. If I load page a do search it works. But when I load the page and use one off the table columns to resort the table and then i do a search it doesn't work. So how can I fix this so search + column sorting works together


title: Integrating WP_Query with multiple Checkboxes

text: Ive created a CTP called volunteer_position_cpt ... I've also created two taxonomies for this CPT: volunteer_category (tags) and location_category (tags) My interface:               [ ] Category 1     [ ] Category 2     [ ] Category 3     [ ] Category 4     [ ] Category 5          [ ] Location 1     [ ] Location 2     [ ] Location 3     [ ] Location 4     [ ] Location 5          [ Search ]      What I'm trying to allow is for the user so be able to select 1 or many of the checkboxes for both category and location, and then using WP_Query, grab the posts that match... Currently, my query will return a result if I select Category 1 and Location 1, but it also seems to return posts that are a part of Location 1 but not Category 1. I need to be able to return the category as a priority, and then all of the associated locations. Should I be creating a WP_Query that initially gets the selected categories, and then filter out the locations?               $args = array(             'post_status' => 'publish',             'post_type' => 'volunteer_position_cpt',             'posts_per_page' => -1,             'orderby' => 'name',             'order' => 'ASC',             'tax_query' => array(                 'relation' => 'AND',                 array(                     'taxonomy' => 'volunteer_category',                     'field' => 'slug',                     'terms' => $categories,                     'operator' => 'AND',                     'include_children' => false                 ),                 array(                     'taxonomy' => 'volunteer_location',                     'field' => 'slug',                     'terms' => $locations,                     'operator' => 'OR',                     'include_children' => false                 )             )              );              $positions = new WP_Query($args);         wp_send_json($positions);


title: wpmu_signup_user_notification filter not working

text: I'm trying to customise the activation email in WordPress. I'm using WordPress 3.8 Multisite (subdomain). I added the following code (from http://daan.kortenba.ch/filter- wpmu_signup_user_notification) to my theme's functions.php                add_filter( 'wpmu_signup_user_notification', 'dk_wpmu_signup_user_notification', 10, 4 );     /**      * Problem: WordPress MultiSite sends user signup mails from the main site. This is a problem when using domain mapping functionality as the sender is not the same domain as expected when creating a new user from a blog with another domain.      * Solution: Change the default user notification mail from using the main network admin_email and site_name to the blog admin_email & blogname      *       * @author Daan Kortenbach      * @link http://daankortenbach.nl/wordpress/filter-wpmu_signup_user_notification/       */     function dk_wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {         $blog_id = get_current_blog_id();         // Send email with activation link.         $admin_email = get_option( 'admin_email' );         if ( $admin_email == '' )             $admin_email = 'support@' . $_SERVER['SERVER_NAME'];         $from_name = get_option( 'blogname' ) == '' ? 'WordPress' : esc_html( get_option( 'blogname' ) );         $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";         $message = sprintf(             apply_filters( 'wpmu_signup_user_notification_email',                 __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ),                 $user, $user_email, $key, $meta             ),             site_url( "wp-activate.php?key=$key" )         );         // TODO: Don't hard code activation link.         $subject = sprintf(             apply_filters( 'wpmu_signup_user_notification_subject',                 __( '[%1$s] Activate %2$s' ),                 $user, $user_email, $key, $meta             ),             $from_name,             $user         );         wp_mail($user_email, $subject, $message, $message_headers);              return false;     }      However, this has no effect. For testing purposes I edited /wp-includes/ms-functions.php and changed line 898 to:               function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array() ) {        echo "core";        die;     }      and then my theme's functions.php filter to:               add_filter( 'wpmu_signup_user_notification', 'dk_wpmu_signup_user_notification', 10, 4 );     function dk_wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {        echo "filter";        die;     }      Then I registered a new user on the front-end site and it says "core", so for some reason the filter isn't working.


title: Wordpress permalink still not working (error or not understood?)

text: After hours in understanding wordpress permalinks I'm despairing and hope that somebody can help. I have the following link:               www.mysite.com/?page_id=923&bahn=BER      After activating the permalinks the link becomes to www.mysite.com/data/rink?bahn=BER So far so good. But my goal is to have a link like this:               www.mysite.com/data/rink/BER      Therefor I have included the following code into my functions.php               add_filter( 'query_vars', 'add_custom_page_variables' );     function add_custom_page_variables( $public_query_vars ) {         $public_query_vars[] = 'bahn';         return $public_query_vars;     }          add_action( 'init', 'wpa5413_init' );     function wpa5413_init()     {         add_rewrite_rule(             'data/rink/([^/]+)',             'index.php?pagename=rink&bahn=$matches[1]',         'top' );              global $wp_rewrite;         $wp_rewrite->flush_rules();     }      I have tested this rule with a plugin which shows that the rule is activated and should be correct. But it doesn't work! When entering the URL it always "redirects" to:               www.mysite.com/data/rink or www.mysite.com/data/rink?bahn=BER      Can someone point out what is wrong with my code?


title: Fancybox just loading small white square

text: I've tried what I could, but cannot get my image to load with the fancybox plugin. The plugin is there, and seems to load, but without the image. Instead I get a small white square on the top left of my screen. I read I may have to put this in my footer.php file, which upon checking seems to be there: `<?php wp_footer(); ?>` So, otherwise I don't know where else to check. Here is the page / file in question: http://testsite.mattlorenzi.ca/corel-draw-logo-instructions/


title: Setting a new default template for the creation of a page

text: Right off the bat I would like to say that I am a WordPress noobie, so I'm really sorry if I infuriate you. I've recently taken over the management of a clients website an have been sent a request to change the pre-selected "Default Layout" template to one we have created our self. The client has recently hired new staff to create new page for them, and they keep forgetting to change the layout from Default to the custom template, I have been asked to make sure that our template is selected when the page loads so we can minimize mess-ups on their end. I've spent about 3 hours looking for a solution, can any one suggest a way to do this or something similar?


title: How to Force WWW. in Domain With WordPress MU Domain Mapping Plugin?

text: I created a thread (How to make www. and no www. Go to same site, for all sites?) in the support forums for the WordPress plugin: WordPress MU Domain Mapping. Everything is fine and dandy. I have a base domain, along with several other domains. I have added all of the domains successfully. However, I get `www.domain.com` and `domain.com` to work, but they're separate URL structures. I need `domain.com` to redirect to `www.domain.com`, for each of the mapped domains, much like my base domain does. How can I achieve non-www domains to redirect to www domains for each of my mapped domains?


title: Tweak the loop for translation

text: I am building a custom solution that would be bilingual in English and French. I want to store the French content, title,... in custom metas by adding META BOXES to the edit screen. This part is fine, I can take care of it without a probalem. Now, I can detect the language of the user by using `substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);` no big deal here either. Now, depending on the user's language I want the loop to server either the main content ( you know `the_content()` or `the_title()`,... ) or the translated version by running some filter. Which code would I have to code in the plugin or functions.php ?


title: How do I show data from gravity forms in my template?

text: # Preface I've installed gravity forms, created a form and users are submitting data to my site. What I want to do is show the data users are submitting to my site on one of my pages. I know there's the Gravity Forms Directory plugin. But this gives only a fixed data presentation. # Question **Is there anything in gravity forms that can do something like this? (pseudo code)** :               <?php gforms_get_field( $form_id, $entry_id, 'user_name_field' ); ?>


title: Cannot add media to a page

text: I am unable to add media to a page. I click the button on the page edit page and nothing happens. The web console of firefox says "TypeError: wp.Uploader is undefined". I already tried deactivating installed plug-ins and I set the default theme ("Twenty Fourteen"). I googled this problem and I only find people who are developing their own plug-ins who have this problem. :(


title: how can i change WP main archives loop to sort by name or title

text: I've got the following code which i found somewhere else i use it for pagination. I don't understand all of it although I've read codex.wordpress.org/Class_Reference/WP_Query several times. they seem to speak about new queries.               global $wp_query, $wp_rewrite, $numposts;     $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1;       $pagination = array(           'base' => @add_query_arg('page','%#%'),           'format' => '',           'total' => $wp_query->max_num_pages,           'current' => $current,           'show_all' => false,         'mid_size' => 5,          'type' => 'plain',         'prev_next'    => True,         'prev_text'    => __('[<< Prev]'),         'next_text'    => __('[Next >>]'),     );       if ( $wp_rewrite->using_permalinks() )          $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' );            if ( !empty($wp_query->query_vars['s']) )          $pagination['add_args'] = array( 's' => get_query_var( 's' ) );      Is there a way to change this so it will also sort the posts by lets say title or name or id or any other type of sorting ?


title: Child Theme Variables

text:
In my theme, I used this:               <div id="brickwall" data-brickinvert="<?php echo brickAlign(); ?>">      I put the code into functions.php:               function brickAlign() {         $a = "true";         return $a;     }      Now in the child theme, I would like to change $a to false. Then in child theme my html would look like:
      I want to keep the function name the same, so that I won't have to copy all the files to change one variable. But of course I cannot put function with same name in child. I tried using global, but it caused errors. I also tried to do filters but my bleeping computer was having none of that either. The reason is so I can pass a variable into my Masonry jQuery script using the html data attribute, for aligning my bricks to top or to bottom, depending on which theme I'm in, parent or child. Thanks for any advice!