SQL returned by Wp_Query has wp_posts.ID = -1

I have a custom loop based on these arguments (below), and for some reason when it's run, the SQL returned has this fragment: ... AND wp_posts.ID = -1 ... And I get no results from the db. If I run the query against the db without this fragment, I get the results I need. Could someone, please, point out what's wrong with argument list that causes this behavior?               $args = array (         'post_status'           => 'draft',         'posts_per_page'        => 10,         'category_name'         => $language_sql_param, //fixed         'meta_query'            => array(             array(                 'key'       => 'review_rating',                 'value'     => '3',                 'compare'   => '>',                 'type'      => 'NUMERIC',             ),         ),         'cache_results'          => false,         'update_post_meta_cache' => false,         'update_post_term_cache' => false,         'suppress_filters' => true,         'meta_key' => 'review_id',         'orderby'  => 'meta_value_num',     );           $wp_query = new WP_Query( $args );      # Revised question: I am filtering posts based on a category(s) they belong too, in my case they are country codes. Here's the SQL that WP generates when I set `$language_sql_param` to this:               $language_sql_param = 'us,gb,ca,au,ie'      It works fine and returns IDs for my posts for EN speaking countries.               SELECT SQL_CALC_FOUND_ROWS wp_posts.ID     FROM wp_posts         INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)         INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)         INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)     WHERE 1=1             AND ( wp_term_relationships.term_taxonomy_id IN (20,21,28,36,37) )             AND wp_posts.post_type = 'post'             AND (wp_posts.post_status = 'draft')             AND (wp_postmeta.meta_key = 'review_id'             AND (mt1.meta_key = 'review_rating'             AND CAST(mt1.meta_value AS SIGNED) > '3') )     GROUP BY wp_posts.ID     ORDER BY wp_postmeta.meta_value+0 DESC     LIMIT 0, 10      When I set `$language_sql_param = "'de,ch'"`, I get this SQL:               SELECT SQL_CALC_FOUND_ROWS wp_posts.ID     FROM wp_posts         INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)         INNER JOIN wp_postmeta ON (wp_posts.ID = wp_postmeta.post_id)         INNER JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id)     WHERE 1=1             AND wp_posts.ID = -1             AND ( wp_term_relationships.term_taxonomy_id IN (27,34) )             AND wp_posts.post_type = 'post'             AND (wp_posts.post_status = 'draft')             AND (wp_postmeta.meta_key = 'review_id'             AND (mt1.meta_key = 'review_rating'             AND CAST(mt1.meta_value AS SIGNED) > '3') )     GROUP BY wp_posts.ID     ORDER BY wp_postmeta.meta_value+0 DESC     LIMIT 0, 10      The SQL has this extra `AND wp_posts.ID = -1`. WordPress seems to correctly generate the IN clause for the categories I am filtering, as in `AND (wp_term_relationships.term_taxonomy_id IN (27,34))`, but because WordPress somehow adds `AND wp_posts.ID = -1` condition no posts are returned. Where is `AND wp_posts.ID = -1` coming from?


Can I dynamically create a link to my plugin settings/options page from my plugin description?

Currently, in my plugin description, I'm hardcoding... > To customize options  admin.php">click here Is there a dynamic method to call the plugin options page?


Changing RSS title link to link to feed instead of blog

Frustration! Is there an easy to change the RSS title link using the RSS widget to link to the feed instead of the blog itself? It can't be this hard.. I could easily hard code this but I want to keep it as modular as possible.


Add custom field automatically to custom page types

I have a custom page type set up called 'Products' and I need each of these post to automatically have multiple custom fields to set up a table of features/prices for the individual product pages. Is there any way this can be done? Thanks.


Wordpress theme options and insert default value for serialize data

How to add default values for theme options? Currently I use basic option from this site The sample will stored option value in serialize on database. When we activate the theme, there is no value in database at first time until we click Save Changes button. Now I want add default value when theme activate something like this.               option_id   blog_id     option_name     option_value                                              autoload      152           0           theme_data      a:16:{s:12:"html_doctype";s:1:"1";s:14:"header_fav...     yes      Or how do I tweak current sample option to save not in serialize to database               option_id   blog_id     option_name     option_value    autoload      152           0           html_doctype    1               yes      Let me know.


Changing WooCommerce Display Price Based on User Role & Category

I'm looking to display a different price based on a user role (wholesaler, dealer, etc) AND based on the category. There's a dynamic pricing plugin that displays these discounts once an item is added to the cart, but not on the page itself. Is there a way to use a filter or action to check for the user level, check the item's category and then change the price dynamically?


Custom Login with Ajax not working with IE

Iam making my own custom login in wordpress using wp_signon function. Whenever a user enters his credentials, another page is called using ajax. In that page, i check the users credentials, and log the user in using wp_signon function. Then a confirmation is sent and the current page captures it and displays that the user is successfully logged in. The code works in Chrome and Firefox but doesnot work in IE. This is the code in the AJAX file. The current page gets a response saying the user is logged in, but when i refresh it still shows the user is not logged in. :( stuggling with it for days. Help me please               $creds = array();     $creds['user_login'] = $user;     $creds['user_password'] = $password;     $creds['remember'] = $remember;     $user = wp_signon( $creds, true );     if ( is_wp_error($user) ){         echo "Invalid Username or Password";     }     else {         $current_user = wp_get_current_user();         $userid=$current_user->ID;         mysql_pconnect($dbhost,$dbuser,$dbpass) or die ("Unable to connect to MySQL server");         $dbquerry= 'select `login` from wp_users where user_login="'.$_GET['user'].'"';              $result=mysql_db_query($dbname,$dbquerry);         list($login)=mysql_fetch_array($result);         if($login==1) {             echo "change";         }         else {             echo "success";         }     }      This code work well in Chrome and firefox and not in IE


Custom Taxonomies not retaining hierarchy while importing from one site to another

On my site I have a Custom Post Type "listing" which has a hierarchial Taxonomy "local". The terms in this taxonomy are in the form of States > Cities. For example "Washington" is a parent term & Arlington, Auburn, Davenport etc could be it's child taxonomies. Now when I export & import this Custom Post Type to another site, my child level taxonomies become top level taxonomies, they no longer retain the hierarchy. I have used code in functions.php to create these, no plugins. What am I doing wrong?


How to show the image caption on custom post type ...?

I Follow this code to make a gallery photo system:               $the_imgs = get_custom_field('gallery_img:to_array');     foreach( $the_imgs as $img )     {         list( $url, $width, $height ) = wp_get_attachment_image_src( $img, 'thumbnail' );         echo '
';      }      but I wanna to show my caption photos, someone can help me...???


Displaying custom post type by first letter through custom taxonomy

I'm trying to make a page on my WordPress website to display all kinds of food through 26 loops. Every loop has to loop a letter of the alphabet, and on top of the page I have links that will link to the anchor boxes around the loops. So what I want to be displayed is something like this: **NAV:** _a b c d e ...(and so on) ... z_ **A** All items starting with the letter A **B** All items starting with the letter B And so on.. * * * After reading this topic: Display all posts starting with given letter? I decided to use diffrent terms for the letters. For this I made a custom post type called 'waaier' In there I have a custom taxonomy called 'waaier_abc' And in there diffrent terms for each letter called 'waaier_a' , 'waaier_b' and so on I think the most logical way to mage 26 loops beneath each other, because I want each letter in a diffrent div as well. I tried this loop for it but it doesn't display anything, also not the else statement..
                         <?php query_posts(array('post_type' => 'waaier', 'waaier_abc' => $term->waaier_a ) ); ?>                         <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                         <?php endwhile; else: ?>
<?php _e('Sorry, de letter a bevat nog geen inhoud.'); ?>
                         <?php endif; ?>
      Does anyone have an idea for an other loop too display terms from a certain post type OR to displaying posts with a certain first letter of a certain post type. Sorry if my english is looking weird


Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. **The scenerio** The plugin allows for custom css styles through creating a custom CSS file through WordPress AJAX. Here is how I generate the custom AJAX CSS stylesheet: **Generate WordPress AJAX CSS file**               /**      * Enqueue the widgets stylesheet      */     public function add_awp_css(){              wp_enqueue_style($this->hook, plugins_url('advanced-widget-pack/css/advanced-widget-pack.css' , dirname(__FILE__)), array(), '', 'screen');               wp_enqueue_style(             $this->hook.'-custom',             add_query_arg(                 array(                     'action' => 'advanced_widget_pack_gen_css',                     /* Include this to ensure changes don't get cached by the browser */                     'layout' => substr(md5(serialize($this->hook)), 0, 8)                 ),                 site_url()             ),             array($this->hook),             $this->version         );       }      This works greats. Now the function that the above enqueue calls is this: **The callback function for the WordPress AJAX CSS file**               /**      * Echo the CSS for the custom widgets style      */     public function advanced_widget_pack_css() {         if(empty($_GET['action']) || $_GET['action'] != 'advanced_widget_pack_gen_css') return;         if(!isset($_GET['ver'])) return;              $css_text = '';              /* ============================= */         /* Archives Widget               */         /* ============================= */         if(awp_option('archives_style_border') == 'true'){                   $css_text .= ".awp_archive_widget { border:".awp_option('archives_style_border_width').' '.awp_option('archives_style_border_style').' '.awp_option('archives_style_border_color')." !important }\n";             $css_text .= awp_option('archives_style_border_radius') == 'round' ? '.awp_archive_widget { -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px }' : ''.''." \n";         }             $css_text .= ".awp_archives_colour { color:".awp_option('awp_archives_dropdown_inst_colour')." !important }\n";               /**          * Filter the unprocessed CSS array          */         $css_text = apply_filters('advanced_widget_pack_css', $css_text);              header("Content-type: text/css");         echo $css_text;         exit();     }      This above function also works fine. It outputs a CSS file. **The Widget** In the actual WordPress widget file I create some extra CSS code that is outputted. Here is a slimmed down version of the "widget" function within the widget class.               class Advanced_Widget_Pack_Widget_Archives extends WP_Widget {              public function __construct(){}              public function form($instance) {}              public function widget($args, $instance){                  extract($args);                  // All the widget code is contained here....                  **/* Styling for the shortcode */             if($is_awp_sc == 'true'){                      /* Generate unique id if shortcode - used for styling */                 $sc_id = mt_rand(1, 100000);                      $sc_css =  ".awp_archive_widget_sc".$sc_id." { border:".$awp_archives_border_width.' '.$awp_archives_border_style.' '.$awp_archives_border_color." !important }\n";                 $sc_css .= $awp_archives_border_radius == 'round' ? '.awp_archive_widget_sc'.$sc_id.' { -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px }' : ''.''." \n";                      $sc_css .= ".awp_archive_widget_sc".$sc_id." li a, .awp_archive_widget_sc".$sc_id." li { font-size:".$awp_archives_font_size." !important }\n";                 $sc_css .= ".awp_archive_widget_sc".$sc_id." li a { color:".$awp_archives_link_std." !important }\n";                 $sc_css .= ".awp_archive_widget_sc".$sc_id." li a:hover { color:".$awp_archives_link_hover." !important }\n";             }**                  // The widget code gets outputted here         }     }      In the above code I have removed all the unnecessary code to save space and just left the code I need to demonstrate my requirement. **The issue** What I want to do is pass the **$sc_css** code to the **advanced_widget_pack_css()** function and append it to the end of the dynamic generated CSS code. I have applied a filter in the advanced_widget_pack_css() function, however I do not understand how to pass the custom generated contents from the widget class to this function. I don't want to have to echo out the CSS page, but would prefer to append it to the already made custom CSS file. I have been reading that this can be done by using WordPress "actions" or "filters" but cannot wrap my head around it. Any help would be greatly appreciated. Thanks.


Menu link to all posts (all categories included)

In WordPress how can I add a menu link to an archive for Posts? I can see that I can add category archive links but what if I want to have an archive of all the posts (therefore including all categories?)


Make a user administrator to a sub directory site and a contributor to main site in multisite network

I have a multisite network. The main site displays news. The sub directory sites have administrators and I call them subsite admin. If the subsite admin wants to post to the main site, I want them to log in only as a contributor for the main admin to review their news before publishing. Is it possible to customize the role of subsite admin where he/she may use it to login as contributor to the main site? For example, subsite-admin-A will have 2 roles:   1. admin to its subsite    2. contributor to the main site.


Check if a custom post type has already been created

I am creating a plugin that creates a new custom post type. How can I check if the custom post type has been created already (maybe by the user in functions.php for some other use)? Actually I would like to know what is the best way to go about it, maybe add a prefix to my custom post type to make it as unique as possible?


URL Rewrite Inconsistency Between WP Installs

My plugin registers multiple custom post types which are grouped under different types of business objects. URLs are rewritten in the form: nebfm/busines_object/post_slug/post_name. On my local WAMP setup everything is working properly. Urls are being rewritten in the proper form and are translated accurately and retrievE the appropriate posts. When I upload my code to the test server everything breaks. All the links for the CPT's return 404 errors. When I var_dump the contents of the request on the test server I get only a 404, which leads me to suspect its not recognizing any of the query variables. I'm really stumped. On both servers I have flushed the rewrite rules multiple times, so I'm fairly certain that's not the source of the issue. On the test server I can use WP default rewrite rules, so I assume the necessary Apache modules are installed. Both servers are running PHP 5.x


Importer failed to import posts as format "day and name"

I had a blog exposing posts as "day and name". After exporting that blog and importing it on a new installation of WordPress I can't see the posts in that format, only in the default one: http://blog.xxxxx.com/main/?p=123 Also moving to previous pages (http://blog.xxxxx.com/main/page/2/) does not work. Is this a known issue with a solution?


Display certain category in a page

Is there any way to display certain category name in a page via shortcode? **Edit:** I have plugin which displays posts in pages by shortcode `[display- post id=id of post]`. I would like to have similar plugin or I can say the same _plugin/shortcode_ with the only one different. The different is that it will display name of some category from categories. So my imagine is to have this shortcode `[category-name id=id of certain category]`.


how would I include some html in the header section of a wordpress plugin? I get an error

When I include some div into a plugin I am creating I get an error when activating the plugin. _"The plugin generated 33 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin."_ Though the plugin works on the site but I get an error when activating it. here is the plugin code. I want it to display the text on top of the page. I understand I need to use some hooks, but which one? hre is a link showing what I want. http://wsoplugins.com/wp-content/uploads/2012/04/Captur.png               <?php     /*     Plugin Name: test     Plugin URI:     Description: test     Author: Ronny Kibet     Author URI:      version: 1.0     */          ?>
hello there


Query Database and Return the result in translated pages

I am having a problem for a while now and I can´t seem to solve it on my own. I have made a website, this website is multilingual and it was made in wordpress. In my "photo album" page when I sort the items in the default language (English) everything works fine, however if I change to another translation (ex.french), the name of the category changes and the tagged items don't appear anymore. http://madebysylvie.be/collection In my database I manage to find the table and the rows of each category, I want to be able access it in a different language, each one has an unique ID. I know I have to grab the ID from the database of each category and return it to my PHP script. This is my code that prints the section,
     <?php         // Get the taxonomy         $terms = get_terms('filter', $args);         // set a count to the amount of categories in our taxonomy         $count = count($terms);          // set a count value to 0         $i=0;         // test if the count has any categories         if ($count > 0) {             // break each of the categories into individual elements             foreach ($terms as $term) {                 // increase the count by 1                 $i++;                 // rewrite the output for each category                 $term_list .= '
slug . '">' . $term->name . '
';                 // if count is equal to i then output blank                 if ($count != $i)                 {                     $term_list .= '';                 }                 else                  {                     $term_list .= '';                 }             }             // print out each of the categories in our new format             echo $term_list;         }     ?>      However I am not good enough to do this on my own, and I would be very happy if someone could help me out on this one. Thank you


Rewriting WordPress Gallery Shortcode with Bootstrap Carousel

In a recently personal theme project for publishing travel posts, I desired a slider-style image gallery rather than the standard column/list-style one WordPress uses out of the box. I like the look-and-feel of the Bootstrap Carousel, so my challenge was this: Is it possible to mash up the WordPress Gallery Shortcode with Bootstrap's Carousel? I've given my solution below, but would be interested to know what other people might suggest to improve the code and make it work better.


root-relative links for multiple parked domains

I have five domains pointing to the same server/wp installation. the domain names are important and my visitors need to be able to stay on their preferred domain as they surf through my site. how do I set up wp (or .htaccess or...) so that links all point to the domain/host specified by the visitor? right now, if I set Dashboard/General/Site Address to **site-A.com** , and I load the site as **site-B.com** , the links still point to **site-A.com** instead of **site-B.com** ; eg, load `http://site-B.com/blog/this-is-my- home/`. the links within the loaded page still point to **site-A.com** instead of **site-B.com**. in my old MT system, I was able to define all links as root-relative, so the links all pointed to the current domain. is this possible with WP? cheers,   Gregory


How to show all of aspecific post type that has taxonomy and a specific term

i have a post type called directory_listing, i have a taxonomy called 'place' and I have terms in that tax for place1 and place2. I need to display all the 'directory_listing' posts that use the term place2 of taxonomy 'place' in a custom page template. this is as far as i got, i am lost.               <?php     $pages = get_posts(array(       'post_type' => 'directory_listing',       'numberposts' => -1,       'tax_query' => array(         array(           'taxonomy' => 'place',           'field' => 'slug',           'terms' => ('place2'),           'include_children' => false         )       ))     );          foreach ($pages as $page) {           echo $pages->post_title . '
';           echo $pages->post_content . '
';           echo $pages->slug . '

';     }     ?>


How do i set the read more link?

I read the others on the site and i didnt find a working solution. I am using the 20-11 theme and i tried using `<--more-->` (in visual and html) with no luck, using excerpts and whatever i could find. Nothing work I am viewing the page from the root/homepage. How do i make the read more link with just a paragraph or two of text?


WordPress "Hide WP" Gives Me Error After Admin Login

I recently paid a freelancer to install a "hide WP" effect, which hides the fact that I am using WordPress. I specifically asked to install something with this effect: http://codecanyon.net/item/hide-my-wp-no-one-can-know-you-use- wordpress/4177158 My domain is http://www.catsbuzz.com. The freelancer did the installation, and going to catsbuzz.com/wp-admin gave a 404 error. And when I went to catsbuzz.com/administrator, I was able to log in and use the dashboard. I knew something was weird when my AdSense account got banned all of a sudden.. Today I went to catsbuzz.co/administrator to log in. The log in page works, but after I type the username/password and click "log in", it goes to a 404 page.. And going to catsbuzz.com/wp-admin or /wp-admin.php both gives 404 error. So now I am stuck, unable to go into my dashboard. Please help me.. I do not have any knowledge in solving this problem at all.. I am dealing with getting a refund, but meanwhile I really need to fix this error. I simply need to be able to log in to my WordPress dashboard, I don't care about the "Hide WP" effect anymore. Can please anyone help me? I thank anyone in advance.


root gets failed login on attempted theme installation via ftps

Outside of wordpress I can ftp with password and user name, root, and see the effects I expect. When from admin at wordpress I try to download and install a theme, it asks for credentials and if I give one user name and password pair I get "Failed to connect to FTP Server **___ ____**:22" When I give any other credentials it immediately gives "Failed to connect to FTP Server **___ ___**:21" I'm familiar with SFTP but have not worked with FTPS. What is the difference and what can I install on my ubuntu vps to work with wordpress? Or how can I ask wordpress to work with existing set up. Could you point me to any HOWTO's that will tell how to tunnel ftp securely over ssl? Thanks!


Why can't I call a (member) function from within a foreach?

I'm working with a plugin called media tags... The foreach looks as following (simplied as much as possible)               foreach($mediatags as $mediatag){      $args = 'media_tags=animals&numberposts=10&return_type=li&size=thumbnail';      $media_items = get_attachments_by_media_tags($args);      echo $media_items;     };      running the exact same code outisde a foreach:               $args = 'media_tags=animals&numberposts=10&return_type=li&size=thumbnail';      $media_items = get_attachments_by_media_tags($args);      echo $media_items;      Works great, but when I run it inside the foreach I get the followin error:               Call to a member function get_attachments_by_media_tags() on a non-object in /home/nuagency/dev.nuagency.se/wp-content/plugins/media-tags/mediatags_template_functions.php on line 128      Heading over to line 128 in that file I see:               function get_attachments_by_media_tags($args='')     {         global $mediatags;              return $mediatags->get_attachments_by_media_tags($args);     }


Need help to repair a 301 redirect problem

I have been having problems with my website and as a result did a Crawl test in SEOmoz. The test found a 301 Permanently Moved Redirect of all the pages on the website and it appears that they are redirected back to themselves? After completing a crawl of my website I found that there is this huge amount of what appears to be corrupted data added to the URL for each of these pages: https://www.getyourphotosoncanvas.com/%7Egetyouv4/%7Egetyouv4/contact-us.html 301 redirects to https://www.getyourphotosoncanvas.com/%7Egetyouv4/contact- us.html This is then followed by an long list of redirects each adding another line, e.g.: domain/7Egetyouv4/%7Egetyouv4/%7Egetyouv4/../%7Egetyouv4/%/contact- us.html This repeated part, `%7Egetyouv4`, goes on forever... I have shortened it for the post and removed the domain name to prevent a third link (post limit). I know this has got to be a problem. Bluehost support says that they show no 301 redirects, then that it might be a problem in the WP `xmlrpc.php` file? I am a novice at this can someone please tell me what all this means? Just to clarify, I did not set the redirects, don't need redirects, this just showed up without my knowledge. Some have suggested a hack? More importantly, can you tell me how to fix it?


Excerpt for each post type and for is_front_page

i try to adjust the excerpt for each post type and especially for the front page.               function isacustom_excerpt_length($length) {     global $post;     if (is_front_page() || is_home()){              if ($post->post_type == 'news')                 return 200;             else if ($post->post_type == 'projects')                 return 150;             else if ($post->post_type == 'term')                  return 75;              else                 return 80;     }else {           if ($post->post_type == 'news')                 return 20;             else if ($post->post_type == 'projects')                 return 80;             else if ($post->post_type == 'term')                  return 75;              else                 return 80;          }};   add_filter('excerpt_length', 'isacustom_excerpt_length');       The problem is that the if (is_front_page() || is_home()) is never true. thx for the help!!!


WP text styles not coming through to actual post

So Long story short, im working on a custom theme and wrapping the WP hooks onto said theme etc and i noticed that, When writing a post/page etc, that say for example i want to make a word bold/italic etc, That applied styles dont come through. So for example, say i select a word, click the "B" icon to make the word bold, its visually displays the word as bold on the editor but when i save and preview the page, the text is normal. There are no visible stylings on the word whatsoever. I also tried to go into the HTML pane, and apply the html tags manually like `<b></b>` or `<i></i>` etc and, the same thing, i save and preview page and the text appears as if no style was apply. Any ideas as to whats going on? Probably something im missing? Any Tips, links etc i humbly appreciate. Thanks in advanced. ***edit: this is my current wp post loop               <?php           while( have_posts() ) : the_post() ?>

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

<?php the_post(); ?>

<?php the_content(); ?>

     <?php endwhile; ?>


Cleaning up a Gravity Forms 'Checkbox' field tied to large taxonomy

I'm using Gravity forms to allow my users to create posts from the front end, but I'm having an issue making a certain form-function I'd like to have work and display nicely. Essentially, I want my users to be able to select multiple terms from a particular taxonomy... However this Taxonomy happens to be HUGE -- it has about 150 entries... AND it's hierarchical. When I set this up as a "Checkbox" type field and populate it from the taxonomy, it spits out a giant single list of all the terms. I can clean up some of the layout issues obviously, but I'd like to perhaps find a better solution that this overall. First off I want to hide the parent terms altogether, just the 2nd layer of terms are important. Secondly, while I could clean up the formatting a bit for the giant list of check-boxes, I'd rather have something where my users could perhaps select 1 term, and then have a little + button that when pressed, would add another field of the same type that would allow them to enter a 2nd, 3rd, 4th, 5th etc term from that taxonomy. I'm not exactly sure the best way to go about this however, any advice or suggestions would be greatly appreciated!


Jquery UI not working

I am trying to integrate the Jquery UI select menu ("dropdown" Style), in my wordpress site. But I am not able to do it, in widget area I created a select box and gave it respective ID of that css and jquery, but its not getting loaded with jquery. Here is my code, which I am using it to achieve:- The head part:-               <link rel="Stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-darkness/jquery-ui.css" type="text/css" />         <link rel="Stylesheet" href="<?php echo get_template_directory_uri(); ?>/ui.selectmenu.css" type="text/css" />         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>         <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>         <script type="text/javascript" src="<?php echo get_template_directory_uri(); ?>/js/ui.selectmenu.js"></script>         <style type="text/css">             /*demo styles*/             select,.ui-select-menu { float: left; margin-right: 10px; font-size: 62.5%;}             select, .ui-selectmenu { width: 200px; font-size: 62.5%; margin:10px;}             #cat{font-size: 62.5%;}              </style>         <script type="text/javascript">             JQuery(function(){                 JQuery('select#cat').selectmenu({style:'dropdown'});              });         </script>         <script type="text/javascript" src="http://ui.jquery.com/applications/themeroller/themeswitchertool/"></script>      The select menu appears with normal css, but the jquery is not working, I am bad in Jquery, so can any one help, I am using 2011 Theme, and you can check the selet menu on my site http://webstutorial.com/ Edited: `<script type="text/javascript"> jQuery.noConflict(); jQuery(function(){ jQuery('select#cat').selectmenu({style:'dropdown'});   }); </script>`


Conditional tag to check if 'page.php' is being used?

I'm trying to check whether the page.php template is being used or not. I've tried `is_page_template( 'page.php' )` but it doesn't work. I also can't use `is_page()` because I only want to do something when `page.php` is used, and not when some other custom Page template is used. Please let me know about this and thanks! **Edit:** Should have mentioned earlier that I have a file called `common- options.php` which is getting included in almost all the templates (like `index.php`, `page.php`, `single.php` and `page_blog.php`), in this file I'm trying to do the check with the following code:               if ( is_page_template( 'page.php' ) ) {         echo "success!";     }      But it's not working when I open a page that is using the "Default Template".


Copy a Taxonomy Term into the Post Title for a certain Custom Post Type

I am using Gravity Forms to allow users to create posts from the front end. However, the way this site I am building is going to work, one specific Post_Type is essentially just a "Data" post. There is a specific Taxonomy who's Terms are actually the "Title" of the data set. I have already figured out a way to hide the "Title" field in Gravity forms but still have it present on the form (for some reason they lock the "Post_Type" and "Post Status" into the 'Title' field in the GUI, so I overloaded it's conditional logic to force it to always hide). I want to create a filter that would always copy the [Term] value for a specific [Taxonomy] into the [Title] field of a specific [Post_Type]. Any advice I could get on how to accomplish this would be great! Thanks in advance! ============================================================== OK, using code from @Manny Fleurmond below, and from this post: Title_save_pre - Simple problem that u know for sure I came up with               function taxonomy_title_rename($title) {         global $post;         $type = get_post_type($post->ID);         if ($type== 'CUSTOM_POST_TYPE') {                 if($post->post_type === 'CUSTOM_POST_TYPE') {             $terms = wp_get_object_terms($post->ID, 'MY_TAXONOMY');             if(!is_wp_error($terms) && !empty($terms)) {                 $title = $terms[0]->name;             }             }         return $title;     }          else if ($type != 'CUSTOM_POST_TYPE') {            return $title;         }         }         add_filter ('title_save_pre','taxonomy_title_rename');      This is actually saving the post title to the post from the taxonomy. However, it is not then pulling it into the permalink as well, my permalink is just the post ID number. Will see if I can get this solved on my own, but any help would be appreciated!


Folder Permissions + Security Concerns

I messed up bad guys. I while working on another part of my website I accidentally nuked my WordPress folder permissions. I was able to find/fix some problems and I got my site up and running but some features like posting from the app or working with themes is still broken. Is there a way to reset all of the folder permission to default. I'm really worried that my site is at risk right now with the messed up folder permissions. What are some things to check as far as security to make sure I haven't been compromised.


Style sub categories differently from its parent category

I am new to wordpress and to this website. I've been searching for a solution to my problem. I found this code that solved my problem, but unfortunately I can't style the sub categories differently from the parent category. Im not a php coder, can anyone show me how? I want something like this

Category 1

Description of the Category1

Sub Category link 1

Sub Category link 2

Sub Category link 3

Category 2

Description of the Category2

Sub Category link 1

Sub Category link 2

Sub Category link 3

Category 3

Description of the Category3

Sub Category link 1

Sub Category link 2

Sub Category link 3

      Here is the code I'm using, got it from here               <?php      if (is_category()) {     $this_category = get_category($cat);     if (get_category_children($this_category->cat_ID) != "") {         echo '

';         $childcategories = get_categories(array(             'orderyby' => 'name',             'hide_empty' => false,             'child_of' => $this_category->cat_ID             ));         foreach($childcategories as $category) {             echo 'term_id ) . '" title="' .     sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category-    >name.'';             echo '
'.$category->description.'
';         }         echo '

';     }     }     ?>      **EDIT** Here is my complete code               <?php get_header(); ?>
     <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('
','
');} ?>

<?php single_cat_title( '', true ); ?>
         <?php              if (is_category()) {                 $this_category = get_category($cat);                 if (get_category_children($this_category->cat_ID) != "") {                  echo '

';                     $childcategories = get_categories(array(                       'orderyby' => 'name',                        'hide_empty' => false,                        'child_of' => $this_category->cat_ID                        ));                       foreach($childcategories as $category) {                       echo 'cat_ID . '.jpg" alt="' . $category->cat_name . '"  />';                       echo 'term_id  ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' .  $category->      name.'';                              echo '
'.$category->description.'
';                  }                  echo '

';              }             }             ?>

<?php get_sidebar(); ?>

     <?php get_footer(); ?>      and this is the output Actually I need to put an image in the parent category and under the parent a list of sub category links.


URL rewrite for custom taxonomies

I wish you guys can help me, here is the setup i have in my real estate theme and what i would like to achieve. I have a custom post called properties and inside the custom post I have custom taxonomies each with a whole bunch of terms. Custom Post – Property Custom Taxonomy – Type (and the terms are – houses, apartments, commercial, etc.) Custom Taxonomy – Action (and the terms are – for sale, for rent) Custom Taxonomy – City (and the terms are – São Paulo, Osasco, Barueri, etc…) Custom Taxonomy – Neighborhood (and the terms are – São Francisco, Pinheiros, Morumbi, etc…) Custom Taxonomy – Condominiums (and the terms are – Golf Life, Condessa, Jardins Brasil, etc…) The main 3 custom taxonomies are City, Neighborhood and Condominiums and the way the hyperlink for the properties I have inside each term is showed this way. Custom Taxonomy – City => mysite.com.br/osasco Custom Taxonomy – Neighborhood => mysite.com.br/sao-francisco Custom Taxonomy – Condominiums => mysite.com.br/golf-life In reality, Golf Life is a condominium in the neighborhood of Vila São Francisco in the city of Osasco. What I have been trying to do for a while is to get the hyperlinks of the custom taxonomies to show like this. Custom Taxonomy – Condominiums => mysite.com.br/Osasco/sao-francisco/golf-life So that when someone clicks on a link in my website with the name Golf Life, it takes them to all properties I have listed under that condominium, and on the same note; Custom Taxonomy – neighborhood => mysite.com.br/Osasco/sao-francisco/ So that when someone clicks on a link in my website with the name São Francisco, it takes them to all properties I have listed under that neighborhood. Could you guys give me a hand on how to set up the rewrite rule? Thanks This is the code i have now               add_action('init', 'create_property_type');          function create_property_type() {         register_post_type('estate_property', array(             'labels' => array(                 'name'                  => __('Properties','wpestate'),                 'singular_name'         => __('Property','wpestate'),                 'add_new'               => __('Add New Property','wpestate'),                 'add_new_item'          => __('Add Property','wpestate'),                 'edit'                  => __('Edit','wpestate'),                 'edit_item'             => __('Edit Property','wpestate'),                 'new_item'              => __('New Property','wpestate'),                 'view'                  => __('View','wpestate'),                 'view_item'             => __('View Property','wpestate'),                 'search_items'          => __('Search Property','wpestate'),                 'not_found'             => __('No Properties found','wpestate'),                 'hierarchical' => true,                 'not_found_in_trash'    => __('No Properties found in Trash','wpestate'),                 'parent'                => __('Parent Property','wpestate')             ),             'public' => true,             'has_archive' => true,             'rewrite' => array(                 'slug' => '',                 'with_front' => FALSE,             ),             'supports' => array('title', 'editor', 'thumbnail', 'comments'),             'can_export' => true,             'register_meta_box_cb' => 'add_property_metaboxes',             'menu_icon'=>get_template_directory_uri().'/images/properties.png'              )         );                    // add custom taxonomy     register_taxonomy('property_category', 'estate_property', array(         'labels' => array(             'name'              => __('Categories','wpestate'),             'add_new_item'      => __('Add New Property Category','wpestate'),             'new_item_name'     => __('New Property Category','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => array('slug' => ''),         'with_front' => false,         )     );               // add custom taxonomy     register_taxonomy('property_action_category', 'estate_property', array(         'labels' => array(             'name'              => __('Action','wpestate'),             'add_new_item'      => __('Add New Action','wpestate'),             'new_item_name'     => __('New Action','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => array('slug' => ''),         'with_front' => false,        )          );               // add custom taxonomy     register_taxonomy('property_city', 'estate_property', array(         'labels' => array(             'name'              => __('City','wpestate'),             'add_new_item'      => __('Add New City','wpestate'),             'new_item_name'     => __('New City','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => array('slug' => 'cidade'),         'with_front' => false,         )     );               // add custom taxonomy     register_taxonomy('property_area', 'estate_property', array(         'labels' => array(             'name'              => __( 'Neighborhood / Area','wpestate'),             'add_new_item'      => __( 'Add New Neighborhood / Area','wpestate'),             'new_item_name'     => __( 'New Neighborhood / Area','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => array('hierarchical' => true,'slug' => '', 'with_front' => true),         'with_front' => false,          )     );          // add custom taxonomy     register_taxonomy('property_condominio', 'estate_property', array(         'labels' => array(             'name'              => __( 'Condomínio','wpestate'),             'add_new_item'      => __( 'Adcione novo Condomínio','wpestate'),             'new_item_name'     => __( 'Novo Condomínio','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => array('hierarchical' => true, slug => 'condominio'),         'with_front' => false,          )     );          // add custom taxonomy     register_taxonomy('property_zona', 'estate_property', array(         'labels' => array(             'name'              => __( 'Zona de São Paulo','wpestate'),             'add_new_item'      => __( 'Adicione zona','wpestate'),             'new_item_name'     => __( 'Nova Zona','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => true,         'with_front' => false,          )     );          // add custom taxonomy     register_taxonomy('property_construtora', 'estate_property', array(         'labels' => array(             'name'              => __( 'Construtoras','wpestate'),             'add_new_item'      => __( 'Adicione Construtora','wpestate'),             'new_item_name'     => __( 'Nova Construtora','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => true,         'with_front' => false,          )     );          // add custom taxonomy     register_taxonomy('property_fase', 'estate_property', array(         'labels' => array(             'name'              => __( 'Fase','wpestate'),             'add_new_item'      => __( 'Adicione fase','wpestate'),             'new_item_name'     => __( 'Nova fase','wpestate')         ),         'hierarchical' => true,         'query_var' => true,         'rewrite' => true,         'with_front' => false,          )     );               }


How to modify an existing meta description?

I'm coding a plugin that allows me to dynamically insert content for my meta description and title. The content is already being pulled fine, the only part I can't get to work is actually filtering the meta description. I was able to get the title working like this:               add_filter( 'wp_title', 'filter_wp_title');     function filter_wp_title( $title ){         $title = wpg_modules($title);         return( $title );     }      where wpg_modules() returns the content to use for the title. But I can't find an equivalent way to do this for the meta description, presumably because WP doesn't just always have one unless your theme or another plugin does. Please note the above code works perfectly and is _not_ what I need help with, I merely provided it as an example of filtering the title that works fine. So, how can I filter an _existing_ meta description, if present?


Changing where "posted on" text is located in TwentyEleven?

In TwentyEleven the "posted on" text is well above the title. I want it to replace the "posted in category" text. Is there a php file that populates the page where I can just edit where this stuff pops out? I checked my `pages.php` file but I couldn't seem to figure out what to change.


Register form how to get Total Control of it

thanks for reading. I'd like to take total control of how the registrations are done on my new site. I want the new user to write his own password, and fill different fields. Display my own errors and messages, etc.. Can you point me in the right direction? All I'm finding are plugins that use short codes, that aren't even close enough to what I'm trying to achieve.


Blog has an infinite redirect loop

Why is http://compassionpit.com/blog/ going through an infinite redirect loop? Here's my nginx conf file. The site is run by a nodejs server on port 8000 and Apache serves up the blog (wordpress) and the forum (phpBB). The forum is resolving just fine, at http://www.compassionpit.com/forum/ ... > This webpage has a redirect loop The webpage at > http://www.compassionpit.com/blog/ has resulted in too many redirects. > Clearing your cookies for this site or allowing third-party cookies may fix > the problem. If not, it is possibly a server configuration issue and not a > problem with your computer.               server {         listen          80;         server_name     www.compassionpit.org;         rewrite         ^/(.*) http://www.compassionpit.com/$1  permanent;     }               server {         listen       80;                # your server's public IP address         server_name  www.compassionpit.com;         index        index.php index.html;              location ~ ^/$ {             proxy_pass http://127.0.0.1:8000;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header Host $host;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         }              location @blogphp {             internal;             root /opt/blog/;             include fastcgi_params;             fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;             fastcgi_index  index.php;             fastcgi_pass   127.0.0.1:8080;         }              location ~ ^/(forum|blog)/($|.*\.php) {             root /opt/;             include fastcgi_params;             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;             fastcgi_index  index.php;             fastcgi_pass   127.0.0.1:8080;         }              location ~ ^/(forum|blog) {             root /opt/;             try_files $uri $uri/ @blogphp;         }              location ~ ^/(forum|blog)/ {            root /opt/;         }                   location @backend {             internal;             proxy_pass http://127.0.0.1:8000;             proxy_set_header X-Real-IP $remote_addr;             proxy_set_header Host $host;             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;         }              location ~ / {             root /opt/chat/static/;             try_files $uri $uri/ @backend;         }          }


how to associate several authors to a custom post type

I have a "product" post type, to which i would like to associate several users according to their (custom) roles ( "designer", "producer"). They will be able to create (but not publish), edit and submit each product for deletion. More or less like the default "contributor" role, really. I fail to understand where to start to make this association between a custom post type and a user possible?


How to disable monthly archive

Is there a way to disable archives pages, specifically monthly archives?


Add posts from a category to menu with all posts in it as sub menu

Because there is no category option on pages I desided to add post category to main nav. I added the category and added posts on it but it doesn't dsplays the sub category on menu. what should I do to make it work? Another thing is If I am inside one of the post/page of a category I want to display all the page / post menu on left side bar. Thanks in advance


How to update all permalinks in site

So my client has changed all the titles of pages and posts... but the permalinks have not changed from the original title. I have tried changing the permalink configuration, but when I go back to the `Post Name` option the permalinks haven't changed. Is there a way to update all permalinks without messing with the database?


Restrict Access to wp-login.php

I have a hard coded login/register/lost password form in the sidebar of my theme. I am using hidden input for "redirect_to" which is working fine. But when I press login button without entering anything or specifically when an error occurs, it redirects to wp-login.php page. I dont want this to happen. If an error occurs it should show in the current place. How can i do this. Note: Same is required for the logout function. Basically, I dont want to show wp-login.php page at any cost to anyone.


How to order get_term_children output by alphabetic order

The following creates drop-down lists of my custom taxonomy children, but the order of the output seems to by creation date, not by alphabetical name. I tried adding orderby to the array with no success. I've read about usort but am not sure how to implement it. I'd appreciate any help.               $term_id = 61;     $taxonomy_name = 'tribe_events_cat';     $termchildren = get_term_children( $term_id, $taxonomy_name );          echo "<script type='text/javascript'>function taclinkch(x){var y=document.getElementById(x).value;document.location.href=y}</script>";     echo "<form action=''>  <select name='eventcats' id='eventcats'   onchange='taclinkch(this.id)'>";          echo "<option value=''>Select a Topic</option>";          foreach ( $termchildren as $child ) {         $term = get_term_by( 'id', $child, $taxonomy_name );              echo "<option value='" .  get_site_url() . "/events/category/". $term->slug." '>" . $term->name . "</option>";     }          echo "</select></form>";      I added this array, which didn't work:               foreach ( $termchildren as $child ) {          $term = get_term_by(              'id',              $child,              $taxonomy_name,              array(                  'orderby' => 'name',                 'hide_empty' => 0             )          );     }


Wordpress automatically adds <pre> tags when pasting code, how to stop it?

I am presently learning PHP and Linux simultaneously. And I want to blog my notes not only for my future reference, but also because it could help others. I just noticed an issue with Wordpress - - it automatically adds `<pre></pre>` tags in the background (HTML-side I mean, in the visual editor I see the code's background highlighted) as soon as I paste some code, be it HTML, PHP etc. I have searched a lot, and could find nothing about this. Looks like nobody thinks this as an issue, or it's something too easy to resolve. Either way, I am on the other side of things. So, please help me out. I want Wordpress to stop highlighting the code like that. I Just want it to keep whatever I paste as it is.


Customize the upload screen

I would need to simplify the "upload new image" interface for our Authors : basically, hide a few fields that will only confuse my wordpress "authors" (like the "Description" and "Alt" text inputs). Administrators and Editors need to see these, though. How can i implement that hiding/showing inputs according to the user's priviledges?


Some rogue WordPress plugin killing my server - how do I isolate and kill it?

Every so often my VPS server becomes unresponsive for no obvious reason. CPU usage is flat. No spike in traffic etc. When I run a top command on the machine (Centos) I can see that one of my sites has spawned loads of apache/httpd processes and is consuming the available RAM - yet there is virtually no traffic on the box. I had a plugin installed that would backup the site every day (EZPZ backup: http://wordpress.org/extend/plugins/ezpz-one-click-backup/). I had a nose through the source and I could see it added a number of WP Cron jobs to execute daily backups. I suspect this is the root cause of the issue but are there any good tools that help to monitor which php scripts are killing my machine when/if it happens again. (i.e is there a logging tool I can switch on to log slow or long loading php processes??). I've since uninstalled the plugin and can see it has hooks to remove the WP Cron jobs it installed. Is there somewhere in the DB i can check WP Cron jobs to ensure they've definitely been removed? Thanks, Ed


Walker only returns one child page

I'm trying to create a menu on a page showing all of its sub-pages. I want to add an image to the link so I'm using a walker to edit the output of wp_list_pages. But when I call the walker only the first sub-page is returned. In functions.php I have the following code:               function list_product_pages() {        global $post;        $walker = new Walker_Product_Menu();       $childpages = wp_list_pages( array(          'sort_column'=> 'menu_order',         'title_li'=>'',         'child_of'=> $post->ID,         'echo'=>0         ,'walker' => $walker                 ));       return '
' . $childpages . '
';     }          class Walker_Product_Menu extends Walker {     function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id  = 0 ) {       $output .= $indent .         sprintf("

%s

",         get_permalink($object->id) ,         strtolower(str_replace(" ", "-", $object->post_title)),         $object->post_title          );       }     }      And in the template for the page I call it like this:               <?php echo list_product_pages(); ?>      When I remove the walker all child pages are returned. I turned on debugging and these errors appear: Warning: Illegal offset type in \wp-includes\class-wp-walker.php on line 215 Warning: Illegal offset type in \wp-includes\class-wp-walker.php on line 233 Which are both:               $children_elements[ $e->$parent_field ][] = $e;


Retrieving links and names of images from a NextGEN gallery

I want to add a list (like a cd track list) of names and links to all images next my nextgen gallery, how can I retrieve this list? (similar to the list in the select object in the Gallery Settings, in the gallery admin page)


Force redirect single.php to index

I want to make a force redirect for single.php to index so that it is never reachable by direct access (the site is built in a way that you retrieve all the content on the index page, still need to have this page available though because of an ajax function). I assume this is done in .htaccess? Edit: I need to be able to access the single.php through an ajax request from the index page, i.e. the redirect should only occur upon direct url access.


Is wp-content/install.php a Drop-in?

I cannot find documentation or discussions on what is and how to use Drop-in plugins.   The question was raised in this Q&A, Populate content on install. _Is a`wp-content/install.php` file that redefines the pluggable function `wp_install_defaults` a Drop-in plugin or not?_ # My research results The following list is from hakre's article _(which seems to be the origin of all other copies in the interwebs)_.               File                Type of Plugin                          Loaded                          Context     advanced-cache.php  Advanced caching plugin.                on WP_CACHE value               Single     db.php              Custom database class                   always                          Single     db-error.php        Custom database error message           on error                        Single     install.php         Custom install script                   on install                      Single     maintenance.php     Custom maintenance message              on maintenance                  Single     object-cache.php    External object cache                   always                          Single     sunrise.php         Executed before Multisite is loaded     on SUNRISE value                Multi     blog-deleted.php    Custom blog deleted message             on deleted blog                 Multi     blog-inactive.php   Custom blog inactive message            on inactive blog                Multi     blog-suspended.php  Custom blog suspended message           on archived or spammed blog     Multi          Source: Data taken from global function _get_dropins() in wp-admin/includes/plugin.php.      * * * In the Codex a Drop-in is defined as: > The concrete PHP-file * * * At first, there's nothing on [wp-hackers] list. And searching for "drop-in + wordcamp" I've only found this of relevance _my emphasis_ : > One of the great strengths of WordPress is its plugin system. In the > upcoming 2.1 release, **_there is very little you can’t do as a drop-in > plugin_**. This makes it easy to use WordPress as a CMS and keep your > customizations separate from the main codeline; which in turn simplifies > upgrades and maintenance.


Is it possible to set individual shipping prices in Woocommerce?

I currently have a store running on Bigcommerce, but unfortunately it doesn't offer the functionality that I require. I am debating whether to use a magento/wordpress install or wordpress/woocommerce. Does anybody out there know if it is possible with woocommerce (or additional plugins) to perform the following: Set an individual item with a fixed shipping price to different regions/countries. Offer a free shipping option on orders of a particular item over a given amount. I believe this would possible with magento, but it appears to be a quite heavy weight option for a wordpress blog/ e-commerce store. Thanks in advance for any assistance with the above.


Inserting images in multiple posts native gallery

I am trying to find a solution to a problem that Wordpress seems to lack. Here is a scenario: I have uploaded images to a post using the native gallery to display the images. These images then appear under the gallery tab within the upload/insert and they will appear on the post. Works perfectly. Further down the line I create a new post, I want to include images from my Media Library into the gallery without re-uploading the same images again. I expected to find, "Insert into gallery", next to "Insert into post", but there doesn't seem to be a way of doing this. Is there a solution to this? I have done a lot of theme development in the past, but amazed at there isn't a simple solution to this problem. I would be grateful for any help.


Hide sub domain created for local CDN

Not sure if my question would make sense or not. I have created a sub-domain to store some of my static files (like images). So, some images now load from **http://imgs.example.com/imagefilename.png** Now, the problem is, all the files stored under this sub domain http://imgs.example.com/ are publicly visible which I want to hide or redirect or show 404. Any idea how to achieve this? Currently files in the subdomain shows -- **Index of /**   * cgi-bin/    * onevideofile.mp4   * oneimagefile.png _Apache Server at imgs.iconicwebteam.com Port 80_


Display two custom values from a post

I'm using the following code to display a custom value. The custom value being 'website'               <?php       $custom_fields = get_post_custom($post_id); //Current post id       $my_custom_field = $custom_fields['website']; //key name       foreach ( $my_custom_field as $key => $value )       echo $key . " => Click Here
";     ?>      However, before the 'Click here' i'd like to include another custom value, thumb. So the output would be:               Value of custom field thumb     Value of custom field website      Thanks.


which is this plugin ?

can somebody tell me which is this plugin used in comment rating ? http://goo.gl/AWxl5 see on comment thanks in advance


Exclude Child Posts from WP_Query

How can I exclude child posts using wp_query? Given the following architecture:   * parent 1      * child 1     * child 2   * parent 2      * child 3     * child 4 I'd like to only return parent 1 and parent 2, and exclude child 1, 2, 3 and 4. I've searched high and low for an answer to this question. Nothing surfaces.


How do I fill the Home Description?

For some reason All in One Seo is not putting the text that I put in the Home Description field if you google, dvdripfreemoviedownloads.com, the first result, which is my homepage should have something else under the Home Description? Anyone know how I can fix this will All in One SEO If anything I'd like to imput the Home Description manually. I heard that it can be done by inputting that in the header.php, How do I do it manually? below is my header.php                   <?php     // Press75.com     ?>     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">                                           <title>         <?php if ( is_home() ) { ?><?php bloginfo('name'); ?> | <?php bloginfo('description'); ?><?php } ?>         <?php if ( is_search() ) { ?><?php bloginfo('name'); ?> | Search Results<?php } ?>         <?php if ( is_author() ) { ?><?php bloginfo('name'); ?> | Author Archives<?php } ?>         <?php if ( is_single() ) { ?><?php wp_title(''); ?> | <?php bloginfo('name'); ?><?php } ?>         <?php if ( is_page() ) { ?><?php bloginfo('name'); ?> | <?php wp_title(''); ?><?php } ?>         <?php if ( is_category() ) { ?><?php bloginfo('name'); ?> | Archive | <?php single_cat_title(); ?><?php } ?>         <?php if ( is_month() ) { ?><?php bloginfo('name'); ?> | Archive | <?php the_time('F'); ?><?php } ?>         <?php if (function_exists('is_tag')) { if ( is_tag() ) { ?><?php bloginfo('name'); ?> | Tag Archive | <?php  single_tag_title("", true); } } ?>         </title>                       <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />         <?php if (is_single() || is_page() ) : if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>         <meta name="description" content="<?php the_excerpt_rss(); ?>" />         <?php endwhile; endif; elseif(is_home()) : ?>         <meta name="description" content="<?php bloginfo('description'); ?>" />         <?php endif; ?>                       <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />         <link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.css3.css" type="text/css" media="screen" />                                                   <link rel='stylesheet' type='text/css' href="<?php bloginfo('url'); ?>/?sf-custom-content=css" />                       <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />         <link rel="shortcut icon" href="<?php bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />              <?php if (is_singular() && get_option('thread_comments')) wp_enqueue_script('comment-reply'); ?>              <?php wp_head(); ?>              <?php if (get_option(THEME_PREFIX . "analytics_code")) { ?>             <?php echo get_option(THEME_PREFIX . "analytics_code"); ?>         <?php } ?>

                 <?php if (get_option(THEME_PREFIX . "header_ad")) { ?>
                     <?php echo ($header_ad = get_option(THEME_PREFIX . 'header_ad')); ?>
                 <?php } ?>
                 <?php if (get_option(THEME_PREFIX . "logo_txt")) : ?>
<a href="<?php echo get_option('home'); ?>/" title="Home" ><?php echo get_option(THEME_PREFIX . "logo_txt"); ?>
                 <?php else : ?>                     <a href="<?php echo get_option('home'); ?>/" title="Home" ><img class="fade" src="<?php echo ($logo = get_option(THEME_PREFIX . 'logo_img')) ? $logo : get_bloginfo("template_url") . "/images/logo.png"; ?>" alt="<?php bloginfo('name'); ?>" />                 <?php endif; ?>

                         <?php include('searchform.php'); ?>

             <div class="navigation-inside<?php if (is_home()){echo ' navigation-video';}?><?php if (get_post_meta($post->ID, "_videoembed", true) || get_post_meta($post->ID, "_videoembed_manual", true)){echo ' navigation-video';}?><?php if (is_category()){echo ' navigation-category';}?>">                 <?php if (get_option(THEME_PREFIX . "menu_management")) : ?>                 <?php wp_nav_menu(array('sort_column' => 'menu_order', 'container_class' => 'menu-header')); ?>                 <?php else : ?>
                     <li <?php if (is_home()) { echo 'class=""'; } ?>><a href="<?php echo get_option('home'); ?>/" title="Home">Home
                          <?php wp_list_categories('title_li='); ?>                          <?php wp_list_pages('title_li='); ?>
<a href="<?php bloginfo('rss2_url'); ?>" title="Subscribe via RSS">Subscribe
                          <?php if (get_option(THEME_PREFIX . "twitter_link")) { ?>
<a href="http://twitter.com/<?php echo get_option(THEME_PREFIX . "twitter_link"); ?>" title="Twitter.com">Twitter
                     <?php } ?>
                 <?php endif; ?>

        * * * Yes I know where the Home Description goes in All in one seo. I've used it on my other sites but there's something up with this theme I think But can someone tell me how to input this manually in the header.php please?


add_rewrite_rule not working

I'm trying to do some url rewriting. I've picked this example right off the wordpress wiki here:               add_rewrite_rule('^nutrition/([^/]*)/([^/]*)/?','index.php?foo=bar','top');      The wiki page says: > This example would match a requested URL like this: > example.com/nutrition/milkshakes/strawberry/ ...and interpret it to actually > mean...   >  example.com/index.php?page_id=12&food=milkshake&variety=strawberry (I've simplified it to redirect to index.php?foo=bar ). However, I'm still getting a 404 error when I try to visit `http://localhost/myblog/nutrition/milkshakes/strawberry/`. What am I doing wrong?


Wordpress custom login page

I found a little article on how to create a custom Wordpress Login page and I am wondering if this technique/practice is safe to use? The article: http://blog.caercam.org/2012/09/21/wordpress-login-page-complete- redesign/ I have tried this technique but the **Logout** function stopped working in wordpress and if i write the wrong account username or password and click **login** it redirects me to the old **login** page is there a way to fix these problems? I am using all the same code as in the article.


Placement of categories

I have installed the zAlive theme onto my domain, and it has four tabs at the top on a slidebar. I was wanting to have these tabs in the slidebar, be linked to my different categories, but I'm not sure how to do this. My hopes are to have it so that as you select different tabs from the slidebar, the corresponding posts in each category with show underneath. Any help on this would be appreciated.


What is a "protected" post status?

I noticed in the `register_post_status` function in core that there is an arg for 'protected'. The following post statuses: 'future', 'draft', and 'pending' all have this set to **true**. I'm not talking about a protected 'post' but the 'protected' argument used when registering a custom `post_status`. What does this 'protected' status do? And why would I make a custom post status protected?


Removing base slug from hierarchical custom post type

I have a hierarchical custom post type called "state". My goal is to have a permalink structure like thus: http://website.com/idaho/ http://website.com/idaho/sub-page I'm _close_ but haven't quite figured it out. Here's the code I'm using: **First, I remove the slug**               public function remove_slugs( $permalink, $post, $leavename ) {                 $url_components = parse_url( $permalink );           $post_path = $url_components['path'];           $post_name = end( explode( '/', trim( $post_path, '/' ) ) );                if( !empty( $post_name )) {                  switch($post->post_type) {                    case 'state':                      if( $post->post_parent ) {                          $parent = get_post( $post->post_parent );                     $parent = $parent->post_name;                          $permalink = str_replace( $post_path, '/' . $parent . '/' . $post_name . '/', $permalink );                      } else {                           $permalink = str_replace( $post_path, '/' . $post_name . '/', $permalink );                 }                      break;                  }                }                return $permalink;              }      This is hooked into `post_type_link`. **Next, I reset the query variables so WordPress knows we're dealing with a CPT**                   public function parse_custom_post_type( $query ) {                  if ( ! $query->is_main_query() ) return;             if ( count( $query->query ) != 2 || ! isset( $query->query['page'] ) ) return;                  // Are we dealing with a page?             if ( ! empty( $query->query['pagename'] ) && ! is_home() ) {                      // If the page doesn't exist, we must be dealing with a state                 if ( ! is_page( $query->query['pagename'] ) ) {                     $query->set( 'name', $query->query['pagename'] );                     $query->set( 'state', $query->query['pagename'] );                     $query->set( 'post_type', 'state' );                     $query->is_page = 0;                     $query->is_single = 1;                     unset( $query->query_vars['page'] );                     unset( $query->query_vars['pagename'] );                     unset( $query->query['page'] );                     unset( $query->query['pagename'] );                 }             }              }      This is hooked into it `pre_get_posts`. So, the level _one_ pages work, but not the subpages. The URLs resolve and then hit a 404. What do I need to do to get this working?


Custom fields in post later used in loop

How i can add custom fields to custom post templates, and later print them in The Loop? Better explanation: I want to have a custom field in "Add New" window, which will be added as some meta data to the post, which can be later printed in the loop of single.php. I want to be able to decide where it will be, so it can be even under comments if i want to (i want to define it in template). I dont want "Custom Field Template" plugin because AFAIK this cannot be used inside the loop.


Passing variables to new page

I'm trying to pass the variables to a new page, I made a function in my theme to get the results. Now when I use `yelplist();` on the front page of my theme it gets the results and when i click on the link it passes the image and city back to me as requested. **Questions:**   * However I am wondering what i can do to have variables pass to their own page. For example: if I click on the name, a new page comes with the results of an image and a city for that link.    * Also is it possible to have it done in the single.php file, or will it be a completely new page/file? **Update 1** *I've made a little bit of progress using $_SESSIONS, I am now able to pass the variables into the single.php file however, when I click on the link thats suppose to grab the results from the current link it does not update the variables that are in the single.php file, instead its only getting the last parsed link's info instead of the one I am clicking on. Also when I click on the link at the bottom and make it try to go to the single.php file I get a object not found `<a href='single.php?p=$pizza_url'><img border=0 src='".$business->photo_url."'></a>` what can I do to make it go to the single page and update the variables? this is what I have in my functions file.               function yelplist(){          require_once ('/lib/OAuth.php');      require_once ('yelp.php');      require_once(ABSPATH.'/wp-admin/includes/taxonomy.php');          $yelpstring = file_get_contents('http://api.yelp.com/business_review_search?term=pizza&location=Los%20Angeles&ywsid=xxxxxxxxxxxxxxxxxxx');     $obj = json_decode($yelpstring);                  foreach($obj->businesses as $business):                 $business->photo_url;                 $pizza_name = $business->url;                 $business->name;                 $business->phone;                 $city = $business->city;                      $url = ''.$business->url.'';                 $pizza = parse_url($url, PHP_URL_PATH);                 $pizza_url = trim(''.$pizza.'','/biz');                 $lower_case_city_url = $city;                 $lower_case_city_url = strtolower($lower_case_city_url);                 $city_url = str_replace(' ','-',$lower_case_city_url);                      if(isset($_SESSION['p']) && $_SESSION['p']==''.$pizza_url.'') {                      $_SESSION['pizza_name']= $business->name;                  $_SESSION['pizza_city']= $city = $business->city;                  $_SESSION['pizza_phone']= $business->phone;                 $_SESSION['pizza_photo'] = $business->photo_url;                  }else{                  echo "
$business->name
";                 }             endforeach;             }      this is what im using in the single.php file to grab the results.               <?php session_start(); ?>     <?php echo $_SESSION['pizza_name']; ?>
     <?php echo $_SESSION['pizza_phone']; ?>
     <?php echo $_SESSION['pizza_city']; ?>
     <?php echo ""; ?>      Thanks


How do I embed a YouTube video in WordPress 3.0?

I've upgraded to version 3.0. My site is wordswithfriends.net My administration panel looks like the following ![Add New Post screenshot with toolbar](http://dl.dropbox.com/u/12337149/wp.png) I thought there was supposed to be a special YouTube button which I don't seem to have. Adding media asks for URL + text and I just get a link not embedding.


Switching to child theme breaks menu names

When I switch to the child theme I am working on, the main menu uses the page names instead of the names that I gave it in the Appearance > Menu options. Happened to anyone else?


woocommerce retriving category name as div class?

I am trying to retrieve the category name of a WooCommerce product displayed in a WordPress loop and use it as the class for an `li` (also inside the loop). I've tried this:

         <?php while (have_posts()) : the_post(); ?>                  <li class="<?php echo $product->get_categories(); ?> box">                 <a href="<?php the_permalink(); ?>"><?php echo the_post_thumbnail(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
                 <a href="<?php the_permalink(); ?>"><span href="<?php the_permalink(); ?> " class="amount price" data-original="<?php echo get_woocommerce_currency(); ?><?php echo $product->get_price(); ?>" data-price="<?php echo $product->get_price(); ?>" title="Original price: <?php echo $product->get_price(); ?>"><?php echo get_woocommerce_currency(); ?><?php echo $product->get_price(); ?>                 <a href="<?php the_permalink(); ?>?add-to-cart=<?php echo $post->ID ?>" class="pbutton">Add to Cart
         <?php endwhile; ?>
      This is the part where I'm trying to retrieve:               <li class="<?php echo $product->get_categories(); ?> box">      but it just outputs this:
      which not only doesn't retrieve the category but also screws with the markup, breaking the loop. I've also tried this: `<li <?php post_class('box'); ?>` but because WooCommerce uses taxonomies, it retrieves the tags but not the product category. This question is a follow up on this.


how to query posts and auto assign category if post title has keyword

how can i query posts by current date and auto assign category based on keyword found on post title, something like if title contains 'oranges' auto assign it 'oranges' category maybe something like this which can go to functions.php               function add_category_automatically($post_ID) {     global $wpdb,$post;             $today = getdate();        $query = new WP_Query( 'year=' . $today["year"] . '&monthnum=' . $today["mon"] .'&day=' . $today["mday"] );     while ( $the_query->have_posts() ) : $the_query->the_post();            $post_title = get_the_title();        if (stripos($post_title, 'oranges')!==false) {         $cat = array(8);         wp_set_object_terms($post_ID, $cat, 'category');     }      endwhile;     }      add_action('publish_post', 'add_category_automatically');      the above code doesn't work although this code below works but it doesn't really do it for existing posts until i update them again, so i want a function to query all the posts by current date and it should only run if found new posts for today                   function add_category_automatically($post_ID) {     global $wpdb,$post;                 $post_title = get_the_title();          if (stripos($post_title, 'oranges')!==false) {         $cat = array(8);         wp_set_object_terms($post_ID, $cat, 'category');       }               }           add_action('publish_post', 'add_category_automatically');      Update: i am using this code now , it works if i publish a new post but doesnt work for existing posts??? ..... it should run every time and check all the posts in the database and auto categorize the post but smhw its not                      add_action( 'wp_insert_post', 'update_post_terms' );            function update_post_terms( $post_id ) {           if ( $parent = wp_is_post_revision( $post_id ) )         $post_id = $parent;        $post = get_post( $post_id );         if ( $post->post_type != 'post' )         return;          $post_title = get_the_title();            if (stripos($post_title, 'oranges')!==false) {               // add a category           $categories = wp_get_post_categories( $post_id );             $newcat    = get_term_by( 'name', 'oranges', 'category' );             array_push( $categories, $newcat->term_id );             wp_set_post_categories( $post_id, $categories );          }              }      i know it will put a good load on my database even if i figure this out but i am looking for a way to do this like one instance every two hours or something like that, Please help! **Update 2 to check all posts and loop them to push the category**                $postids = array();        //this is to tell the script to only pull posts that are labeled "publish"       $args=array(          'post_type' => 'post',           'post_status' => 'publish',           'posts_per_page' => -1,           'caller_get_posts'=> 1        );       $my_query = null;     $my_query = new WP_Query($args);        if ( $my_query->have_posts() ) {     while ($my_query->have_posts()) : $my_query->the_post();     $postids[]=$my_query->post->ID;     endwhile;      }      wp_reset_query();  // Restore global post data stomped by the_post().           $i = 0;            while ($num_of_posts > $i){       $post_id = $postids[$i];       add_action( 'wp_insert_post', 'update_post_terms' );       function update_post_terms( $post_id ) {       if ( $parent = wp_is_post_revision( $post_id ) )         $post_id = $parent;        $post = get_post( $post_id );       if ( $post->post_type != 'post' )         return;       $post_title = get_the_title();      if (stripos($post_title, 'oranges')!==false) {           // add a category       $categories = wp_get_post_categories( $post_id );       $newcat    = get_term_by( 'name', 'Oranges', 'category' );       array_push( $categories, $newcat->term_id );       wp_set_post_categories( $post_id, $categories );      }      }       $i++;      }


Modify Search Query if original Query gave no results

I'm looking for a way to modify the search query if the performed query returned no results. Let's say I'm looking for "Opening times", so I go to this URL:               http://mysite.com?s=Opening+times      Now, in my `search.php` I want to check if that query gave no results, and in that case, I want to perform a new query with a different term, wihtout any required action by the user. Something like this:               global $wp_query;          $total_results = $wp_query->found_posts;          if ( $total_results == 0 ) {         // Create a new query with the terms 'Find Us'     }          // Display results (either those for the 'Opening times' query or for the 'Find Us' one if the former didn't return any result)      Is there an easy way to do this?


Permalink target for recent post

I am trying to set up code to submit a post to StumbleUpon, from my Rothmania site. The code reads `href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" alt="" title="">` and when on a single post view, it pulls the info just fine, offering to submit that particular post. When on the home page, I'd like it to submit the most recent, top post, right now it's loading the last one at the bottom of the page. Note: this is hand coded, unrelated to the theme, and not using a plugin. Any help here will be appreciated. Edit - I now have this code -               <?php     $su_link = $su_title = '';          if (is_single()) {         // We're showing a single blog post         // => take the data and deal with it         $su_link = get_permalink();         $su_title = get_the_title();     } elseif (is_home()) {         // We're showing the 'home' archive         // => take the first post's data and deal with it         $ID = $GLOBALS['posts'][0]->ID;         $su_link = get_permalink($ID);         $su_title = get_the_title($ID);     }          if ('' !== $su_link) {         // We have data         // => generate the link         echo ''             .'Link'             .'';     }     ?>                      <title>CoffeeCup Image Mapper map file</title>       <meta name="generator" content="CoffeeCup Image Mapper">                                        <map name="sociallinks">       <area name="facebook" shape="rect" coords="19,0,76,48" href="https://www.facebook.com/joetaxpayer"  alt="" title="">       <area name="twitter" shape="rect" coords="73,0,129,48" href="https://twitter.com/JoeTaxpayerBlog"  alt="" title="">       <area name="stumble" shape="rect" coords="126,0,179,48" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>"  alt="" title="">       <area name="rss" shape="rect" coords="177,0,243,48" href="http://rothmania.net/feed/"  alt="" title="">     </map>                     When I temporarily loaded to the site it offers a 'link' that works perfectly, but I'm staring at this code, not understanding how to link from the proper icon, instead of the word 'link'. I appreciate the help here, and yes, I'm in over my head.


Code auto escaping is not working when using short codes

I'm using this ages old, but still well working, plugin (source code here) to auto escape html inside `<code>`. All is well and good until I tried to use short codes to form the `<pre><code>` blocks. This is the short code code I use:               // HTML code block     function short_code_markup( $atts, $content = null ) {         return "
" . $content . "
";     }     add_shortcode( 'html', 'short_code_markup' );      Does it have something to do with the order the scripts being executed? Here are the filters the plugin applies:               add_filter('content_save_pre', 'pri_cae_mask', 28);     add_filter('content_save_pre', 'pri_cae_unmask', 72);     add_filter('the_content', 'pri_cae_mask', 1);     add_filter('the_content', 'pri_cae_unmask_replace', 99);          add_filter('excerpt_save_pre', 'pri_cae_mask', 28);     add_filter('excerpt_save_pre', 'pri_cae_unmask', 72);     add_filter('the_excerpt', 'pri_cae_mask', 1);     add_filter('the_excerpt', 'pri_cae_unmask_replace', 99);          add_filter('pre_comment_content', 'pri_cae_mask', 4);     add_filter('pre_comment_content', 'pri_cae_unmask', 36);     add_filter('comment_save_pre', 'pri_cae_mask', 28);     add_filter('comment_save_pre', 'pri_cae_unmask', 72);     add_filter('comment_text', 'pri_cae_mask', 1);     add_filter('comment_text', 'pri_cae_unmask_replace_addpre', 99);      Thanks a lot advanced :)


How to use in_category?

There's this "Recent Posts" widget, that should output only posts in category 'News' (ID 26) So I tried this:               <?php $t =& peTheme(); ?>     <?php $content =& $t->content; ?>     <?php list($data) = $t->template->data(); ?>          <?php if (in_category('26')):?>           <?php if (!empty($data->title)): ?>
<?php echo $data->title; ?>
     <?php endif; ?>          <?php while ($content->looping()): ?>     <?php $content->date(); ?>     <?php $content->comments(); ?>
<?php echo $t->utils->truncateString(get_the_excerpt(),$data->chars); ?>     <?php endwhile; ?>          <?php if (!empty($data->link)): ?>     <a class="more-link" href="<?php echo $data->url ?>"><?php echo $data->link ?>     <?php endif; ?>     <?php endif; ?>       But it outputs a blank space where it was the widget. Is there a way I can filter to only show recent posts from category 26 there?


Newest version of javascript

Doing updates to my site and all the files seem to update ok, except the javascript files. I think this is to do with the version, but try as I might I can't get version numbering to work.                 wp_register_script ('headjq', get_bloginfo('template_directory') . "/js/headjq.js");             wp_enqueue_script('headjq');      Is there a way that I can automatically append a version number to the end to force the client to update the scripts?


Notice: Undefined index: filter in ...wp-includes/default-widgets.php on line 382

I'm getting this message on a WP 3.2.1 install with PHP version 5.2.17               Notice: Undefined index: filter in /home/netstewp/public_html/wp-includes/default-widgets.php on line 382      Any idea why?


list post by tags combination - required tags to list out posts

Im in a need to List post by tags. The posts to be listed MUST contain all the tags to be listed, not only one, but all combined. Example; mysite.xx/tag/tag+another/ should put out ONLY the post that HAVE the tags; tag AND another. (the post contain tags; another, juice should not be listed) Now, my list includes all post that is tagged with another, also when they do not have the tag tag.


Add SWF file to wordpress through custom template

I am trying to attach an swf file to my website. I have that swf file in my local system. But wordpress is not alowing me to upload the swf file into the media library. I want to add that swf to my homepage which have a specific custom template. I want to add the swf file through this template file rather than the editor. Is there anyway for that?


Next Previous Post in wordpress with previous / next link with title?

I recently tried the previous post and the next post button link. I do that with image in the left and right side of the site.Its working perfect.But i didn't know how to do this **For Example:**
                             <?php next_post('%', ' ', 'no');                             ?>

                                  <?php previous_post('%', '  ', 'no');                             ?>
      Is it Possible to Show the Previous Post and Next Post Link with Under Title in every Bottom of the Post. Here is the Screenshot. ![enter image description here](http://i.stack.imgur.com/AbbnN.png) **EDITED:** See what I edited the code.               <?php           function nextprev() {          ?>
                             <?php next_post_link('%link', ' %title'); ?>

                             <?php previous_post_link('%link', '%title '); ?>
          <?php     $content = get_the_content();       echo $content;     }          add_action('the_content','nextprev');     ?>


How to translate content in category.php or index.php with qtranslate?

I was wondering how to translate content under `index.php` (or `category.php` with qtranslate?). I'm using twenty twelve theme. My code on `index.php`:               <?php     /**     * The main template file.     * @package WordPress     * @subpackage Twenty_Twelve     * @since Twenty Twelve 1.0     */     ?>     <?php get_header(); ?>     <?php      $page_id = 1500;     $page_data = get_page( $page_id );     echo apply_filters('the_content', $page_data->post_content);     ?>

Latest News
     ...      I would like to translate the content inside the `<section>` and `<h1>` tag for example in french.


plugin class inheritance. cannot change variable

I guess I have a problem understanding inheritance.   I have 4 classes like so;               class FOO extends WP_Widget {         protected $pluginOptions;         function __construct() {             $this->pluginOptions = get_option('option_name',0);              /*$this->pluginOptions['email'] returns /is set to email@domain.com here*/         }     }          class FOO_ACTIONS extends FOO {         function __construct() {             parent::__construct();             /*some actions*/         }         /*some methods*/     }          class FOO_SEND_EMAIL extends FOO_ACTIONS {         function __construct() {             parent::__construct();             /*some actions*/         }         /*some methods*/     }             class BAR extends FOO{         function __construct() {             /*change email here */             $this->pluginOptions['email']='anotheremail@anotherdomain.com';         }     }     $BAR=new BAR();      in another file i am calling:               $sendEmail=new FOO_SEND_EMAIL;      I thought that - as `BAR` gets called before `FOO_SEND_EMAIL`   `$this->pluginOptions['email']` is now `anotheremail@anotherdomain.com`. However, when doing `$sendEmail` it is still set to `email@domain.com`. can anyone point me in the right direction perhaps as to where I'm going wrong here? (happy to provide more code of course if necessary).


widget not displayed

the command                echo '<pre>';print_r(wp_get_sidebars_widgets())  ;         returns                   [sidebar-page] => Array         (             [0] => execphp-5             [1] => simple-section-nav-3             [2] => execphp-4             [3] => wp-forecast-3             [4] => wp-forecast-4             [5] => execphp-6         )      but the sidebar page is not displayed instead the default bar is displayed. why?


Stuck with a Custom Field Check box Array

Been stuck on this for a while now. Haven't come across anything that has shed any light on it for me... Pardon my ignorance... quite a newbie at this level of php. The problem: I am using the wp-property plugin, but need a field that can have multiple numeric values. Using Advanced Custom Fields to set up a checkbox field that can accept multiple numeric values. I am attempting to add this field to the wp-property search function. I get a dropdown menu, but it is populated with lines that look like unformatted arrays. _s:19.a:1:{i:0;s2_ and so on. My values are in that string but I don't know what to do to single them out. I have this in my functions.php               add_filter('wpp_searchable_attributes', 'add_lease_to_searchable');      function add_lease_to_searchable($fields) {          if(is_array($fields))          array_push($fields,  'lease-space1' );               return $fields;     }      Which gets that dropdown to be a part of the wp-property function. If anybody has an idea on how to extract the values... even better put one on each dropdown line, that would be amazing. Feel stuck with no light at the end of the tunnel.


Is 'name' a reserved word in URL's?

I'm creating some custom templates and I keep running in to a problem where I get'Page not found'. After a bit of debugging, I discovered that I only get this if my URL contains `www.mysite.com/custom_page/?name=donkey_boy`. If I use `www.mysite.com/custom_page/?full_name=donkey_boy`, the page loads as it should. Does that mean that `name` is a reserved word?


How do I read the value of a custom field of the page?

When creating custom page templates, how do I get the value of a custom field of the displayed page?


How can I migrate from another platform to WordPress (using the same domain) and launch when ready?

Currently, I have a blog that runs atop Tumblr, which is relatively young (3 months old or so, maybe 25 posts altogehter) that I want to migrate to a self- hosted Wordpress installation. I've installed and configured Wordpress many, many times, but I've never been able to figure this out. Here's what I'd like to do, ideally:   * First, keep the existing blog up and active during the entire process   * Install Wordpress somewhere public and migrate the content either by hand or using an import tool of some kind   * Install whichever theme I end up using, customize the crap out of it   * Switch the DNS for my domain so that users gradually begin to see the fully built and migrated Wordpress site instead of the Tumblr site. Here are the problems with this as I understand them: I won't be able to install the Wordpress blog within the domain in which it will ultimately live because that domain points somewhere else. For this reason, I'll need to install it on a different domain (test.realdomain.com or something) and do all of the import and theme dev stuff there. The bad part here is that Wordpress uses the post's full URL as it's GUID, so I'll have to hand-edit the database so that each post, page and media asset lives at realdomain.com instead of test.realdomain.com. I'm wondering if, in all of my Wordpress travels, I've somehow missed a super easy solution to this problem. For a product as mature as Wordpress, I find it hard to believe that there's no easy way to, say, build a site in a staging environment and deploy it to production without have to manually edit database tables. Any assistance offered would be greatly appreciated, and feel free to let me know if I've left out any details that would help clarify anything. Thanks!


How to check if new posts have been published since page load?

My aim is to use the Heartbeat API to check if new posts have been published since the blog's homepage was loaded. If new posts have been published, I will display a link at the top of the screen "16 new posts" which, when clicked, will insert the new posts into the DOM. **My problem:** How can I check if new posts have been published since the blog's homepage was loaded? **My PHP so far:**               function new_post_check( $response, $data, $screen_id ) {              // Do some processing here.              // Respond.         return $response;     }     add_filter( 'heartbeat_received', 'new_post_check', 10, 3 );     add_filter( 'heartbeat_nopriv_received', 'new_post_check', 10, 3 );      **My script so far:**               $( document ).on( 'heartbeat-tick.poll', function( event, data ) {         // Print data to the console.         console.log( data );     });


Create a theme by combining a parent and a child theme

I have an existing parent theme and a child theme. I have a need for one theme that has the power of the parent theme and the design of the child theme. Is there anyway to quickly combine these two themes to make one standalone theme??


How to add a description to the user name input field in the registration form?

I want a description **under the user name input field** in the Wordpress registration form like in the next example. How can I do this?               //create an extra field in login page for invitation code     add_action( 'register_form', 'add_invitation_code_field' );          function add_invitation_code_field() {        ?>
                               Invitation code                 <input id="invitation_code" class="input" type="text" size="20" value="" name="invitation_code"/>                 <?php _e("Description text"); ?>
        <?php     }


Categories under custom post types doesn't show properly

I used a custom post type in my website: I added `archive-{mytaxonomy}.php` and also `single-{mytaxonomy}.php`. I also created a separate sidebar for my taxonomy and everything looks fine until I click on one of my categories. Then it loads `archive.php`. Should I add any other code to my files?