title: Bizarre behavior of get_author_posts_url()

text: So I've been developing a site where I list a custom post type associated with a member in their profile page. It was all working fine until I imported about 150 users (at least that's when I noticed). Bear in mind I used the same email address for most of them, by using a filter               add_filter('pre_user_email', 'skip_email_exist');     function skip_email_exist($user_email){         define( 'WP_IMPORTING', 'SKIP_EMAIL_EXIST' );         return $user_email;     }      So to the point, I'm using               get_author_posts_url($coauthor->ID, $coauthor->user_nicename)       to retrieve the author URL, and it worked fine by outputting the URL with it's `nice_name` associated. Now it is outputting the URL with the id associated (`?author=$auth_ID`) Checking into the WordPress function thing get plain weird. The `$wp_rewrite->get_author_permastruct();` used in the function actually returns the URL with the nice_name associated. The problem resides in the empty check.               if ( empty($link) ) {      Commenting this if actually solves the whole deal, but I don't want to break WP updates. So my question is: What is going on and why this causing to return empty even though it's not and how can I fix it?


title: How do I create a sticky sidebar?

text:
How do I give the three posts here different div classes? I'm working with twitter bootstrap and I'm trying to give the first post and the last one               <?php query_posts('category_name=Menucard'); ?>         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
             <?php                 //echo post here                 the_content();             ?>
               <?php             $counter++;             if ($counter % 3 == 0) {             echo '

';             }         ?>


title: Remove menu items from admin page and limit capabilities

text: By default, I am allowing people to subscribe as contributors to my site which allows them certain actions. What I then want to do is remove Posts, Comments, Contact (ContactForm7) and Tools leaving them only options to add new Events (events plugin). I also want to be sure that even though these buttons are hidden, people cannot submit to these PostTypes if they knew how to. I am reading through the Professional WordPress plugins development book at the moment and it's a lot to take in so I'd like to do this just in my theme's functions page for now. Here's what I am trying according to the codex:                   add_action( 'admin_menu', 'jh_remove_menu_pages' );         function jh_remove_menu_pages() {             remove_menu_page('edit-comments.php');               remove_menu_page('tools.php');               remove_menu_page('edit.php');                remove_menu_page('wp-contact-form-7.php');           }      I've managed to do a find on this page to fins all the php files I need to hide but I am not sure about the ContactForm7 file. EDIT: Managed to find solution here to remove Contact Form 7 from Admin Menu According to the codex though, the code above does not remove the permissions for them to access the screens (posts, tools etc) directly and still submit if they knew how: _"Please be aware that this would not prevent a user from accessing these screens directly. Removing a menu does not replace the need to filter a user's permissions as appropriate."_ How would I remove the capabilities of all the above except the for Events and Profile? I'm reading through remove_cap in the codex, but I am concerned that I might inadvertently switch off posting Events if I remove the Posts capability? And lastly, how do I show only the related Events for the user who is logged in at the time? Many thanks.


title: Including Wordpress in RESTful API

text: I'm using a great little open-source product called Restler to provide a RESTful API to a Wordpress application. In order for this to work I want to be able to load the Wordpress environment within a set of PHP classes that Restler will run when a request comes in. The idea of loading the WP environment -- without the load of the UI elements -- is achieved by a script I have called AddWordpress.php:               <?php     error_reporting(E_ALL);     $site_name='yoursite';     $site_domain='www.yoursite.com';          /**     * Construct a fake $_SERVER global to get WordPress to load a specific site.     * This avoids alot of messing about with switch_to_blog() and all its pitfalls.     */     $_SERVER=array(     'HTTP_HOST'=>$site_domain,     'REQUEST_METHOD'=>'GET',     'REQUEST_URI'=>"/{$site_name}/",     'SERVER_NAME'=>$site_domain,     );          // Remove all our bespoke variables as they'll be in scope as globals and could affect WordPress     unset($site_name,$site_domain);          // Pretend that we're executing an AJAX process. This should help WordPress not load all of the things.     define('DOING_AJAX',true);          // Stop WordPress doing any of its normal output handling.     define('WP_USE_THEMES',false);          // turn on debugging     define('WP_DEBUG', true);     define('WP_DEBUG_LOG', true);          // Load WordPress - intentionally using an absolute URL due to issues with relative paths on the CLI.     include "/[path-to-root-www]/wp-load.php";      This works like a charm. I can now run scripts like this from the command line (`php test.php` where below script is test.php):               <?php     include "AddWordpress.php";     $terms = get_terms("actions");     echo json_encode($terms);      The problem I'm having is that if I want to include the "AddWordpress.php" not at the top of the file but inside of a method call -- I know this sounds like a terribly bad idea but there are good reasons for it ... please believe me -- then all shit breaks loose and my day turns badly very quickly. More specifically, the test file now looks like this:               <?php     function do_that_wordpress_thing() {         include "AddWordpress.php";     }     do_that_wordpress_thing();     $terms = get_terms("actions");     echo json_encode($terms);      and the errors I get are as follows:               Notice:  is_404 was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /[path-to-www-root]/wp-includes/functions.php on line 2944     Notice:  is_home was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /[path-to-www-root]/wp-includes/functions.php on line 2944     Notice:  is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /[path-to-www-root]/wp-includes/functions.php on line 2944     Notice:  is_archive was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.) in /[path-to-www-root]/wp-includes/functions.php on line 2944          ... etc ...      *** UPDATE *** On thing I picked up on PHP.net is this snippet on the include function def: > If the include occurs inside a function within the calling file, then all of > the code contained in the called file will behave as though it had been > defined inside that function. So, it will follow the variable scope of that > function. An exception to this rule are magic constants which are evaluated > by the parser before the include occurs. I think this must have an important role in why this isn't working but I'm still hopelessly lost. Can anyone explain why this could be happening? Any help would be VERY much appreciated.


title: Fatal Error wp-settings.php on line 119

text: Receiving this error message after a post update: > Warning: require(/home/thomwhite/wparch.com/wp-includes/post-template.php) > [function.require]: failed to open stream: Permission denied in > /home/thomwhite/wparch.com/wp-settings.php on line 119 > > Fatal error: require() [function.require]: Failed opening required > '/home/thomwhite/wparch.com/wp-includes/post-template.php' > (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in > /home/thomwhite/wparch.com/wp-settings.php on line 119 Any suggestions would be greatly appreciated!!!


title: How to inject a post within a loop

text: I'm trying to inject a post while the loop is running. This post will be injected on a condition, so `if(x == j){ //inject post here }` I see this would seem easy to do, but i have a posts_per_page argument in my query to use for paginating and i'm afraid that injecting a post would mess it up. Thanks in advance for any help!


title: Is it possible to have a Theme with built-in physical page files?

text: I am creating a theme and was thinking if it would be possible to create pages within my theme folder that would reflect the wordpress url + path. So for example I could when accessing: http://mydomain.com/about it would looks for about.php or about.html inside my theme folder? I have obtained success doing this but handling the `is_404` method and then rendering the page with `get_template_part($pathname)`, however, every page will output the 404 response status which is not viable? Is there any other way to accomplish that? I wish there was some kind of url aliases I could grant for my theme and could use it. Thanks in advance


title: How to change ?lang=cn into /cn/

text: I'm trying to add languages to my wordpress driven website and i installed xili-languages plugin. Unfortunately it uses lang param to differentiate between languages and i rather have seen something like http://domain.com/cn/article-in-chinese/ rather than http://domain.com/article-in-chinese/?lang=cn


title: Best way to use ajax front-end?

text: The question is about which way is the best / easiest way to make a theme with ajax, using admin-ajax.php or normally. I ask because I see that complicates using admin-ajax.php for everything and use jquery plugin to enable your browser history for example. that think? Sorry for my English!!!


title: Problem while filtering by 'category_name'

text:
I have the following code in order to display a custom WP_Query:
     <?php      $args = array(          'post_type' => 'preguntas',          'posts_per_page' => 50,          'category_name' => 'fianza'     );     $loop = new WP_Query( $args );     while ( $loop->have_posts() ) : $loop->the_post(); ?>
         <a href="<?php the_permalink() ?>"              rel="bookmark"              title="<?php the_title_attribute(); ?>">         <?php the_title(); ?>
         <?php the_terms( $post->ID, 'tipos', 'categories: ', ' / ' ); ?>
     <?php endwhile; ?>
      However, when I add the `'category_name' => 'fianza'` argument, it does not display any results (and there is content in this category). I know it's a problem with the `category_name` because if I take it off, it will display all results without a problem. Any ideas what could be wrong? Thanks! **Using var dump leads me to this** `string(302) "SELECT SQL_CALC_FOUND_ROWS wp_5zuqa4_posts.ID FROM wp_5zuqa4_posts WHERE 1=1 AND 0 = 1 AND wp_5zuqa4_posts.post_type = 'preguntas' AND (wp_5zuqa4_posts.post_status = 'publish' OR wp_5zuqa4_posts.post_status = 'private') GROUP BY wp_5zuqa4_posts.ID ORDER BY wp_5zuqa4_posts.post_date DESC LIMIT 0, 10"`


title: remove_action in plugin file

text: Im trying to use               remove_action( 'admin_notices', 'woothemes_updater_notice' );      In a plugin to keep from editing the themes functions.php file however the code isnt being executed. Do i need to wrap this in something to get it to work from the plugin files?


title: json_decode does not work on Wordpress

text: I'm trying to convert a json string back into an array in wordpress. Here is the json string that I'm getting back from the database:               [         {             "item_title": "Kindle Fire HD 7\", Dolby Audio, Dual-Band Wi-Fi, 16 GB - Includes Special Offers",             "item_url": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/ecom_redirector.php?id=2342",             "large_image": "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/29_51EN7cswSYL.jpg",             "formatted_price": "$199.00",             "stars_url": "http://my.dev/tester/wordpress/wp-content/plugins/ecom/img/stars-4-0.gif",             "product_review": "World\'s most advanced 7\" tablet with stunning HD display, exclusive Dolby audio, and the fastest Wi-Fi found on a tablet. When it comes to HD displays, great resolution is just the start. Kindle Fire HD delivers rich color and deep contrast from every angle, with an advanced polarizing filter and custom anti-glare technology. Our exclusive  Dolby Digital Plus audio  includes technology to adjust volume, create virtual surround sound, and deliver easier-to-understand dialogue in movies and TV shows.",             "review_rating": "4 out of 5",             "reviews_url": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/ecom_redirector.php?id=2347",             "reviews_label": "Read all 9,972 customer reviews",             "create_review_url": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/ecom_redirector.php?id=2346",             "create_review_label": "Write a review",             "form_id": "6653b8329db2abc61eba9f32c26d1c4c",             "add_to_cart_action": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/add_to_cart.php",             "asin": "B0083PWAPW",             "total_items": "",             "item_status": "In Stock",             "customer_images": [                 "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/29_61hMQEAJpRL.jpg"             ],             "disclaimer": "",             "item_attributes": [                 {                     "attr": "Binding",                     "value": "Electronics"                 },                 {                     "attr": "Brand",                     "value": "Amazon Digital Services Inc."                 },                 {                     "attr": "Color",                     "value": "Black"                 },                 {                     "attr": "EAN",                     "value": "2609000005244"                 },                 {                     "attr": "Label",                     "value": "Amazon Digital Services, Inc"                 },                 {                     "attr": "Manufacturer",                     "value": "Amazon Digital Services, Inc"                 },                 {                     "attr": "Model",                     "value": "53-000406"                 },                 {                     "attr": "MPN",                     "value": "0379"                 },                 {                     "attr": "PackageQuantity",                     "value": "1"                 },                 {                     "attr": "PartNumber",                     "value": "0379"                 },                 {                     "attr": "ProductGroup",                     "value": "Amazon Devices"                 },                 {                     "attr": "ProductTypeName",                     "value": "ABIS_ELECTRONICS"                 },                 {                     "attr": "Publisher",                     "value": "Amazon Digital Services, Inc"                 },                 {                     "attr": "ReleaseDate",                     "value": "2012-09-14"                 },                 {                     "attr": "Studio",                     "value": "Amazon Digital Services, Inc"                 },                 {                     "attr": "Title",                     "value": "Kindle Fire HD 7\", Dolby Audio, Dual-Band Wi-Fi, 16 GB - Includes Special Offers"                 },                 {                     "attr": "UPC",                     "value": "848719003796"                 }             ],             "customer_review_url": "http://my.dev/tester/wordpress/wp-content/ecom-customer-reviews/61b553856a18b530399c2158ebbfc71d.html",             "flickr_results": [                 "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/29_8418129172_d9cd0358ce_m.jpg"             ],             "freebase_text": "Amazon.com, Inc. (NASDAQ:u00a0AMZN) is an American multinational electronic commerce company with headquarters in Seattle, Washington, United States. It is the world\'s largest online retailer. The company also produces consumer electronics - notably the Amazon Kindle e-book reader - and is a major provider of cloud computing services.\\nAmazon has separate retail websites for the following countries: United States, Canada, United Kingdom, France, Germany, Italy, Spain, Japan, and China, with international shipping to certain other countries for some of its products. It is also expected to launch its websites in Poland, Netherlands and Sweden.\\nJeff Bezos incorporated the company (as Cadabra) in July 1994, and the site went online as amazon.com in 1995. The company was renamed after the Amazon River, one of the largest rivers in the world, which in turn was named after Amazons, the legendary nation of female warriors in Greek mythology. Amazon.com started as an online bookstore, but soon diversified, selling DVDs, CDs, MP3 downloads, software, video games, electronics, apparel, furniture, food, toys, and jewelry.\\nThe company was founded in 1994, spurred by what Bezos called his \"regret",             "freebase_image": "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/0mgkg?maxwidth=150&maxheight=150&key=AIzaSyBU4RGRI2UlcVoS7fEAWhKBURGp7-DCb1A",             "ebay_related_items": [                 {                     "title": "Amazon Kindle Fire HD 16GB, Dual-Band WiFi, 7in, Dolby Audio-Black(Latest Model)",                     "image": "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/200_140.jpg",                     "url": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/ecom_redirector.php?id=3946",                     "currency_id": "USD",                     "current_price": "215.0"                 },                 {                     "title": "Kindle Fire HD 7\" Dolby Audio Dual-Band Wi-Fi 16GB w/ Special Offers from Amazon",                     "image": "http://my.dev/tester/wordpress/wp-content/uploads/2013/03/201_140.jpg",                     "url": "http://my.dev/tester/wordpress/wp-content/ecom-plugin-redirects/ecom_redirector.php?id=3966",                     "currency_id": "USD",                     "current_price": "170.0"                 }             ]         }     ]      This works when I'm using `json_decode($json, true)` when I'm outside of wordpress. It properly converts to an array without any problems. But when inside of wordpress I have to do the following in order to get a proper json string:               $valid_json = str_replace('\\\n', '\n', $json);     $data = json_decode($valid_json, true);      The value stored in `$valid_json` perfectly works outside of wordpress but inside wordpress I get `NULL` returned to me. I tried using `var_dump()` to check to see if I'm getting the exact same thing:               $post_id = get_the_ID();     $results_cache = get_results($post_id);     $template_name = $results_cache->template_name;     $json = trim($results_cache->result);     $json = str_replace('\\\n', '\n', $json);          var_dump($json);          var_dump($json_str);      For the first var_dump I'm getting `string(9841)`. And for the second which is the string that I copied directly from the database I get `string(9839)` Another thing that I've noticed is that when I copy directly what is stored in the database and use `json_decode()` inside of wordpress it works without using:               str_replace('\\\n', '\n', $json);      the function that I used to fetch data from the database uses `$wpdb`               function get_results($post_id){              global $wpdb;              $post = $wpdb->get_row("             SELECT result, template_name              FROM results              WHERE post_id = '$post_id'         ");              return $post;     }      I don't know what's the difference between fetching from the database using a query and directly copying what's on the database. Is there anything else that I need to do for this to work?


title: Possible to add a statement to a core file?

text: I would like to add one line to a wp core file. Basically on the 'edit.php' page, just right above               <?php     include('./admin-footer.php');      I would like to add an php include statement...               include('./custom-file.php');      The custom-file is located inside a plugin, not a theme... so if I write it inside my plugin function.php, the url will be:               include( plugin_dir_path( __FILE__ ) . '/custom-file.php');      Is there some way I can use to add this one line via a function without having to edit the core file? Thanks!


title: Using array page name together with page id to deregister script

text: If I use this:               if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' );     }      the `blabla-test-page` looks like it overrides different pages, even if certain pages have not the same `body class`. For example: the page with `id` 5555 has no body class `blabla-test-page`, but for some reason, it deregisters this script too... If I remove `blabla-test- page` and change it to the ID number it has, 5555 will not be affected... How can this be happening? How should I use page name and page id together? FYI: in the `codex`, it says `is_page( array( 42, 'about-me', 'About Me And Joe' ) )`, but when I do this, the page-named class won't deregister the scripts. I think that this is very weird.


title: WP_Query orderby post__in remains ineffective in the Loop

text: I’m trying to query a custom array of posts for the homepage, trying to maintain the order given in the array. To a certain degree this works fine, WordPress finds the posts, but in the Loop the order is all mixed up again. First of all, I’m using the `pre_get_posts` hook to change the main query on the homepage, which looks something like this:               if ( is_home() && $query->is_main_query() ) {         $query->set( 'post_type', array( 'post', 'page', 'product' ) );         $query->set( 'post__in', array( 103, 14, 127, 115 ) );         $query->set( 'orderby', 'post__in' );     }      The order on the homepage is all mixed up! It’s neither following the specified array, nor the publish dates (which is the default). Instead, it’s 127, 103, 14, 115. I var_dumped the `global $wp_query` on the homepage, just to check what happened, and the SQL it queried was indeed               SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID     FROM wp_posts     WHERE         1=1 AND wp_posts.ID IN (103,14,127,115)         AND wp_posts.post_type IN ('post', 'page', 'product')         AND (wp_posts.post_status = 'publish' OR wp_posts.post_author = 1 AND wp_posts.post_status = 'private')     ORDER BY FIELD( wp_posts.ID, 103,14,127,115 )     LIMIT 0, 10      So no problem there! That’s exactly what should happen. The array of posts in `$wp_query->posts` however, has the wrong order. You might notice that there’s a custom post type `'product'` included in the query. Is that the culprit? Any idea where to look?


title: Wordpress as thesaurus/dictionnary: what approach?

text: I'm willing to develop a thesaurus/dictionary for the Berber language. A website that allows comunity members to add new words/synonyms/antonyms..   1. How to relate words (posts) to each other? by using tags? but with this approach, it's hard to keep organization when posts names/slugs are modified; then tags should be updated too.. consider the word "big" is already inserted as a post, then someone added the word "large" and related it to the word "big" by inserting a tag on it.. then comes a 3rd user and added the word "great"; this means all the posts with similar synonyms should be updated! **isn't it a bad approach going the tags way?**   2. Another issue is when I want to add antonyms; I cannot add them as tags since tags are reserved for synonyms! **so how to solve this complex structure keeping everything easy to maintain?** **Update** _Why taxonomies won't work?_ Because taxonomies are meant for categorizing things that have different characterestics from each other; like in a movie database, you have a taxonomy for actors, one for diretors for example.. But since the words in a dictionary are "equal" they should be treated the same.. so I think more on using custom fields.. Thanks for any help and sorry for the long post :) _PS; I don't want to use plugins to avoid dependence problemes._


title: Check if user is logged in, inside php file in template directory

text: I have a php file in my template directory which generates some data from a database. I only want this data to be accessable for my wordpress users. I tried by using this line of code but it gives me an error saying "headers already sent". What is wrong? Or is there any other way to solve this?               <?php           require_once('../../../wp-blog-header.php');           if (is_user_logged_in())      {              echo "hello world";           }      else      {         echo "You do not have access to this resource!";      }     ?>


title: qTranslate Character Encoding Problem When Plugin Enabled

text: I was installed the qTranslate plugin on my blog.When this plugin enabled some words looks weird.When disabled everythink is ok. How can i fix this problem ? My Blog: blog.mustibh.net A Picture: http://mustibh.net/1.png


title: pagination in a custom list created with get_pages function

text: I have a custom page that calls a function - say generatelist the generatelist functions call get_pages() and loops through the array using for each and building a list containing various data from the meta data of the pages (yes pages, not posts! for a reason) the functions returns the list (actually a catalog of pages) and echoes it into the content area of the custom page. since the list is becoming longer and longer (as more purchase pages are added) I want to add pageination to the list (while keeping the rest of the page, including custom pages that comes after the list and of course the rest of the theme:footer,sidebar etc) I saw PageNavi plugin but didn't figure out where should I use the template tag, and how do I control the number of entries before pagination. this question is similiar to this one but that didn't really get an answer. be glad to any help with this (actually I'm not a php guy, more of a python type, but built this plugin to help a friend and now need to scale this up)


title: Add multiple images to author profile page

text: I'm developing a directory style theme using multi-site and each new author needs to be able to upload 5-10 photos to be displayed in their profile page. Is there any way of doing this? I don't mind if it's a plugin as this theme is for a client and not for general release.


title: Which to use to execute code during the saving of a plugin settings page?

text: I'm writing a plugin with a settings/option page and I want some php code to be executed whenever someone saves the settings on that page and that page alone. Which actions do I need to hook into to accomplish this?


title: Adding Custom Fields for Img in Posts

text: I'm wondering how I'd be able to set a custom field within my Wordpress posts. I want to have a field available to add an image via the Post dashboard - that has a max width & max height set, I want the image to always float to the left within the posts (Text wrapping around via the right). Can anyone recommend a plugin for this, or the PHP snippet that I could include to do so (I could add to single.php or functions.php, right?) Thanks as always!


title: Problem with serialized arrays in custom meta

text:
I've recently moved my fishkeeping "species profiles" over from a custom DB to a customised WordPress custom post type. I did this by creating a PHP file which accessed the former database, extracted the appropriate information and inserted it into the WP database. This has worked for all of the profiles and all attached media, but some of my `references` (key of the meta field) don't display in back nor front-end, despite being in the database. Here's one of the references that has been pulled over which IS displaying:               Array     (         [0] => Array             (                 [ref_doc_title] => The fighting fishes (Teleostei: Osphronemidae: Genus Betta) of Singapore, Malaysia and Brunei.                 [ref_pub_year] =>                  [ref_page_nums] => Raffles Bull. Zool. Supplement (13):43-99. 2005                 [ref_publishers] =>                  [ref_authors] => Tan, H.H. and P.K.L. Ng.             )              [1] => Array             (                 [ref_doc_title] => The fishes of Danau Sentarum National Park and the Kapuas Lakes area, Kalimantan Barat, Indonesia.                 [ref_pub_year] =>                  [ref_page_nums] => Raffles Bull. Zool. Supplement (13):139-173. 2005                 [ref_publishers] =>                  [ref_authors] => Kottelat, M. and E. Widjanarti.             )              [2] => Array             (                 [ref_doc_title] =>                  [ref_pub_year] =>                  [ref_page_nums] => www.fishbase.org                 [ref_publishers] =>                  [ref_authors] =>              )              [3] => Array             (                 [ref_doc_title] =>                  [ref_pub_year] =>                  [ref_page_nums] => www.ibcbettas.org                 [ref_publishers] =>                  [ref_authors] =>              )              [4] => Array             (                 [ref_doc_title] =>                  [ref_pub_year] =>                  [ref_page_nums] => www.petfrd.com                 [ref_publishers] =>                  [ref_authors] =>              )          )      And it looks like this in the database: `a:5:{i:0;a:5:{s:13:"ref_doc_title";s:94:"The fighting fishes (Teleostei: Osphronemidae: Genus Betta) of Singapore, Malaysia and Brunei.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:47:"Raffles Bull. Zool. Supplement (13):43-99. 2005";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:24:"Tan, H.H. and P.K.L. Ng.";}i:1;a:5:{s:13:"ref_doc_title";s:98:"The fishes of Danau Sentarum National Park and the Kapuas Lakes area, Kalimantan Barat, Indonesia.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:49:"Raffles Bull. Zool. Supplement (13):139-173. 2005";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:31:"Kottelat, M. and E. Widjanarti.";}i:2;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:16:"www.fishbase.org";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}i:3;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:17:"www.ibcbettas.org";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}i:4;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:14:"www.petfrd.com";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}}` Then I have one which isn't working:               Array     (         [0] => Array             (                 [ref_doc_title] => Revision of the family Badidae (Teleostei: Perciformes), with description of a new genus and ten new species.                  [ref_pub_year] =>                  [ref_page_nums] => Ichthyol. Explor. Freshwat. 13(4): 295-372.                  [ref_publishers] =>                  [ref_authors] => Kullander, S.O. and R. Britz. 2002             )              [1] => Array             (                 [ref_doc_title] => Evolutionary and biogeographic patterns of the Badidae (Teleostei: Perciformes) inferred from mitochondrial and nuclear DNA sequence data.                 [ref_pub_year] =>                  [ref_page_nums] => Mol. Phylogen. and Evol. 32(3): 1010-1022.                 [ref_publishers] =>                  [ref_authors] => Rüber, L., R. Britz, S. O. Kullander and R. Zardoya. 2004             )          )      And this is how it looks in the database: `a:2:{i:0;a:5:{s:13:"ref_doc_title";s:110:"Revision of the family Badidae (Teleostei: Perciformes), with description of a new genus and ten new species. ";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:44:"Ichthyol. Explor. Freshwat. 13(4): 295-372. ";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:34:"Kullander, S.O. and R. Britz. 2002";}i:1;a:5:{s:13:"ref_doc_title";s:138:"Evolutionary and biogeographic patterns of the Badidae (Teleostei: Perciformes) inferred from mitochondrial and nuclear DNA sequence data.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:42:"Mol. Phylogen. and Evol. 32(3): 1010-1022.";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:57:"Rüber, L., R. Britz, S. O. Kullander and R. Zardoya. 2004";}}` The code that I'm using in the back-end is as follows:               function meta_references() {         global $post;              if ($post) {             $references = get_post_meta( $post->ID , 'references', TRUE );             if (get_post_meta( $post->ID, 'ref_type_desc', TRUE) != "") {                 $ref_type_desc = get_post_meta( $post->ID, 'ref_type_desc', TRUE);             } else {                 $ref_type_desc = -1;             }         }         ?>

Click here to add a new reference.
         <?php             if (!empty($references)) {                 $count = count($references);                 for ($i = 1; $i <= $count; $i++) {                     if ($ref_type_desc != -1 && $i == $ref_type_desc) {                         $this->print_reference($i, $references[$i-1], TRUE);                     } else {                         $this->print_reference($i, $references[$i-1]);                     }                 }             } else {                 $this->print_reference(1);             }         ?>
Click here to unset the Type Description buttons.

         <?php     }          function print_reference($i, $array = NULL, $type_desc = NULL) {         // any information below must be changed in references.js         ?>

Reference <?php echo $i; ?>

             Author(s) <input type="text" name="ref_authors[]" value="<?php if (isset($array["ref_authors"])) { echo $array["ref_authors"]; } ?>" />             Publisher <input type="text" name="ref_publishers[]" value="<?php if (isset($array["ref_publishers"])) { echo $array["ref_publishers"]; } ?>" />

             Publication Year <input type="text" name="ref_pub_year[]" value="<?php if (isset($array["ref_pub_year"])) { echo $array["ref_pub_year"]; } ?>" />             Page Number(s) <input type="text" name="ref_page_nums[]"  value="<?php if (isset($array["ref_page_nums"])) { echo $array["ref_page_nums"]; } ?>" />

Document Title <input type="text" name="ref_doc_title[]" value="<?php if (isset($array["ref_doc_title"])) { echo $array["ref_doc_title"]; } ?>" />

Type Description? <input type="radio" class="ref_type_desc" name="ref_type_desc" style="padding-top:5px;margin-top:5px;" value="<?php echo $i; ?>"<?php if ($type_desc == TRUE) { echo 'checked = "checked"'; } ?> />

Click <a href="javascript:void(0);" id="<?php echo $i; ?>_del_reference">here to remove Reference #<?php echo $i; ?>.

         <?php     }      And the code that I'm using on the front-end is:               if (get_post_meta($post->ID, 'references', TRUE) != "") {         $references = get_post_meta($post->ID, 'references', TRUE);         if (strlen($references[0]["ref_doc_title"]) > 0) {             echo '
References
' . "\n";                  echo '
';                  if (get_post_meta($post->ID, 'ref_type_desc', TRUE) != "") {                 $type_desc = get_post_meta($post->ID, 'ref_type_desc', TRUE);                      $count = count($references);                      for ($i = 1; $i <= $count; $i++) {                     if ($i == $type_desc) {                         $n = $i - 1;                         $r = $references[$n];                         echo '
';                         echo '' . $r["ref_authors"] . ', ' . $r["ref_pub_year"] . '';                         echo ' - ' . $r["ref_publishers"] . ': ' . $r["ref_page_nums"];                         echo '
' . $r["ref_doc_title"];                         echo '
';                              unset($references[$n]);                     }                 }             }             // user defined sort comparison. use lowercase to ensure sort is accurate             function cmp($a, $b)             {                 $al = strtolower($a["ref_authors"]);                 $bl = strtolower($b["ref_authors"]);                 if ($al == $bl) {                     return 0;                 }                 return ($al > $bl) ? +1 : -1;             }                  usort($references, "cmp");                  foreach ($references as $r) {                 echo '
';                 echo '' . $r["ref_authors"] . ', ' . $r["ref_pub_year"] . '';                 echo ' - ' . $r["ref_publishers"] . ': ' . $r["ref_page_nums"];                 echo '
' . $r["ref_doc_title"];                 echo '
';             }             echo '
';         }     }      **Nothing at all displays in the back-end or front-end for any of these "non- working" references, yet the entries are in the database with the correct post ID and meta_key.** So I'm wondering, is this serialized array (the non-working one) somehow malformed for WordPress usage? I don't think it's malformed by PHP standards as I can `print_r` it perfectly using the `unserialize` command. Any help would be much appreciated, I think I'm going crazy! **EDIT for Chip** Here is the (abridged) output of your code for one of the species profiles which DOESN'T display the references. I've removed the lengthy snippets of other meta fields, but left two other meta printouts in to show how they return.               array(19) {       ["genus"]=>       array(1) {         [0]=>         string(20) "Yasuhikotakia"       }       ["species"]=>       array(1) {         [0]=>         string(16) "splendida"       }      ....                ["references"]=>       array(1) {         [0]=>         string(4117) "a:12:{i:0;a:5:{s:13:"ref_doc_title";s:74:"Genetic variation of five species of Yasuhikotakia in Thailand using AFLP.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:48:"Journal of Agricultural Technology 6(4): 761-766";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:60:"Arthainsee, A., T. Leamkom, A. Jutagate and S. Chundum. 2010";}i:1;a:5:{s:13:"ref_doc_title";s:48:"The Botia modesta complex (Cobitidae, Botiinae).";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:22:"Ichthyofile No. 1: 1-8";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:14:"Grant, S. 2001";}i:2;a:5:{s:13:"ref_doc_title";s:15:"Fishes of Laos.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:52:"WHT Publications Ltd., Colombo 5, Sri Lanka. 198 p. ";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:17:"Kottelat, M. 2001";}i:3;a:5:{s:13:"ref_doc_title";s:168:"Botia kubotai, a new species of loach (Teleostei: Cobitidae) from the ataran River basin (Myanmar), with comments on botiinae nomenclature and diagnosis of a new genus.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:17:"Zootaxa 401: 1-18";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:17:"Kottelat, M. 2004";}i:4;a:5:{s:13:"ref_doc_title";s:96:"Sixty million years of evolution. Part one: family Botiidae (Pisces: Ostariophysi: Cobitoidea). ";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:81:"Travaux du Museum d'Histoire Naturelle "Grigore Antipa" 44: 309-333";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:19:"Nalbant, T. T. 2002";}i:5;a:5:{s:13:"ref_doc_title";s:128:"Hymenphysa, Hymenophysa, Syncrossus, Chromobotia and other problems in the systematics of Botiidae. A reply to Maurice Kottelat.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:82:"Travaux du Museum d'Histoire Naturelle "Grigore Antipa" 47: 269-277.";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:19:"Nalbant, T. T. 2004";}i:6;a:5:{s:13:"ref_doc_title";s:90:"Botia splendida, a new species of loach (Pisces: Cobitidae) from the Mekong Basin in Laos.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:46:"The Raffles Bulletin of Zoology 43(2): 463-467";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:19:"Roberts, T. R. 1995";}i:7;a:5:{s:13:"ref_doc_title";s:147:"Molecular phylogeny of the Southeast Asian freshwater fish family Botiidae (Teleostei: Cobitoidea) and the origin of polyploidy in their evolution.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:49:"Molecular Phylogenetics and Evolution 39: 529-541";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:53:"Šlechtová, V., J. Bohlen, J. Freyhof and P. Ráb. 2006";}i:8;a:5:{s:13:"ref_doc_title";s:188:"Families of Cobitoidea (Teleostei; Cypriniformes) as revealed from nuclear genetic data and the position of the mysterious genera Barbucca, Psilorhynchus, Serpenticobitis and Vaillantella.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:54:"Molecular Phylogenetics and Evolution 44(3): 1358-1365";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:44:"Šlechtová, V., J. Bohlen and H. H. Tan. 2007";}i:9;a:5:{s:13:"ref_doc_title";s:72:"Two new species of the cobitid genus [ì]Botia from the Lao Mekong Basin.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:46:"Japanese Journal of Ichthyology 42(2): 147-155";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:25:"Taki, Y. and A. Doi. 1995";}i:10;a:5:{s:13:"ref_doc_title";s:126:"Phylogeny of the East Asian botiine loaches (Cypriniformes, Botiidae) inferred from mitochondrial cytochrome b gene sequences.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:29:"Hydrobiologia 544(1): 249-258";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:44:"Tang, Q., B. Xiong, X. Yang and H. Liu. 2005";}i:11;a:5:{s:13:"ref_doc_title";s:177:"Comparison of evolutionary rates in the mitochondrial DNA cytochrome b gene and control region and their implications for phylogeny of the Cobitoidea (Teleostei: Cypriniformes).";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:52:"Molecular Phylogenetics and Evolution 39(2): 347-357";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:46:"Tang, Q., H. Liu, R. Mayden and B. Xiong. 2006";}}"       }       ["_thumbnail_id"]=>       array(1) {         [0]=>         string(5) "25351"       }       ["attached_media"]=>       array(1) {         [0]=>         string(156) "a:12:{i:0;i:25351;i:1;i:25352;i:2;i:25353;i:3;i:25354;i:4;i:25355;i:5;i:25356;i:6;i:25357;i:7;i:25358;i:8;i:25359;i:9;i:253510;i:10;i:253511;i:11;i:253512;}"       }      On one of the profiles that works, it displays in a similar manner:               ["references"]=>       array(1) {         [0]=>         string(1145) "a:5:{i:0;a:5:{s:13:"ref_doc_title";s:94:"The fighting fishes (Teleostei: Osphronemidae: Genus Betta) of Singapore, Malaysia and Brunei.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:47:"Raffles Bull. Zool. Supplement (13):43-99. 2005";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:24:"Tan, H.H. and P.K.L. Ng.";}i:1;a:5:{s:13:"ref_doc_title";s:98:"The fishes of Danau Sentarum National Park and the Kapuas Lakes area, Kalimantan Barat, Indonesia.";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:49:"Raffles Bull. Zool. Supplement (13):139-173. 2005";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:31:"Kottelat, M. and E. Widjanarti.";}i:2;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:16:"www.fishbase.org";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}i:3;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:17:"www.ibcbettas.org";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}i:4;a:5:{s:13:"ref_doc_title";s:0:"";s:12:"ref_pub_year";s:0:"";s:13:"ref_page_nums";s:14:"www.petfrd.com";s:14:"ref_publishers";s:0:"";s:11:"ref_authors";s:0:"";}}"       }      ** FINAL EDIT ** @goldenapples was correct with his answer. I've now opened a new question on Stackoverflow (as it isn't WordPress specific). http://stackoverflow.com/questions/9088910/migrating-data-from-latin1-charset- to-utf-8 If any of you can help it would be much appreciated!


title: Cany anyone name this lightbox?

text: I'm new to the forums and hoping to find an answer to the following question: Go to this website: http://www.indochino.com/product/gray-glen-plaid-suit Click on the thumbnails Can anyone identify this lightbox? Is it a plugin or custom? Any idea if it can be used with Wordpress? Lastly, if nobody can identify this _exact_ lightbox, do you know of anything similar? Thanks! _Michael


title: How can I remove the site URL from enqueued scripts and styles?

text: I'm dealing with an SSL issue and I would like to strip the domain from all scripts and styles being output via wp_enqueue_scripts. This would result in all scripts and styles being displayed with a relative path from the domain root. I imagine there is a hook that I can use to fileter this, however, I am not sure which one, nor how to go about it.


title: Load content From Include File within plugin

text: The title isn't the best, so feel free to change it to make it more clear... Problem: I am trying to load up a page from within a plugin and replace anything that WP puts out. Have it set so if they are on the front page of the site, it will display a PHP page within my plugin:               if(is_front_page()){              $full_path = WP_PLUGIN_URL.'/'.str_replace(basename( FILE),"",plugin_basename(FILE));              $url = $full_path . "/PLUGINNAME/file.php";              include($url);              die();     }      But thats not outputting the file. Even when I put the FULL path to the PHP file, it wont display it, or anything. It will only render up this point, in the source code:                <meta name="generator" content="WordPress 3.3.1" />      Then after that, its nothing. I have never been able to get include to work, I really don't want to use an iFrame solution. Thoughts? :) Thanks!   * Dylan **UPDATE** So I used get_file_contents and the hook template_redirect to achieve this. Going to do some testing on the live server to see whats up! :)


title: query to update post with featured images from array

text: I have 100 existing posts of a custom post type that I need to update their featured images... How would I go about creating a query to randomly update these images from an array of say 20 images from the media library? Any pointers would be great, thanks!


title: How to get outside login data (session) in WordPress?

text: i want to use codeignider login form session in wp login form               public function check_login()     {                   if($this->session->userdata('logged_in'))         {             redirect('/');         }         //Set Page Title         $data['title'] = "Check Login";                $username = $this->input->post('username');          $email = $this->input->post('username');          $password = $this->input->post('password');                  $password = hash('sha1',$password);         echo (int)$is_admin = $this->loginmodel->user_login($username, $email, $password);            $_SESSION['sumit']['puri']=$this->session->userdata('id');         // print_r($is_admin);         //     }


title: Custom select query for taxonomies that have posts categorized in another taxonomy

text: I have a custom post type "vendor" - and I want to people to drill down via custom taxonomies to see posts. I have two custom taxonomies - one for "service" and one for "location". So in a custom template I am listing all the available services... when one is clicked I load in another display that lists all locations (and I pass along the service ID in the URL query string)... when a location is clicked... (I pass the service ID and Location ID again in the query string) and I load in a list of vendors that are categorized with both that service AND location. The problem I'm running into is that there is the possibility that on that location list - it will include a location for which no posts have the previously selected service. So basically - when I get that list of locations, I need a list of locations that have posts that ALSO have been categorized with a particular service so I don't end up with an empty list. For example: let's say I select the service "photography" - and then from my list of locations I select "Boston" - but I don't have any photographers in Boston... since that's the case... I don't want "Boston" showing up in that list. While my list of services is a simple "get_terms" call... I think I need a custom select query ($wpdb->get_results) to grab that list of locations, but I'm just not sure what the query needs to be...


title: Passing a parameter to filter and action functions

text: Is a way to pass my own parameters to the function in `add_filter` or `add_action`. For example take a look in the following code:               function my_content($content, $my_param)     {     do something...     using $my_param here ...     return $content;     }     add_filter('the_content', 'my_content', 10, 1);      Can I pass my own parameter? something like:               add_filter('the_content', 'my_content($my_param)', 10, 1)      or               add_filter('the_content', 'my_content', 10, 1, $my_param)


title: How to create Admin Notice from Plugin with argument?

text: I'm coding a custom plugin to perform some actions at specific times. I'm playing with add_action and add_filter but the current task I'm working on is posting the post url to Twitter account. Problem, is I would like to display twitter API HTTP response as an Admin Notice (Codex of Admin Notice) but I'm completely lost. Here's my code Logic :                    function Twit_the_url( $post_ID )       {         //connect to twitter api              //send tweet with url              //get twitter response              //send response to admin notice :         add_action('admin_notices', create_function( "", "echo \"          $httpstatus          \";" ) );                  return $post_ID;     }     add_action( 'publish_post', 'Twit_the_url');      Everything goes well until I call the admin_notices. the tweet is created, $httpstatus exist but my message is not displayed ! I've been looking around for tips and how-to but I can't understand why it's not working. I've looked at two differents plugins to see how they do it but it change nothing. So if anyone could tell me where I'm wrong that would be great ! Thx


title: How to send default value with new parameter on 'add_filter'

text: I'm filtering `the_content` and want to pass a second parameter with the filter for context. My problem is, I don't know how to pass the _default value_ , `$content` as well as my new parameter, `$translation_terms` I call the filter like so:               add_filter('the_content', xcsn_translate( $content, $translation_terms  ), 20, 2 );      But `$content` is flagged as "Undefined variable: content" and in my function it obviously doesn't contain the content to filter. My Question: How do I pass the default value for the filter, `$content`, along with my new parameter. I'm not using OOP, so `$this' doesn't work. My function looks like this, by the way:               function xcsn_translate( $content, $translation_terms ) {         // Do something     }


title: How to add parameters on add_filter()?

text: I have this example to customize the excerpt length:               function custom_excerpt_length() {     return 30;     }     add_filter( 'excerpt_length', 'custom_excerpt_length' , 10, 1 );      and works perfect. But I want to pass the `$length` parameter on the `add_filter()` function. So I've tried:               function custom_excerpt_length( $length ) {     return $length;     }     add_filter( 'excerpt_length', custom_excerpt_length(30) , 10, 1 );      But unfortunately doesn't work. How could I pass the parameter, if possible?


title: loop not showing up when using a custom page template

text:
Okay So I want to create a Custom Page Template that displays my posts exactly the same as my `index.php` does. You can see the code of my `index.php` at the bottom. So I create a .php file named customindex.php and use the exact same code of my `index.php` and the code on the top to mark it as custom page template:               <?php     /*     Template Name: Custom Index     */      Problem: The page with the Custom Index page template won't display any posts and I don't know why. Code of my `index.php`:               <?php get_header(); ?>
<?php _e( 'Beliebte Zitate', 'html5blank'); ?>
          <?php get_sidebar(); ?>
              <?php get_template_part('loop'); ?>

             <?php html5wp_pagination(); ?>

          <?php get_footer(); ?>      Code of my customindex.php (nearly the same as index.php):                <?php     /*     Template Name: Custom Index     */ ?>     <?php get_header(); ?>
<?php _e( 'Beliebte Zitate', 'html5blank');   ?>
           <?php get_sidebar(); ?>
          <?php get_template_part('loop'); ?>

         <?php html5wp_pagination(); ?>

          <?php get_footer(); ?>      My loop.php looks like this:               <?php           if (have_posts()): while (have_posts()) : the_post(); ?>               <article id="post-<?php the_ID(); ?>" <?php post_class(''); ?>>         LOTS OF STUFF
          <?php endwhile;  ?>          <?php else: ?>

<?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?>

           <?php endif; ?>


title: Secondary Featured Image Function (post_thumbnail)

text: Does anyone know if it is possible to add a secondary Featured image function to the pages and post editor?


title: Trying to get my gallery to be responsive based on the post

text:
I am trying to build a gallery page that is responsive to the post ID. After discussing ideas with a friend who is far more knowledgeable in WP he suggested I use post ID in my arguments that is passed through the shortcode. I studied up on the gallery shortcode in the codex and noticed this `intval($post->post_parent)` so I placed that into my code for the gallery id and my page still displays every image that is in my media library, not the the images in the gallery I created. I want to keep my photoshop works separate from my astrophotography work on my portfolio. here is my website link to the gallery (the gallery I constructed consists ONLY of the space photographs, the other images are photoshop. http://lab.nmjgraphics.com/astrophotography-2/ Here is the code from my gallery.php page:               <?php         //Calling arguments for gallery. This is the place to change the information for which gallery is to be displayed         $gallery_shortcode = '[gallery id="' . intval($post->post_parent) . '" columns="3" order="ASC" orderby="ID" gallery itemtag="div" icontag="span" captiontag="p" gallery size="medium"]';     ?>          <?php get_header(); ?>
Astrophotography Gallery

     <?php echo do_shortcode($gallery_shortcode); ?>
          <?php get_footer(); ?>      Also is there a way to override or otherwise disable the pre-generated css that wp inserts for the galleries? This is what is added when the page is rendered:                     Finally if this ins't possible, I guess my next best bet would bet the nextgen gallery plugin?


title: How to make this plugin more efficient

text: Hi I have this plugin http://pastebin.com/a7t1SPXj which imports feeds from various websites. There are two problems I would like help in solving. The first is that I would like to place a limit on the date of the oldest feeds retrieved, limiting all results to the last 7 days. Secondly when I add more than 10 feeds it really starts to slow down the page and gets me PHP timeout errors. How can I make it more efficient, so it doesn't require huge load times on every page load? Thanks.


title: Pull Data from DB for Admin Page Display as Relates to Admin Page Class by BA Internet

text: Why do developers make it so darn hard to use the tools they develop? Don't answer, I already know :) Have had some success using this: https://github.com/bainternet/Admin-Page- Class ...to develop a plugin admin page. BA Internet, plugin developer, offers repeater fields, where I created a set of three fields to create a list of video tutorials. Here is my code:               $options_panel->Title(__("Video Tutorials","apc"));       $repeater_fields_videos[] = $options_panel->addText('re_text_field_video_title',array('name'=> __('Video Title ','apc')),true);     $repeater_fields_videos[] = $options_panel->addText('re_text_field_video_url',array('name'=> __('Video URL ','apc')),true);     $repeater_fields_videos[] = $options_panel->addTextarea('re_textarea_field_video_description',array('name'=> __('Video Description ','apc')),true);     //repeater block     $options_panel->addRepeaterBlock('re_',array('sortable' => true, 'inline' => true, 'name' => __('Add your YouTube, Vimeo, or Screencast videos.','apc'),'fields' => $repeater_fields_videos, 'desc' => __('Requires full url to video.','apc')));      Here is the data in my fdwp101_options field within the wp-options table               //What I see in fdwp101_options field in the wp-options table     s:3:"re_";a:1:{i:0;a:3:{     s:16:"re_text_field_video_title";s:32:"Video Title Here";     s:23:"re_text_field_video_url";     s:18:"http://youtube.com";     s:21:"re_textarea_field_video_description";s:98:"Video description here";}}      Finally, the code I use (that does not work) to display the data on my page:                  $data = get_option('fdwp101_options'); //name of options group         echo $data['re_text_field_video_title'];      BA Internet offers this code to pull data, though I can't get it to work for the repeater fields data:               //get the data to an array     $data = get_option('demo_options'); //my field is fdwp101_options     //access each field by its id     echo $data['text_field_id'];      Ideas?


title: Display all posts from specific categories on a page

text:
I want to display all posts from specific categories on a single page. Therefore I edited the page.php file in my theme folder. I added an 'if- clause' to check which page currently being displayed and load all posts from the following categories.               <?php get_header(); ?>

          <?php         if (is_page(26)) {             query_posts('cat=2,6,9,13&showposts=-1&orderby=date');                 if (have_posts()) :                  while (have_posts()) :                      the_post();                      get_template_part( 'content', 'page' );                 endwhile;              endif;           } else {             while ( have_posts() ) :                  the_post();                  get_template_part( 'content', 'page' );              endwhile; // end of the loop.          }     ?>

          <?php get_footer(); ?>      But when I load my page 26 nothing will be displayed.


title: How to drag multiple menu items at once in WordPress?

text: Say, I added 8 items to a menu. Now I want to bring all the 8 items under another item. Dragging them one by one can take ages. How do I drag them all at once?


title: WordPress 3.5: Setting custom "full URL path to files" in the Media Library?

text: As the recent changes in WordPress 3.5 removed the "full URL path to files" option from media library I am wondering how to set this option to a custom path now? I need to set my "full URL path to files" for my media files to a custom subdomain. Can you guys help me out with finding a solution for this problem? Regards, faxxim


title: Building custom pages with a video player

text: Hey i am trying to learn wordpress developement on my own, I'm building a celebrity gossip blog and i need help. I want to build a video page. Does anyone know of a plugin or anything that i can use that allows me to have a flash video player that also accepts youtube links as well. Something like, Inserting the video url, youtube if needed, and information about the video, and when i'm done i save it, and it has it's own video page that i can link to. for example this link below has a list of video post: http://www.celebuzz.com/video/ and when you click on the links it goes to a single video page like the link below http://www.celebuzz.com/video-post/sneak-preview-of-%e2%80%98austin- ally%e2%80%99-%e2%80%94-%e2%80%98world-records-work-wreckers%e2%80%99-episode/ Or would i have to create a special post type for videos. I would deeply appreciate it if someone could give me an answer to this question, it would make me extremely ecstatic.


title: How to check if image is already stored in a site's post database? (network)

text: I currently have configured Wordpress so that a post can be copied to other sites within a Wordpress network. However, a post may be broadcast more than once, and I want to check if the image is already published into that site's `wp_posts` table. As an example, let's say an image has the image path:               /wp-content/uploads/2012/01/an_image.jpg      All images are stored by the network within this setup of folders (rather than the default `/blogs.dir/files/`). In other words, can Wordpress query the database to check if this is already in the table, or does it need to be written as a PHP database query?


title: How to add a onclick attribute to a list of checkboxes?

text: I have this array for checkbox:               array(             'name' => __('Latest Product',''),             'desc' => __('Select if you want to display latest product',''),             'id' => $prefix . 'checkbox',             'type' => 'checkbox',             'std' => ''         )      I want to add an attribute for `onclick="chk(electronics, this.checked);"` on this. How can I do it?


title: How do I write a custom API endpoint that accepts args and passes them into a function?

text: I'm writing my first WP plugin and feeling pretty lost. This should be a simple issue, but I can't seem to find any good tutorials or anything. Here's some code I've cobbled together from various sources - I know some of it may not make sense, but can anyone point me in the right direction?               function my_api_activate() {       global $wp_rewrite;       add_rewrite_endpoint('myapp',EP_ALL);       $wp_rewrite->flush_rules();     }          register_activation_hook( __FILE__, 'my_api_activate');          add_filter('query_vars', 'add_query_vars');          function add_query_vars($vars){       $vars[] = "myapp";       return $vars;     }          add_action('parse_request', 'save_my_data');          function save_my_data( &$wp ){       if (array_key_exists('myapp', $wp->query_vars)){         add_post_meta('90', 'testkey', 'testval');       }       return;     }      Thanks a ton.


title: How to stop WordPress showing a virtual Robots.txt?

text: I can see the robots.txt file here : http://persian.cc/robots.txt But Google can't ! I know that I can find `robots.txt` files in the root of a website, but hey there is no robots.txt file in mine and this `robots.txt` is a virtual one being made by WordPress. Now how to stop wordpress doing that? OR If I cannot stop wordpress showing that virtual `robots.txt` file, how can I stop Google looking for it on my website? maybe a `.htaccess` code or something?


title: wp_query should show stickies first

text:
I have the problem that my theme is for some reason always showing the latest posts at first. I would however like it to show all stickies at first and then show the regular ones. Here is the code:                     <div class="home-thumbs" style="width:<?php echo $top_width; ?>px;">            <?php      $home_query = new   WP_Query("cat=$slider_cat&ignore_sticky_posts=0&showposts=$top_row_posts"); $i = 0;?>     <ul class="thumbs" style="width:<?php echo $top_width; ?>px;">     <?php while ($home_query->have_posts()) : $home_query->the_post();         $do_not_duplicate = $post->ID; $i++; ?>          <li class="post-<?php the_ID(); ?> thumb-big">

     <?php get_the_image( array( 'custom_key' => array( 'thumbnail' ), 'default_size' =>   '320x320', 'width' => '320', 'height' => '320' ) );?>

<?php echo get_the_title(get_the_ID());?>

     <?php endwhile; wp_reset_query(); $i = 0; ?>

      By setting sticky posts to zero I would expect it to show sticky posts at the beginning oif the loop but it seems that the loop counter for some reason descends through the post id's and simply showing the latest posts first, ignoring all my wp_query args.


title: WordPress built in breadcrumb trail menu?

text: Looking for a breadcrumb menu that can be called (preferably from a sidebar widget in header.php) that lists... Home > Parent Post/Page > Current Page/Post or alternately... Home > Parent Category > Current Page/Post or even Home > Grand Parent Category > Parent Category > Current Page/Post


title: How to get the second slug of a page url?

text: I have posts with a `custom field` called `year`. The year ranges from `1900 to 2011`. I want to create an individual page for each year which will displays the posts with that year. So I will be creating a page with a template and a custom query to find all posts with that specific year. However, instead of creating 100+ individual year pages I want to just create 1 page which will extract the parameter from the URL and into a variable and then find the posts with that variable. So instead of creating individual pages like `base.com/year/1990 , base.com/year/1991, base.com/year/1992` I just want to create one page and extract the year. So for example I want to extract `2008` out of this page URL:               http://www.base.com/year/2008      I already know I can extract `year` by using this code:               $post->post_name;      but how to I get additional parameters? Thanks


title: How to go about pre generating css file with variables from theme options

text: I know there have been lots of discussions on here about rendering a css file with php variables. The "no no" way of bootstrapping the wp-load.php for example. I've been working on a theme framework for a few months now and one of the things it does is generate a css file using the parse request action.               add_action( 'parse_request', 'parse_dynamic_css_request' );     function parse_dynamic_css_request($wp) {         if ($_GET['dynamic-css'] && $_GET['dynamic-css'] == 'css') {         require get_stylesheet_directory() . '/library/css/dynamic.css.php';         exit;         }     }      While this works and does the job. I know that there must be a better way to do this as I know as much as its a massive benefit having this, its not necessarily ideal. I have an idea how it would work really well and serve a static file on the front end. My thinking is that since with wordpress, you can have some functional code in the themes function.php file that runs in the admin. There must be a way with php to generate the css file when the themes options are saved from the admin. When the theme options are saved, the css.php file is processed but the results are saved to a static css file. Then when the site is loaded on the front end by users, they receive the static file that was generated when the options were saved. I have all the logic I need to do it and the code I have will do fine from a wordpress point of view. My problem is that my php skills with file handling is scratchy as I hardly ever use it. So, how would I go about it with php. What I would like to do is copy the generated php code into a static css file with php. I am thinking it would be using               file_get_contents();      Any ideas? Thanks,


title: Adding a filter to my posts

text:
Hello guys I would like to append a link to the end of the content within my post. I currently have this in my functions.php file:               function ifcj_comment_link() {     global $post;     return ' ID, 'Israel In The News Audio Link', true) . '">' . __( '
Testing
', 'ifcj' ) . ' ';     }          function ifcj_custom_excerpt_more( $output ) {     if ( has_excerpt() || in_category( _x('israel-in-the-news', 'israel-in-the-news category slug', 'ifcj') ) &&! is_attachment() ) {         $output .= ifcj_comment_link();     }     return $output;     }     add_filter( 'get_the_excerpt', 'ifcj_custom_excerpt_more' );      It displays just fine in my categories feed page: http://stage.standforisrael.org/category/israel-in-the-news/feed But that particular link is not showing up on the archive.php page. Am I missing something here? Thanks


title: Thickbox 'tb_unload' function being called twice

text: When closing the Thickbox (by clicking on the cross), I am invoking the following function, by hooking it to the `tb_unload` action. However, the action is being called twice for some reason, and I don't know why. Is there a way to stop the functino running more than once? Or better yet, finding out what is causing the action to be called twice? Thanks.               jQuery(document).ready(function($){              $(window).bind('tb_unload', function(){                  /** Set the params for passing to the AJAX function */             data = {                 security: $('input#_wpnonce', '#dd-options-edit-footer-page').val(),                 action: 'update-footer-images',             };                  $.post('admin-ajax.php', data, function(response){                      alert(response);                      /** Place the image src in the hidden image, and then show the image */                 $('#image-preview', '#dd-optinos-footer-page').html(response);                  });              });          });


title: Dynamically append custom post type to end of url

text: At the moment my nav menu's category list only links to normal post_type archives. I'd like to dynamically append a custom post type, specifically ?post_type=portfolio, to the end of each url that particular drop down list. But I really don't know anything about php regex at the moment, except that I think that's what I need for it to work. This is the code I've got in my functions.php file so far, specifically for the drop down list in question. As you can see, my theme appends the categories post count after the end of the link, and I'd like to keep it there please.               $folio = wp_list_categories('show_count=1&echo=0&child_of=86&title_li=Portfolio');     $folio = preg_replace('/\<\/a\> \((.*)\)/',' $1',$folio);     echo $folio;      Thanks


title: Posts added with wp_insert_post are moved to trash automatically

text: I've got a script that loops through some data and automatically creates some posts.               foreach($data['title'] as $title)     {         $my_post = array(          'post_title' => $title,          'post_content' => $data['descr']["{$title}"],          'post_status' => 'publish',          'post_author' => 1,          'post_category' => array(7)         );              // Insert the post into the database         $post_id = wp_insert_post( $my_post );         add_post_meta($post_id, 'web_link', $data['link']["{$title}"]);     }      After the script is run I got to posts in the backend and see them listed as published. I then go to the homepage (my posts list page) but there are none listed. I go back to the backend to see they have all been moved to trash. I try to restore them all but the same thing just keeps happening. Any ideas?


title: How to see files in directories in "Edit Themes" screen

text: I like to have folders in my theme folder for scripts and styles, but I can't access these folders in the "Edit Themes" interface. This is problematic for clients that don't give me FTP access. Is there a way to see these folders and the files in them from the Wordpress admin section?


title: Renaming wp-content folder dynamically

text: Is it possible to rename the wp-content folder dynamically? I am building a custom framework to use on themes and it would be nice to set it up where it does everything on its own. I am using this following code right now in wp-config               define ('WP_CONTENT_DIR','/name_of_new_folder');     define('WP_CONTENT_URL','http://example.com/name_of_new_folder');      Can I pull the site domain through dynamically with PHP?


title: Alternative default avatar generator?

text: Most of the commenters at my WordPress blog do not have a Gravatar account. Hence the comment section is almost always filled with the same old mystery man avatars. I am looking for custom gravatar generators for commenters without their own avatar. So far I have only found Identicons, MonsterID’s, and Wavatars. I find some of the avatars generated by these engines to be these ugly, scary and OTT. Also these do not blend with the blog theme and stick out like a sore thumb. Can some one point me to a avatar generator that can generate nice looking avatars?


title: The Loop in Static Page

text: I have some questions about the loop. I'm using "twentyfourteen" theme as an example. I'm creating 2 php files with basic loop. One is home.php, and one is a template page called sample-page.php . Both contains this code;               if( have_posts() ) :         while( have_posts() ) : the_post();             the_content;         endwhile;     endif;      Nothing fancy, the only difference is I have template declaration on sample- page.php               /**      * Template Name: Sample Page      */      According to WordPress Codex, when you set a "Blog" as a static front-page, a home.php is used as template, if it exists. The "Static Front-page" will use the custom page template, if it exists, in my example, it would use sample- page.php . Now here's my questions;   1. Why is it that 2, identical php file produce different results? In my example, the "sample-page.php" will display the "PAGE CONTENT", while "home.php" will display "RECENT POSTS"    2. Why do we need, "while" loop, if all we want is to display the "PAGE CONTENT"? Can't we just use               if( have_posts() ) :         the_post();         the_content();     endif;        3. If we want to show "RECENT POSTS" in a template page. Why do we need to provide some queries first? These questions might seems unnecessary and don't really have a purpose. Even my friend told me, "As long as you know how to drive a car, you don't need to understand how the engine works." But still I want to know. I would really appreciate if someone can give me some answers about this. Even if you don't know the answer, I thank you for reading! Regards, Dan


title: Allow Content Author to Publish, But Not Edit or Delete

text: I am hiring a content writer for my WordPress blog. I will be the sole blog admin. I need to define a role for this writer. I was wondering if there was a WordPress user role that will allow him to publish posts and pages (even without admin approval), but not be able to Edit or Delete them once published (or only do this after admin approval). I need this in case he has a change of heart and decides to ruin the site by removing all posts he created or replacing them with rubbish.


title: Prevent custom post type from showing up in custom menus

text: How do I do that? Any custom post type I register shows up as a meta box on the menu page... ![enter image description here](http://i.stack.imgur.com/HHvrw.jpg)


title: Good solution for adding jQuery tabs anywhere within WordPress?

text: Is there any solution for using jQuery tabs within the native WordPress scripts? If you know of a way to get any method of jQuery tabs working on the frontend and the backend please share your solution. I have tried implementing jQuery Tabs (example source available at link) **Dependencies:**   1. UI Core   2. Widget Factory   3. Effects Core (optional; for use with the show and hide options) **Additional Notes:** This widget requires some functional CSS, otherwise it won't work. If you build a custom theme, use the widget's specific CSS file as a starting point. I have also tried implementing Organic Tabs (demo) (source) I tried enqueuing all native WordPress scripts for these, and couldn't get the tabs to function. Using the first option (jQuery and Jquery UI) with native WordPress scripts didn't work. When I used the latest version of jQeury instead of native WordPress jQuery, they worked, but then the rest of the admin interface was broken. And glancing at the Organic Tabs source, it looks as if that code was last tested to work with jQuery version: `1.7.1`. As a side note, it seems like native WordPress jQuery version is: `1.8.3` Here are the styles being added for jQuery and jQuery UI tabs.               $to_add['jquery-ui'] = 'http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css';     $to_add['tabs'] = './css/global/tabs.css';// path to custom tab styles.      Here are the scripts being added for jQuery and jQuery UI tabs.               $to_add['jquery'] = includes_url('/js/jquery/jquery.js');     $to_add['jquery-ui-core'] = includes_url('/js/jquery/ui/jquery.ui.core.min.js');     $to_add['jquery-ui-widget'] = includes_url('/js/jquery/ui/jquery.ui.widget.min.js');     $to_add['jquery-effects-core'] = includes_url('/js/jquery/ui/jquery.ui.effect.min.js');     $to_add['jquery-ui-tabs'] = includes_url('/js/jquery/ui/jquery.ui.tabs.min.js');      Of course, fired on `admin_enqueue_scripts` using `wp_enqueue_style()` and `wp_enqueue_script()` Using their same HTML markup from the example just changing the tabs container ID to a class instead.               <script>     $(function(){         $(".tabs_container").tabs();     });     </script>      Setting jQuery Script to: `$to_add['jquery'] = 'http://code.jquery.com/jquery-latest.js';` Makes the tabs work, but all other areas of the dashboard page break. Dashboard page I'm referring to is: post edit screen for any post type. Trying to add jQeury tabs to a metabox. It looks like WordPress is loading the following scripts on the post edit screen:   1. jquery,    2. utils,   3. plupload,   4. plupload-html5,   5. plupload-flash,   6. plupload-silverlight,   7. plupload-html4,   8. json2


title: Auto Publish On Cron

text: I have some 100 unpublished posts. I want to publish 1 random post every time a cron is run. Is there a way or plugin to achieve this...


title: Change sign-on URLs for security purposes

text: For security reasons, it should be possible to rename login.php to something different, and change other access shortcuts (eg: wp-admin) to point to the new URL. Is there a documented best practice for this? If not, what would the most correct methodology be? I appreciate that this is not _security_ per se, just obfuscation, but I'm considering this to be just another _layer_ of protection: not a _replacement_ of other security tactics such as failed attempt lockdown limiting and stricted password enforcement. Creative approaches welcome.


title: Highlight current tag using get_tags()

text:
I'm nearly there with this, but I need to highlight the current tag link/archive being viewed:
                 <?php                  $tags = get_tags();                 if ($tags) {                     foreach ($tags as $tag) {                         echo '
term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'
';                     }                 }                  ?>
      I'd like to apply `<li class="active-tag">` to the list item that contains the active tag in the code above - can anyone help me with that please? Many thanks Osu


title: Publish Post After Click On A Link

text: I have a frontend posting form (CF7), where user inputs (among other data of course) his email. Now I set the status to pending. What I want is, that the user would get trough autoresponder a mail, in which would be the link for changing the status to PUBLISH when clicked on. Is there any solution for this? Autoresponder is not the problem, I do not know, how to set up this link.


title: How to export database correctly for local to online

text: This process as a whole is fine... but I seem to have one small issue when I upload the database online. If I create a theme and modify some options that's fine for the local version. Once I upload the local version to my server, these values get reset to their defaults. Does anyone know why this would occur? At the moment I export the database from PHPMyAdmin by selecting everything, ticking 'Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement' and then exporting it to a SQL file. Thanks


title: List categories and exclude child categories

text: The script below creates a listing of the categories in the site (excluding those in "uncategorized"). If possible, I'd like to modify it so that it only lists the top level categories (no child categories)...                   $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h);         $cat_args['title_li'] = '';         $cat_args['exclude_tree'] = 1;         wp_list_categories(apply_filters('widget_categories_args', $cat_args));


title: How to import CSV into Custom Post Type custom fields?

text: I have created a Custom Post Type and then used a plugin to create the custom fields for that post type. It will display a type of membership: Name Address Zip Website But I am stuck on how to take the csv file I have, which has 700 entries and import it to create 700 entries under the CPT I created and autopopulate the custom fields I created. I tried a lot of plugins, but none seemed to do both parts. Some let me just select the CTP but I couldn´t get all the fields populated. Just needed to know best way to accomplish this.


title: The Excerpt gets page excerpt instead of most recent post excerpt

text:
See www.pinosalon.com, Recent Blog is the same as Welcome. On the page-home.php template that is used as the home page I have the loop which simply displays the Welcome text. A few lines down the template, outside the loop, I get recent posts and display the latest post with the_excerpt(). The title and read more link work, but the_excerpt grabs the content from the loop rather than from the most recent post. After updating the code based on the solution suggested by another question, the excerpt is no longer displayed. Here is the code I am using:               //Block displays the current page's content     <?php while ( have_posts() ) : the_post(); ?>
<?php the_title(); ?>
         <?php the_content(); ?>     <?php endwhile; ?>          //Block that should display the latest post     <?php     $args = array( 'numberposts' => '1','post_type' => 'post' );     $recent_posts = wp_get_recent_posts( $args );     foreach( $recent_posts as $recent ) : setup_postdata($recent);         echo '
' .   $recent["post_title"].'
';     echo the_excerpt();     echo 'Read More';     endforeach;     ?>


title: Get_the_author doesn't return author name

text: I insert author box below my post and use get_the_author to return author name but it doesn't working. It also doesn't working with Search post by author. Hope everyone give me solution, thank in advance. ![enter image description here](http://i.stack.imgur.com/7wZnW.png)


title: Widgets not showing in my custom theme

text:
I am developing this WordPress custom theme: http://onofri.org/WP_BootStrap and I am trying to insert a **widget area** under the **Partner e Sostenitori** section, but can't work. I have performed the following operations: 1) I have put the following code into the **functions.php** theme file:               /**      * Register our sidebars and widgetized areas.      *      */     function arphabet_widgets_init() {              register_sidebar(array(             'name' => 'My_Widgtet_Area',             'id' => 'partner-slide',             'before_widget' => '
',             'after_widget' => '
',             'before_title' => '
',             'after_title' => '
',         ));     }          add_action('widgets_init', 'arphabet_widgets_init');      As you can see the name of the widgetized area is **My_Widgtet_Area** 2) Then I have insert the following code into my **index.php** file to show the widgets in the desired positions:

Partner e Sostenitori

             <?php                 // 'My_Widgtet_Area' area, where the id is called:                 if (is_active_sidebar( 'My_Widgtet_Area' ) ) : ?>

                         <?php dynamic_sidebar( 'My_Widgtet_Area' ); ?>

                  <?php endif; ?>

      3) Then I entered in the WP administration panel and into the **Appearance ---> Widget** section I have the **My_Widget_Area** "box" where I can drag the widgets in my wordpress installation. So I put in it some widget (as the **Calendar** and the **Search** wigets) to try it The problem is that, as you can see in the previous link, the **Partner e Sostenitori** text is written but there is no widget displayed in my page. Why? What am I missing? How can I solve this problem? Tnx Andrea


title: Add post classes for custom taxonomies to custom post type?

text:
I was surprised to learn that custom taxonomies aren't added as body or post classes like categories and tags are. I'm sure this will be added in a future version of WordPress, but in the meantime I need to add a custom taxonomy to the post class so that I can style post in a certain category in that taxonomy differently. It'd be most elegant to filter the post class and add the taxonomies to it. I found a snippet to pull off a similar trick with the body class, but I haven't been successful in adapting it:               function wpprogrammer_post_name_in_body_class( $classes ){      if( is_singular() )      {       global $post;       array_push( $classes, "{$post->post_type}-{$post->post_name}" );      }      return $classes;     }          add_filter( 'body_class', 'wpprogrammer_post_name_in_body_class' );      A bit more crudely, I thought about using the_terms function to create my own classes for the custom posts, something like this:               <div class="<?php the_terms( $post->ID, 'taxonomy', '', ' ', '' ); ?>">
      But then I'd have to filter out the HTML that `the_term` generates. Am I missing anything obvious here, is there a simpler way to solve this issue?


title: How to make classes for posts?

text:
Thanks in advance. I'd like to have posts with different colored borders and headers. It would be nice to choose a category of the post (red, blue, black, etc.) and have it change the class for that specific post. If it were outside of dreamweaver, it would use classes. So I could say:

Header
     Content
      Ideally this would work by having an option in the design view named 'classes' or 'post styles'. I would choose 'box' and 'red', and the style would be changed. Is this possible?


title: Can you call a template file without assigning template to a page in the admin panel?

text: This idea is just to protect certain sections of my theme from over-zealous clients. I would like to add pages, that exist in the front end and can be added to the menu (using wordpress 3.0 api) but the page NOT be present in the 'Pages' dialogue in the admin panel, and is thus not user editable.


title: Get path to themes CSS file inside of a Plugin

text: I am trying to get the path to the themes CSS file from inside a Plugin, anyone know how to do this?


title: Custom Post Type + Custom Meta Query Not Showing 2012 Posts

text:
I created a custom "events" post type for a client that basically "hides" the post once it has expired (ie. the event already happened). The events are displayed in the order of the start date rather than the order that they are posted in. This is, ultimately, all working fine. However, now that we're closing in on the end of the year it appears that my comparison operator doesn't allow any posts from next year to be shown and I'm not totally sure how to change the operator to make this work properly.                   $args = array(                         'post_type'         => 'event',                         'post_status'       => 'publish',                         'posts_per_page'    => $num,                         'paged'             => $paged,                         'meta_key'          => 'startDate',                         'meta_query'        => array(                                                     array(                                                          'key'     => 'startDate',                                                         'value'   => date("m/d/Y"),                                                         'compare' => '>=',                                                         'type'    => 'NUMERIC'                                                     )                                                 ),                         'orderby'           => 'meta_value',                         'order'             => 'ASC'             );         $e_query = new WP_Query($args);              // get the current date to compare to post's dates         $currentDate = date("m/d/Y");              if($e_query->have_posts()){             // while we have posts             while($e_query->have_posts()) : $e_query->the_post();                      // get the post's start date to compare to the current date                 $startDate_compare = date('m/d/Y', strtotime(get_post_meta(get_the_ID(), "startDate", true)));                      if ($startDate_compare >= $currentDate) {                     // this is where all my code to output the post's data lives and which is ultimately working fine except for the fact that no posts that are dated to start in 2012 will show up here                           }                       endwhile;         } else{             $e_content .= '
Sorry, there is currently no events scheduled at this time.
';         }      It appears to be something to do with my meta_query because I just attempted outputting the post_titles before I make the               if($startDate_compare >= $currentDate){       comparison and only the posts that happen in 2011 show up. Thank you for any help you may have for me. **UPDATE IN RESPONSE TO user9347's COMMENT** When I changed the "type" of the meta_query to "date" which, ultimately, should've worked, the custom post type is returning that there are no posts found which to me says that there is an issue with how the value is being saved potentially for the "startDate" key? I would think that the 'date("m/d/Y")' in the meta_query's "value" would fix this... but then I'm not a super knowledgeable php developer... more of a hacker than anything. This is the code for my custom meta field where my client picks a startDate with the jquery datepicker. The jquery datepicker returns the date value like this: "02/18/2012".
             Start Date	             <input type="text" name="startDate" id="startDate" class="datepicker" style="width: 200px;" value='<?php echo $startDate; ?>' />
      then in a function attached to the "save_post" action, it is saved as such:               update_post_meta($post->ID, 'startDate', $_POST['startDate']);      It seems to me that I need to save this 'startDate' value as a date object in order to make the meta_query work the way it should... would this just look something like this?               $startDateToTime = date('m/d/Y', strtotime($_POST['startDate']);     update_post_meta($post->ID, 'startDate', $startDateToTime);      *This last part didn't seem to work when I created a new post, saved it, and changed the meta_query 'type' to 'DATE', so I'm still a little lost here.*


title: How to Collect Keyword and Search Engine Data on Webforms?

text: We have a contact form using Contact Form 7 on our wordpress site. We would like to be able to attach any information about where the user came from: keyword search is the #1 item of interest. We also do a lot of PPC and it would be nice to capture any Ad Group/Campaign information from there as well. How can this be done?


title: Creating a theme options page

text:
I'm currently using Ian Stewart's A Sample WordPress Theme Options Page trying to create an inputfield and two textareas. Probably overlooking something somewhere I seem to be having some difficulties adding the second textarea. Does someone know what I'm doing wrong perhaps? Here's the code I'm currently using:               <?php     add_action('admin_init', 'theme_options_init');     add_action('admin_menu', 'theme_options_add_page');     /**      * Init plugin options to white list our options      */     function theme_options_init() {         register_setting('schema_options', 'schema_theme_options', 'theme_options_validate');     }          /**      * Load up the menu page      */     function theme_options_add_page() {         add_theme_page(__('Theme Options', 'schema'), __('Theme Options', 'schema'), 'edit_theme_options', 'theme_options', 'theme_options_do_page');     }          /**      * Create the options page      */     function theme_options_do_page() {         if (!isset($_REQUEST['settings-updated']))         $_REQUEST['settings-updated'] = false;         ?>
         <?php echo "
" . get_current_theme() . __(' Theme Options', 'schema') . "
"; ?>         <?php if (false !== $_REQUEST['settings-updated']): ?>

<?php _e('Options saved', 'schema'); ?>

         <?php endif; ?>         <form method="post" action="options.php">             <?php settings_fields('schema_options'); ?>             <?php $options = get_option('schema_theme_options'); ?>
                 <?php                     /**                      * A sample text input option                      */                     ?>
                     <?php _e('Some text', 'schema'); ?>	                     <input id="schema_theme_options[typekit]" class="regular-text" type="text" name="schema_theme_options[typekit]" value="<?php esc_attr_e($options['typekit']); ?>" />                                                      <?php _e('Sample text input', 'schema'); ?>
                      <?php                     /**                      * A sample textarea option                      */                     ?>
                     <?php _e('A textbox', 'schema'); ?>	                     <textarea id="schema_theme_options[metadescription]" class="large-text" cols="50" rows="10" name="schema_theme_options[metadescription]"><?php echo esc_textarea($options['metadescription']); ?></textarea>                                                      <?php _e('Sample text box', 'schema'); ?>
                      <?php                     /**                      * A sample textarea option                      */                     ?>
                     <?php _e('A textbox2', 'schema'); ?>	                     <textarea id="schema_theme_options[homedescription]" class="large-text" cols="50" rows="10" name="schema_theme_options[homedescription]"><?php echo esc_textarea($options['homedescription']); ?></textarea>                                                      <?php _e('Sample tex2t box', 'schema'); ?>

                 <input type="submit" class="button-primary" value="<?php _e('Save Options', 'schema'); ?>" />
         </form>
     <?php     }          /**      * Sanitize and validate input. Accepts an array, return a sanitized array.      */     function theme_options_validate($input) {         // Say our text option must be safe text with no HTML tags         $input['typekit'] = wp_filter_nohtml_kses($input['typekit']);         // Say our textarea option must be safe text with the allowed tags for posts         $input['metadescription'] = wp_filter_post_kses($input['metadescription']);         $input['homedescription'] = wp_filter_post_kses($input['homedescription']);         return $input;     }


title: Can't install vEstate Real Estate WP Themes

text: I have downloaded the vEstate Real Estate WP Themes.when i try to install it I got this error.![enter image description here](http://i.stack.imgur.com/pU37i.jpg) I have update the upload_max_filesize to 20M.plz tell how to fix this error? need quick help


title: short code not working in custom post type listing, how to fix it?

text: Any activated plugin's short code not working while I listing all post from specific custom type, it's display short code as it is, but short code is not executing, my custom post coding is below:               add_action( 'init', 'create_eyeu' );         function create_eyeu() {             $eyeu_translation = get_option(THEME_SHORT_NAME.'_gdl_eyeu_slug','eyeu');                  $labels = array(                 'name' => __('eyeu', 'gdl_back_office'),                 'singular_name' => __('eyeu Item', 'gdl_back_office'),                 'add_new' => __('Add New', 'gdl_back_office'),                 'add_new_item' => __('Add New eyeu', 'gdl_back_office'),                 'edit_item' => __('Edit eyeu', 'gdl_back_office'),                 'new_item' => __('New eyeu', 'gdl_back_office'),                 'view_item' => __('View eyeu', 'gdl_back_office'),                 'search_items' => __('Search eyeu', 'gdl_back_office'),                 'not_found' =>  __('Nothing found', 'gdl_back_office'),                 'not_found_in_trash' => __('Nothing found in Trash', 'gdl_back_office'),                 'parent_item_colon' => ''             );                  $args = array(                 'labels' => $labels,                 'public' => true,                 'publicly_queryable' => true,                 'show_ui' => true,                 'query_var' => true,                 //'menu_icon' => GOODLAYERS_PATH . '/include/images/eyeu-icon.png',                 'rewrite' => true,                 'capability_type' => 'post',                 'hierarchical' => false,                 'menu_position' => 5,                 'supports' => array('title','editor','thumbnail','custom-fields'),                 'rewrite' => array('slug' => $eyeu_translation, 'with_front' => false)               );                   register_post_type( 'eyeu' , $args);                  register_taxonomy(                 "eyeu-category", array("eyeu"), array(                     "hierarchical" => true,                     "label" => "eyeu Categories",                      "singular_label" => "eyeu Categories",                      "rewrite" => true));             register_taxonomy_for_object_type('eyeu-category', 'eyeu');                        }