title: Get post by term from custom taxonomy in another blog on the network?

text:
I'm having trouble getting post by term in a custom taxonomy I have set up. The catch is this is multisite and I'm getting this data from another blog on the network where the taxonomy is registered. The code I have works fine on the blog with which the taxonomy is registered. However when I try the same code on the other blog using switch_to_blog I get bool(false). Meaning, I guess, that there is an error in the sql. However if I just do is_term I can confirm it's there. Here's a link to the code that is working on the naitive blog but not the other,               <?php get_header(); ?>          <?php global $switched; switch_to_blog(2); ?>
          <?php         $type = 'portal_warrants';         $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;         $terms = is_term( 'most-wanted' , 'warrant_status' );         $args=array(                 'post_type' => $type,                 'posts_per_page' => 6,                 'paged' => $paged,                 'tax_query' =>                         array(                                 array(                                         'taxonomy' => 'warrant_status',                                         'field' => 'id',                                         'terms' => 'most-wanted',                                 )                         )                      );                                                     $my_query = null;         $my_query = new WP_Query($args);         $i = 0;         if( $my_query->have_posts() ) {                 while ($my_query->have_posts()) : $my_query->the_post();                      if( $i % 3 == 0) :?>

                 <?php endif; ?>                 <?php print_r(var_dump($wp_query->request)); ?>

Wanted

                                                                  Arrested

<?php the_title(); ?>

Last Known Address:

Hair:

Eyes:

Height:

Weight:

               <?php $i++ ?>            <?php endwhile; } wp_reset_query(); ?>
           <?php restore_current_blog(); ?>          <?php get_footer(); ?>      *Edit (updated pastebin with switch_to_blog included) http://pastebin.com/uBbaXnSt Also, this doesn't output anything at all not even with `print_r(var_dump($my_query->request));` * * * Solution (or at least in part) * * * The problem is `switch_to_blog` doesn't give you access to everything in another blog on the network including taxonomies, tags, things in your functions.php, although don't quote me 100% on that. Therefore the taxonomy wasn't registered in the "switched to" blog. My solution (at least for now) register the taxonomy in that blog. After doing that, `tax_query` worked as expected. This is what I'm going with until I find a better solution (if one exists at all).


title: How to use different short description in shop page and in product page in woocommerce

text: What I would like to have is the sentence "Entre em contacto connosco para saber preços Aqui" just in product page, not in shop page. Please take a look in this page: http://www.kepaweleurope.com/shop/soutien-mamoplastia-85/ Does anybody can help me? Thanks in advance Miguel


title: Editor can create any new user except administrator

text: I have set up a WordPress site for a client. The client has the Editor role, however I have installed the Members plugin and given the client the capability to add new users to the WP admin. This is working just fine. The question I have is that I would like for the client to have the ability to create new user as with the roles of a Contributor, Subscriber, Editor and Author, but NOT Administrator. The new users the client creates should not have the Administrator role. Is it possible to hide this option somehow? Thanks Vayu


title: What type of Google tracking should I use?

text: I have WP Multisite and now I want to track the different sites.   I'm using Multisite Domain Mapping to map `www.mysite.com` to `http://subsite.mysite.com` My questions is: **a)** Do I need to add the same google analytics script to all themes?   **b)** when creating the script at GA, I have the following choices:   * A single domain (default)   * One domain with multiple subdomains   * Multiple top-level domains Do I use nr 2 or 3? I know there are plugins I can use. But I still have to create the scripts at GA, right?


title: Internal 500 error: Activating rootio theme and deploying with capistrano

text: When I deploy my wordpress site using Mark Jaquith's capistrano recipes, I get a 500 internal error when trying to activate my roots.io theme. All other default themes work. Here are my server logs: require_once(/www/ ** _*_ ****. _ **_** _**._ ** _*_ ***/releases/20140116200222/wordpress): failed to open stream: No such file or directory in /www/ ** _*_ ****. _ **_** _**._ ** _*_ ***/releases/20140116200222/wordpress/wp-content/themes/roots/functions.php on line 5, referer: http:// ** _*_ ****. _ **_** _**._ ** _*_ ***/wordpress/wp- admin/themes.php [Thu Jan 16 20:05:34 2014] [error] [client **_*_ ****] PHP Fatal error: require_once(): Failed opening required '' (include_path='.:/usr/share/pear:/usr/share/php') in /www/ ** _*_ ****. _ **_** _**._ ** _*_ ***/releases/20140116200222/wordpress/wp- content/themes/roots/functions.php on line 5, referer: http:// ** _*_ ****. _ **_** _**._ ** _*_ ***/wordpress/wp-admin/themes.php Here's my folder structure: ![enter image description here](http://i.stack.imgur.com/RRetj.png) So far I've tried:   * Downgrading to 3.8 stable from 3.9 alpha   * Replacing my custom roots theme with a fresh unedited one   * Changing my httpd config to point to the actual path of the file, not just the symbolically linked folder 'current'   * Moving my roots theme from `content/themes/` to `wordpress/wp-content/themes/` Any thoughts?


title: Maintain SEO of a website while migrating it to Wordpress?

text: i have a site url http://www.dualfocusphotography.co.uk i want to convert it to wordpress in such a way its SEO or site ranking should not be disturbed. any one guide me is it possible if yes then how? any help or relevant-materiel would be appreciated.


title: Dynamic height in custom header image panel

text: I've enabled the custom header image panel for my theme.. That all works fine, but it has a predetermined height. How can i make it dynamic? The width can be permanent. I used this code. http://www.wpbeginner.com/wp-themes/how-to-enable-custom- header-images-panel-in-wordpress-3-0/               define( 'HEADER_IMAGE_WIDTH', apply_filters( 'yourtheme_header_image_width', 940 ) );     define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'yourtheme_header_image_height',  198 ) );          set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );


title: How can I correctly redirect user to the submitted post and define a template for each new post in Wordpress?

text: What I want to do is to create a simple front-end post submit form, for every different type of post I will include in my Wordpress app. For example there will be articles, events, quick messages and those types will have a different design/structure for a user to see. Author will use those forms to post their content. As far as I know, I can have a different template for those types with the `if in category` function but I am interested in alternative solutions (maybe better). I know that there is `page_template` to add in the array http://wpengineer.com/1229/puplishing-extend-of-wordpress/ but is there anything else? Also I am having some difficulties to redirect or even echo the posted link (as below). For your concern, I can not echo the `$link` . Thank you for your help.               if(isset($_POST['submit'])){              global $user_ID;              $new_post = array(             'post_title' => $_POST['post_title'],             'post_content' => $_POST['post'],             'post_status' => 'publish',             'post_date' => date('Y-m-d H:i:s'),             'post_author' => $user_ID,             'post_type' => 'post',             'post_category' => array(0)         );              wp_insert_post($new_post);     }      I tried this for redirect without luck               $pid = wp_insert_post($new_post);     $link = get_permalink( $pid );     echo $link;     wp_redirect( $link );


title: if is within sidebar

text: I have several sidebars (more then 1 on a page) and I would like to set different image sizes to widgets, depending in which sidebar they are located. I tried               if( ! dynamic_sidebar('my-sidebar') ) :      and               if ( is_active_sidebar( 'left-sidebar' ) ) :      but this only seems to check if the sidebar's exist (and they do). How do I get: " **if widget is located in sidebar A, give me this size, elseif widget is located in sidebar B, give me that size** "?


title: WP Admin Login keeps redirecting to login

text: Everytime I try to login it keeps redirecting me to the login page, or pretty much just loops. No error messages, just redirects. If I reset the password it works, but the next time it starts all over again. Any ideas?


title: How to redirect to a page after the form is submitted

text:
I am New to Wordpress.I am creating a Plugin Where I have to import a csv File to database.Uploaded and Entered data Successfully.But my Problem is once the file gets uploaded it shows a blank page with the success Message.How can I redirect to the same Page with success or error Message please help..Thanks in Advance.. Here is my code               $admin_services =   add_menu_page('Fee Schedule','Fee Schedule','administrator','pd-services','pd_services');     <?php     function pd_services(){     if ( $_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['admin_service_csv_upload']))          {             if(get_file_extension($_FILES["service_upload_csv"]["name"])!= 'csv')             {                 $error[] = 'Only CSV files accepted!';             }         if (!$error){             $tot = 0;             $handle = fopen($_FILES["service_upload_csv"]["tmp_name"], "r");                 //echo $file   =  $_FILES["service_upload_csv"]["tmp_name"];                 while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {                     for ($c=0; $c < 1; $c++) {                         //only run if the first column if not equal to firstname                         if($data[0] !='Department Name'){                             $insert_csv_query = "INSERT INTO wp_services(                                         dept_name,                                         inc_10_codes,                                         description,                                         uc_fee                                                     )VALUES(                                         '".mysql_real_escape_string($data[0])."',                                         '".mysql_real_escape_string($data[1])."',                                         '".mysql_real_escape_string($data[2])."',                                         '".mysql_real_escape_string($data[3])."'                                         )";                                 $insert_csv_query;                             $inserted = $wpdb->query($insert_csv_query);                             }                              echo $tot++;                 }         }     fclose($handle);     $content.= "
 CSV File Imported, $tot records added
";     }     } else {     ?>
         <form name="csvupload" action="" method="POST" enctype="multipart/form-data">

                     Upload Services from CSV	                     <input type = "file" name="service_upload_csv" id="upload_csv_id" aria-required="true">

                     <input type="submit" class="button-primary" name="admin_service_csv_upload" value="<?php _e('Save Changes')?>" />

         </form>         <?php echo $content ?>
     <?php     }     }      ?>


title: error:-Cannot modify header information - headers already sent by

text: whewn ever i try to login http://affiliatesurge.com.au/wp-admin/ i got "" Warning: Cannot modify header information - headers already sent by (output started at /home/affiliat/public_html/wp-config.php:1) in /home/affiliat/public_html/wp-includes/pluggable.php on line 881 "" Error ... i already try removing spacing in wp-config and functions.php


title: Get Admin Email Address From External PHP page

text: I am setting up a "built in" contact form that I need to pull the administrators email address from an external php page. For instance, my form `action="path/to/process_form.php"` Within that `proces_form.php` I have a few options set up.               $msg = "Form Contents: \n\n";     foreach ($this->fields as $key => $field)         $msg .= "$key :  $field \n";          $to = 'static@email.com';     $subject = 'New Form Submission';     $from = $this->fields['email'];      My goal is to dynamicly grab the admin email address from this page and populate the `$to = ''` area. Any help would be much much appreciated!


title: Frontend image uploading from frontend cant handle hebrew names

text:
i'm using the insert_attachment code in my functions.php :               function insert_attachment($file_handler,$post_id,$setthumb='false') {            // check to make sure its a successful upload       if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();            require_once(ABSPATH . "wp-admin" . '/includes/image.php');       require_once(ABSPATH . "wp-admin" . '/includes/file.php');       require_once(ABSPATH . "wp-admin" . '/includes/media.php');            $attach_id = media_handle_upload( $file_handler, $post_id );            if ($setthumb) update_post_meta($post_id,'_thumbnail_id',$attach_id);       return $attach_id;     }      and build a nice form in a static page :                <form id="new_post" name="new_post" method="post" action="" enctype="multipart/form-data">
שם                   <input type="text" id="first_name" value="" tabindex="1" size="20" name="first_name" />

משפחה                 <input type="text" id="last_name" value="" tabindex="1" size="20" name="last_name" />

מקעקע                 <input type="text" id="tatto_artist" value="" tabindex="1" size="20" name="tatto_artist" />

גיל הקעקוע                 <input type="text" id="tatto_age" value="" tabindex="1" size="20" name="tatto_age" />

מחיר                 <input type="text" id="tatto_price" value="" tabindex="1" size="20" name="tatto_price" />

שם הקעקוע                 <input type="text" id="tatto_name" value="" tabindex="1" size="20" name="tatto_name" />

ספר על הקעקוע                 <textarea id="post_tags" tabindex="3" name="post_tags" cols="30" rows="2" name="post_tags"></textarea>

העלה תמונה :                  <input type="file" name="thumbnail" id="thumbnail"/>

<input type="submit" value="שלח" tabindex="6" id="submit" name="submit" />
               <input type="hidden" name="action" value="new_post" />               <?php wp_nonce_field( 'new-post' ); ?>             </form>      as you can see, the form is in hebrew. when i'm trying to upload attachment :               if ($_FILES) {       foreach ($_FILES as $file => $array) {         $newupload = insert_attachment($file,$pid);         echo ($attach_id);       }     }      my problems begin... the photos are loaded but if their names is in hebrew - it saves them in other names and cant find them. for example: name of file from my pc: סקיצה (1).jpg the name after i uploaded it, in the wp uploads folder : ׳¡׳§׳™׳¦׳”-1.jpg does anyone have any ideas how to handle this situation?


title: Auto Accept Friend Requests BuddyPress

text: I'm attempting to create a function that auto accepts friend request in Buddy Press, the function is as follows;               function bp_auto_accept_friend_request( $friendship_id, $friendship_initiator_id, $friendship_friend_id ) {              friends_add_friend(              $friendship_initiator_id,              $friendship_friend_id,              $force_accept = true          );              friends_accept_friendship( $friendship_id );     }          add_action('friends_friendship_requested', 'bp_auto_accept_friend_request', 200, 3);      The above function works by creating an entry in the `wp_bp_friends` table with a value of `1` for the `is_confirmed` column, however the default friendship request action is still being executed which adds an additional entry to the table saying unconfirmed.               id  initiator_user_id   friend_user_id  is_confirmed    is_limited       2          1                   3             1              0        3          1                   3             0              0         So we have both a confirmed and unconfirmed entry for the same friendship. This means that on the user profile page it will appear as if you have both **a confirmed friend** and have **a friend request** from the same person. The above function was adapted for simplicity from; http://premium.wpmudev.org/forums/topic/auto-accept-friend-requests There's also this accepted answer from WPSE here; How to auto-accept a friend-request in buddypress based on user meta ...which when adapted to my use case produced the same results described. Any thoughts on how to prevent the default action? So far I can't unhook the request...


title: How to make changes on Wordpress site locally on live site?

text: I would like to set up a System where I can clone a live website and work on it locally and then when I'm satisfied and the changes are approved, I can send or sync those changes with the live site. I'm currently watching gitHub tutorials, but I'm not sure if I'm on the right track.


title: List sidebars on a page

text: I need to generate a list of sidebars on a given page. I know how to list all sidebars that have been registered, and all sidebars that have been registered that have active widgets, but I do not know **how to filter** them down to **the sidebars that were displayed on an individual page** using PHP. To try to get around this I took `$wp_registered_sidebars` and swapped it out for a class that implemented `ArrayAccess`, which gets 90% of the way there in that it intercepts the calls and stores the requested sidebars, only the sidebars then never show because somewhere is an `is_array` or other check fails. I can also intercept `dynamic_sidebar_params` and check the id field in the first array item, but this only tells me which dynamic sidebars are called with active widgets, it doesn't tell me when an empty sidebar is tried. Here is my interception class:               class sidebar_counter implements \ArrayAccess {              private $container;         private $offsets = array();              function __construct( $container ) {             $this->container = $container;         }              public function addOffset( $offset ) {             if ( !in_array( $offset, $this->offsets ) ) {                 $this->offsets[] = $offset;             }         }              public function getOffsets() {             return $this->offsets;         }              public function offsetExists( $offset ) {             $this->addOffset( $offset );             return isset($this->container[$offset]);         }              public function offsetGet( $offset ) {             $this->addOffset( $offset );             return isset($this->container[$offset]) ? $this->container[$offset] : null;         }              public function offsetSet( $offset, $value ) {             if ( is_null( $offset ) ) {                 $this->container[] = $value;             } else {                 $this->container[$offset] = $value;                 $this->addOffset( $offset );             }         }              public function offsetUnset( $offset ) {             if ( ( $key = array_search( $offset, $this->offsets ) ) !== false ) {                 unset( $this->offsets[$key] );             }             return isset($this->container[$offset]) ? $this->container[$offset] : null;         }     }      It's intended usage:               // early on:     global $wp_registered_sidebars;     $this->counter = new sidebar_counter( $wp_registered_sidebars );     $wp_registered_sidebars = $this->counter;      then after the footer:               $sidebar_ids = $counter->getOffsets();


title: Calculate average crossing post categories

text: In my WP database I have some posts i the category `hotels` and some other posts in the category `visits`. In the posts (placed in the category `visits`) there is two meta_fields ( `rating` and `placeid` ) `rating` is the rating for the visit and `placeid` is the id (`post_ID`) for the hotel ( a post in the category `hotels`). Now I will want to make an average of the ratings for the hotel. I will do it in one MySQL-question. How can I join and calculate the average on the right way? Here is my code where I get the hotels:               $result = query("SELECT p.*             , x.adresse             , x.lat             , x.lon             , x.location                 , y.rating                 , y.placeid             FROM wp_posts p             LEFT             JOIN                  ( SELECT post_id                         , MAX(CASE WHEN meta_key = 'adresse' THEN meta_value END) adresse                         , MAX(CASE WHEN meta_key = 'lat'  THEN meta_value END) lat                         , MAX(CASE WHEN meta_key = 'lon'  THEN meta_value END) lon                         , MAX(CASE WHEN meta_key = 'location'  THEN meta_value END) location                      FROM wp_postmeta                     GROUP                        BY post_id                  ) x              ON x.placeid = p.ID                 LEFT             JOIN                  ( SELECT post_id                         , MAX(CASE WHEN meta_key = 'rating' THEN meta_value END) rating                         , MAX(CASE WHEN meta_key = 'placeid'  THEN meta_value END) placeid                      FROM wp_postmeta                     GROUP                        BY post_id                  ) y              ON y.post_id = p.ID             LEFT              JOIN                  ( SELECT * FROM wp_term_relationships ) r             ON (p.ID = r.object_id)             LEFT              JOIN                  ( SELECT * FROM wp_term_taxonomy ) q             ON (r.term_taxonomy_id = q.term_taxonomy_id)             LEFT              JOIN                  ( SELECT * FROM wp_terms ) t             ON (q.term_id = t.term_id)          WHERE p.post_status = 'publish' AND t.name = 'Hotels' AND q.taxonomy = 'category'       ORDER BY ID DESC ");      I also got these average-code - but can't implement it on my code. I'm stuck!               SELECT AVG(rating) as gennemsnit FROM anmeldelser WHERE placeid=$postid


title: Make parent category an optgroup

text: How to transform the parent category into an `optgroup`? Demo of what I want: http://fiddle.jshell.net/Pp7Ey/show/ Currently I have this code:                   $cat = $_POST['cat'];                  $data = array(             ..             'post_category' =>array($cat)             );          wp_insert_post($data);          <?php wp_dropdown_categories('orderby=name&hide_empty=0&show_count=1&show_option_none=Select one&class=cat&hierarchical=1&name=cat'); ?>


title: How to make "my posts" page

text: 1. How to make a section, or better is something like a shortcode, to filter only posts added by me (or other user, depends on who is logged in)?   2. And how to hide this page (section) if is nobody logged in?


title: Separating search results collectively by type

text:
My search results are limited to post types `book` and `author`. The following code in `search.php` displays all `author` posts first, then all `book` posts (I asked why post types are separated like that, but got no answer so far):               while(have_posts()) : the_post();                if ( 'book-author' == get_post_type() ) {                ?>
AUTHOR
             <?php the_title();          }         elseif ( 'book' == get_post_type() ) {               ?>
BOOK
             <?php the_title();          }     endwhile;       However I want to display these search results in two columns entitled "BOOKS" and "AUTHORS", each in its own `div` element. This code doesn't allow that, so how can I achieve such division?


title: How to SELECT number from table and use in calculation . Unsupported operand types

text: This is the PHP part of an ajax request. The user enters two numbers, via two fields. I can add these two numbers together & display the total in a field, this works OK. However, I would also like to add a number that has been retrieved from a custom table to this. So it's two user entered numbers + number from custom table. I get the following error: `br /><b>Fatal error</b>: Unsupported operand types in <b>/home/greentes/public_html/wp- content/plugins/jquery_validate_min1/activate2.php</b> on line <b>118</b><br />` Line 118 is   `$total = $numwelds + $numconwelds + $mpcountrys ;` My code:                function myajax_inputtitleSubmit_func() {           global $wpdb;     $mp_country_table_info = $wpdb->prefix . 'countries '; //Good practice     $mpcountrys = $wpdb->get_results( "SELECT labour_cost FROM $mp_country_table_info WHERE id='2' ");                       $nonce = $_POST['nextNonce'];            if ( ! wp_verify_nonce( $nonce, 'myajax-next-nonce' ) )             die ( 'Busted!');              $numwelds = isset($_POST['numberofwelds']) ? $_POST['numberofwelds'] : '';     $numconwelds = isset($_POST['numberofconwelds']) ? $_POST['numberofconwelds'] : '';          if (is_numeric($numwelds) && is_numeric($numconwelds))     {         $total = $numwelds + $numconwelds + $mpcountrys ;         $response = json_encode($total);         header("Content-Type: application/json");           echo $response;         exit;     }      }      What is wrong with this please?


title: Make the text field in search form optional

text: I've added some custom fields to my search form, which will be used more frequently than the original text field (`<input name="s" />`). However, the text field seems to be required to perform a search, and an empty value isn't enough. Valid: `http://www.example.com/?s=foobar&max_price=500` Invalid: `http://www.example.com/?s=&max_price=500` Is there any way to get round this? The HTML form is pretty simple:               <form action="/">        <input type="search" name="s" />        <input type="number" name="max_price" value="0" min="0" />        <input class="button" type="submit" value="Search" />     </form>


title: Apply styles to blockquote element with the WYSIWYG editor

text: I have a blockquote and I can float it left or right if I want by going into the html editor and adding class="alignleft" etc. Is there any way I can make that available to a non tech individual with a button or plugin / function or something. I think i'm looking at a tinymce plugin but i've never done anything with that area; so hoping to avoid that at this time if at all possible. If that is what I need would anyone have a code snippit or a link to a good tutorial. I imagine it's a fairly common thing to have.


title: Change image size depending on page

text: I've got a simple photographic site and it uses large image sizes throughout. On the archive page, however, I've got about 35 posts each showing the first image of each. By default, the images being uploaded are around 600 pixels wide. However, on the archive page they need only be 150 pixels wide. **The problem: I don't need 600 pixel wide images on this heavily populated archive page.** I understand WordPress generates smaller images when they are uploaded to the media gallery. Is there a way I can use a smaller image that has been generated instead of the large, default image?


title: Trash a post, send associated comments into the trash bin (change status)

text: When trashing a post, all comments associated with this post get the status "post-trashed". They do not end up in the trash bin. In my theme the author gets a point for posting a post or a comment. Subsequently I also want to deduct a point when the posts or comments is trashed. Both of these functions works excellent. The problem arise when I trash a post. I want the associated comments to also be affected, and have one point reduced. This function: http://de.wpseek.com/wp_trash_post_comments/ seems to be the culprit. So I think the best solution is to either somehow force the "post_comments" to be sent into the actual trash bin, or somehow incorporate an action to the above function to also remove a point when trashing "post_comments". (it would be important that there is no conflict with trash_comment, so the action somehow doesn't get called twice, and reduces two point for one comment being trashed). Any ideas?


title: Change Title Type

text: I'd like to change the title field of a post in admin panel. I'd like this field was "textarea" instead of being "input type='text'". Would it be possible through any hook in functions.php? Thanks in advance!


title: WP Nav menu append to url

text: Using `wp_nav_menu()` , how can I append a value at end of each URL?   For example, I have the following url: `http://www.example.com/` but I have to append a language parameter at the end, so the url should be: `http://www.example.com/?lang=$language`


title: Using Add from Server to upload by post ID

text: I am using Add From Server plugin http://wordpress.org/extend/plugins/add- from-server/ basically it imports/upload image from the server. Currently the plugin copies the images into month/year folder format but I want to change it by making it copy by the Post ID folder format instead of month/year. I have already tried using the Custom Upload Dir plugin but it doesn't work with Add From Server plugin together. Can anyone tweak Add From Server plugin to make it upload by Post ID?


title: Automatically add a tag according to custom metadata

text: I'm trying to figure out how to make a function to automatically add a "featured" tag to a post, based on a checkbox in a metabox I've added to the edit screen. I think the function I need to use is wp_set_object_terms, but I don't get how it works. I know how to check if those checkboxes are active or not, but that´s all. I hope someone can put me on the right track with this.


title: Removing the "Your backup folder MIGHT be visible to the public" Message Generated by the WP-DBManager Plugin

text: I upgraded a client's WordPress from 2.8 to 3.0.1 and after upgrading I am now receiving this message in the dashboard: > Your backup folder MIGHT be visible to the public > > To correct this issue, move the .htaccess file from wp-content/plugins/wp- > dbmanager to /home/usearname/public_html/wp-content/backup-db My client's WordPress in installed in the `/wordpress/` sub-directory, i.e.: > `http://domain-name.com/wordpress/` This was provided by the plugin to resolve the problem (the filename is `wp- content/plugins/wp-dbmanager/htaccess.txt`):               <Files ~ ".*\..*">     order allow,deny     deny from all     </Files>      I downloaded this file on my PC then re-uploaded to the server at: > `/home/usearname/public_html/wp-content/backup-db/` but warning message is still showing in the dashbord. How do I solve this problem?


title: Query a WordPress page by its title (which has a parent page)

text:
I have created a wordpress query which takes the entire content from 1 particular page using the its title So far i have the following:               <?php     query_posts('pagename=features');     if (have_posts()) :     while (have_posts()) : the_post();?>
<?php the_title(); ?>
     <?php the_content(); ?>     <?php endwhile; ?>     <?php else : ?>
No Section available

<?php _e("No Section available"); ?>
     <?php endif;     //Reset Query     wp_reset_query();     ?>      The main issue is that there is numerous pages which care called 'features' but they all have different parents. Is it possible to do this via parent somehow? For example, here is my hierarchical page structure: products > designgo silver > features products > designgo silver > screenshots products > designgo silver > benefits products > designgo gold > features products > designgo gold > screenshots products > designgo gold > benefits products > designgo platinum > features products > designgo platinum > screenshots products > designgo platinum > benefits If i could do something like:               <?php     query_posts('pagename=features&parent=designgosilver');     if (have_posts()) :     while (have_posts()) : the_post();?>      that would be perfect, can anyone give us a pointer? Cheers!


title: How to avoid directory name collisions with root Wordpress install

text: I need to know how I can keep the end-user of a wordpress site installed in the root directory from creating slugs that will interfere with sub- directories that are already present. I've Googled everywhere, but the best I can find are some very general instructions that only help people who already know how to configure Apache- and I don't know enough to get it to do what I want. I want to know how to do both these things: A) Configure the `.htaccess` file to not redirect certain specific paths, e.g. `http://example.com/samename` should go to the directory, not be redirected to a Wordpress page with the slug `samename`, even if it exists. B) To avoid end-user confusion, disallow the creation of slugs with specific names, e.g. `samename` using the API. If someone could tell me how to do **both** , I think it will be very useful to a lot of people down the line.


title: saving meta/custom field to tag

text: In my custom post type what I am trying to do is say I have select drop down option called party_ad. The value of the options are obtained via an RSS feed.               echo '<select name="ad_Tags" id="ad_Tags">';       foreach ($rs['items'] as $item)       {        echo '<option value="'.$item[title].'" '. selected( $adTags, $item[title]).'>'.$item[title].'</option>';       }       echo '</select>';      I can save these data with no problems - however, what I want to be able to save the selected option as a tag to the custom post. I thought about doing it front end, ie if an option is selected then it adds the value to the post tag box, ideally though, I'd like to really do this server side.


title: How much should I worry about these messages?

text: I received about 50 messages today with the similar message: > WordPress Firewall has detected and blocked a potential attack! > > Web Page: > domain.com/index.php?option=com_simpledownload&controller=../../../../../../../../../../../../../../../proc/self/environ%00 > Warning: URL may contain dangerous content! Offending IP: 211.147.221.42 [ > Get IP location ] Offending Parameter: controller = > ../../../../../../../../../../../../../../../proc/self/environ > > This may be a "Directory Traversal Attack." How much should I worry about these? It came from multiple IP addresses throughout the day.


title: Can´t access non-wordpress subdirectories as wordpress overrides them with a 404 error

text: Hi everybody at the forum, I am new here and this is my first question. I have beed reading this thread, the very first answer by Elpie (Cannot access non- wordpress subdirectories as wordpress overrides them with a 404 error) worked for me for the original problem. But now a new one has emerged. This rule RewriteRule ^.*$ - [L] makes the permalinks stop working (http://www.olinala.com/localizacion/). If I change permalinks to default mode (http://www.olinala.com/?p=123) everything work find but I need "pretty links". Any advice? Any help? Sorry about my english and thans in advance.


title: Total Word Count For Posts By One Author

text: How can I get a total word count of one author's posts? I would like to be able to see what the total word count of their output is, summed across all of their posts (ideally with a breakdown by category/tag/page-or-post). There's gotta be a contemporary plugin for this.


title: Where the WordPress Core Translation is "actually" taking place?

text: I'm a WordPress Core Bengali translator, currently translating and/or fixing existing translations of WordPress 3.8x Bengali in Translate.WordPress.org. Suddenly, yesterday I got an update notification in all my `WPLANG` '`bn_BD`' sites that, a new version of WordPress Bengali for WordPress 3.9 has come, so update your system. After the update I found a bluff update, because all the previous strings those were translated, got untranslated strings now. So, it's a bogus translation at all. As a Core translator, I jumped to the translate.wordpress.org's WordPress Projects, but found no such 3.9x translation project there. I wonder, **from Where** the official language release just happened, (as v3.9 is NOT a Dev. version now, it's a released one) if there's no such project's running!?


title: SQL - Remove All The Users and Create A New User With Admin Role Via PhpMyAdmin

text: It is very easy to remove all the users and add a new user with administrative role via wp admin panel. But the requirement is to achieve this through SQL. I can trunc `wp_users` and `wp_usermeta` table to remove all the users. But when I add an entry in `wp_users` with dummy data and then login through wp admin then it says incorrect login. Why? I shall be very thankful to you if you can tell me the proper way of removing all the users and adding a user with admin role.


title: Is there any reason why there's no "login_header" action at the login page?

text: There is a `login_footer` action hook at the `wp-login.php` of Wordpress which is quite handy for strapping in the theme footer into the login/registration page:               add_action( 'login_footer', function() {         get_footer();     });      Is there a reason why there is no similar action for header?


title: Custom post with custom category and custom meta box query and order by custom_value

text:
Im building a Library CPT= Libro Custom Taxonomy= categoria_libro (as category) Custom meta box which has: autor editorial ciudad año As it says in the title, I need to query a custom post type, which has a custom taxonomy category, and a custom meta box. i cant figure out how to order the posts by meta_value where the meta_key=autor as my query is in the taxonomy My query:                  <?php     //for a given post type, return all     $post_type =   array(     'post_type' => 'Libro',       'meta_key'       => 'autor',          'orderby' => 'post_value',           'order' => 'DESC'      );     $tax = 'categoria_libro';     $tax_terms = get_terms($tax);               if ($tax_terms) {       foreach ($tax_terms  as $tax_term) {         $args=array(           'post_type' => $post_type,           "$tax" => $tax_term->slug,           '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() ) {             echo '

 '. $tax_term->name. '

';                               while ($my_query->have_posts()) : $my_query->the_post();                 ?>             <?php                  $custom = get_post_custom($post->ID);                  $autor = $custom["autor"][0];                  $editorial = $custom["editorial"][0];                  $ciudad = $custom["ciudad"][0];                  $anio = $custom["anio"][0];                     ?>
<a href="<?php the_permalink() ?>"  rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>.  <?=$autor?>.  <?=$editorial?>. <?=$ciudad?>.  <?=$anio?>
                            <?php endwhile;?>

         <?php }         wp_reset_query();       }     }     ?>      Everything is right.... I have a List showing the Category each post belogns to and a list inside the category of each post. what I cant get to work properly is the order by meta_key =autor and order this alphabetically. Thanks in advanced for your help


title: File format of post image attachment

text: I'm working on a website that can display 3D molecules (.mol) using the JavaScript-based viewer from JSmol (http://sourceforge.net/projects/jsmol/). With the "Upload File Type Settings" plug-in files with .mol extension can be uploaded as "Featured Image". I managed to customize my single.php template with the JSmol script to display the .mol files. Now I'd like to determine in the template if the featured image attachment of the post is an .mol (for displaying the 3D file via the script) or an image file format (JPG, PNG.. to display with the_post_thumbnail), such as:               <?php if ("the attachment has a .mol extension?") {     echo "<script>Jmol.getTMApplet('jmol', Info)</script>";     } else if {     the_post_thumbnail();     } ?>      How can I find out which file format is used in the featured image attachment of the post?


title: How to make my search result searched by post title and content and also categories only?

text: I would like to ask a question. Is there any solution to make my wp search result searched only by post title and categories? If this is a duplicate question, please refer me to the page where i can get the answer. Thank you!


title: Are there any reasons you can't use strings for admin menu positions?

text: When interacting with the admin menu, for instance via `add_menu_page`, there is a `$position` parameter. The inline docs indicate that this should be an integer. The Codex agrees, but adds a note that you can use a float if you make it a string (e.g. `'63.3'`). In wp-admin/includes/menu.php the array is sorted by comparing the keys with `strnatcasecmp`. With this in mind, one could set a menu position of `'63-foo'` or `'63-bar'` to avoid position conflicts. This would be especially helpful for plugins, where they currently may set a position which can cause conflicts in some themes or with other plugins. Using strings appears to work just fine. I combed the source and didn't find any issues, but maybe I've missed something. **Are there any reasons why a string can't or shouldn't be used for the menu position?**


title: Filter In Reply comments from Wordpress Admin Panel

text: Is there any way to filter the comments that are In Reply from the comments list? I basically just want to see the depth 1 comments on a separate filter. @GhostToast Ive added this to create a new filter 'Ask' on the Admin Comments Panel. is there a way to just apply your top level comments filter code to this Ask filter? That would be really good because the All comments filter still works and the Ask is filtered by showing only the top level ones...               add_action( 'current_screen', 'wpse_72210_comments_exclude_lazy_hook', 10, 2 );          /**      * Delay hooking our clauses filter to ensure it's only applied when needed.      */     function wpse_72210_comments_exclude_lazy_hook( $screen )     {         if ( $screen->id != 'edit-comments' )             return;              // Check if our Query Var is defined             if( isset( $_GET['ask'] ) )             add_action( 'pre_get_comments', 'wpse_63422_list_comments_from_specific_post', 10, 1 );              add_filter( 'comment_status_links', 'wpse_63422_new_comments_page_link' );     }          /**      * Only display comments of specific post_id      */      function wpse_63422_list_comments_from_specific_post( $clauses )     {         $clauses->query_vars['post_id'] = 12;     }          /**      * Add link to specific post comments with counter      */     function wpse_63422_new_comments_page_link( $status_links )     {         $count = get_comments( 'post_id=12&count;=1' );              if( isset( $_GET['ask'] ) )          {             $status_links['all'] = 'All';             $status_links['ask'] = 'Ask ('.$count.')';         }          else          {             $status_links['ask'] = 'Ask ('.$count.')';         }              return $status_links;     }


title: trash_post action with Custom Post Type

text:
I have a Custom Post Type "empresa" and would like to send email when a post type is deleted (moved to trash). I have this function below for my POSTS, How can I use with my Post Type "empresa"?               add_action("trash_post", "my_awesome_publication_notification");     function my_awesome_publication_notification($post_id) {     $post = get_post($post_id);     $author = get_userdata($post->post_author);          $author_email = get_post_meta( $post->ID , 'empresa_contato_email' , true );     $email_subject = "A Sua Empresa foi aprovada!";          ob_start();          include("email_header.php");          ?>
         Hi, <?php echo $author->display_name ?>. I've just published one of your articles         (<?php echo $post->post_title ?>) on MyAwesomeWebsite!

         If you'd like to take a look, <a href="<?php echo get_permalink($post->ID) ?>">click here.         I would appreciate it if you could come back now and again to respond to some comments.
          <?php          include("email_footer.php");          $message = ob_get_contents();          ob_end_clean();          wp_mail($author_email, $email_subject, $message);      }


title: Multiple Categories on Catlist using name function

text: Hi there I am hoping that someone can help me with the "plugin-list-category- post" plugin. I am using this shortcode in a post to activate the plugin               [catlist name='Audi' name='Cadillac' template='category-display-template' excerpt='yes' thumbnail='yes' numberposts='2']      In the result it shows me two listings of 'cadillac' but it ignores the audi name tag... Is it possible to do it this way? or do I absolutely need to use the category id tag, for multiple posts? - Thanks


title: How to remove filter apostrophe and single quotation

text: My wp version is `3.2.1` In wordpress, the `apostrophe/single quotation` will transfer to `&#039`; And I'd better need to transfer to `%27`; I tried to edit `formatting.php`, in line: `$string = str_replace( "'", ''', $string );` and `$url = str_replace( "'", ''', $url );`, but no effect. So how to do it? Or if it is possible, I think add some `remove_filter function` in `theme's funciton.php` is more better. ( **Note** : only transfer `apostrophe/single quotation`, but keep other quotation formatting.) **BTW** : if I do this change, is it safe for my wordpress? this is also I care about. Thanks.


title: Set class on thumbnail images in plugin list category post

text: I am hoping that someone can help me - How can I set the Class on the Thumbnail images? I have looked here: In the catList.php file                $lcp_thumbnail = 'ID).'">' . get_the_post_thumbnail($single->ID, $this->params['thumbnail_size']) . '';      The default class on the thumbnail looks like this - `class="attachment- thumbnail wp-post-image"` It would be great to set the class on the thumbnail image, via the shortcode. Thanks


title: NextGen Gallery different thumbnail size per gallery

text: How can I instruct NextGen Gallery to use different thumbnail sizes for different galleries. I have different gallery templates for use in different parts of the site, and the sizes of the thumbnails are not the same. At the moment I have to stay generating the thumbnails through the gallery management page, it would be much better if I could set the thumbnail size for each gallery once and for all. Thanks.


title: Getting images to show up in RSS Reader

text: I'm trying to get posts' featured images to show up in RSS Reader. When I look at the raw RSS XML I can see the images are successfully being written into `<description>` and also under `<post-thumbnail>` (via a function I found on a thread here) but I don't see the images showing along with the excerpt in Google Reader, for example. I'm using the following function / filters:               function insertThumbnailRSS($content) {         global $post;         if(has_post_thumbnail($post->ID)){             $content = ''.get_the_post_thumbnail($post->ID, 'thumbnail', array('alt' => get_the_title(), 'title' => get_the_title(), 'style' => 'float:left;')).''.$content;         }         return $content;     }     add_filter('the_excerpt_rss', 'insertThumbnailRSS');     add_filter('the_content_feed', 'insertThumbnailRSS');          add_action('rss2_item', function(){       global $post;            $output = '';       $thumbnail_ID = get_post_thumbnail_id( $post->ID );       $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'thumbnail');       $output .= '<post-thumbnail>';         $output .= '<url>'. $thumbnail[0] .'</url>';         $output .= '<width>'. $thumbnail[1] .'</width>';         $output .= '<height>'. $thumbnail[2] .'</height>';         $output .= '</post-thumbnail>';            echo $output;     });


title: Remove permalink settings in post for users

text: I'm use the following code to remove the permalink settings in a post. This work until the user presses on publish button. Then the permalink settings reappear.               add_action('admin_head', 'wpds_custom_admin_post_css');     function wpds_custom_admin_post_css() {              global $post_type;              if ($post_type == 'post_type') {             echo "<style>#edit-slug-box {display:none;}</style>";         }     }


title: Logout link not working

text: My logout link is not logging me out. May be I am missing something. I tried the below links which is generated by `wp_logout_url(site_url())`. But still I am logged in. > `http://192.168.123.2/mysite/wp- > login.php?action=logout&redirect_to=http%3A%2F%2F192.168.123.2%2Fmysite&_wpnonce=24f1683005` What can be wrong? **More info :** Logout link is in custom menu. I check whether if the user is logged out or logged in by using the function `is_user_logged_in()` from within the `function.php` file.


title: How can i limit wordpress post title characters in sidebar?

text: in wordpress template sidebar and recent posts or recent comments blocks: when title has more than 30 characters new line created and its not good display you can see this image for understand what i say: ![](http://i.stack.imgur.com/I1ydI.png) style for side bar ul li is :               #body-right ul li a {       background: url("../images/blog-point1.png") no-repeat scroll 8px center rgba(0, 0, 0, 0);       color: #45484A;       display: block;       font: 13px/28px 'OpenSansRegular',Arial,sans-serif;       padding-left: 22px;       text-decoration: none;     }          sidebar style:     #body-right ul li {       background: url("../images/blog-body-right-line.png") no-repeat scroll center bottom rgba(0, 0, 0, 0);       direction: rtl;       height: 28px;       line-height: 28px;       list-style: none outside none;       text-align: right;     }      So how can i solve this problem?


title: Making Site A Use Site B's wp-content Folder

text: I'm trying to synchronize two WordPress sites and on my way I've faced few challenges. One of the challenges is to either synchronize the wp-content folder of two sites or make one site use the wp-content of other site for ADDING and RETRIEVING multimedia content. Normally a Wordpress site uses its own wp-content folder but how can we customize the WordPress so that it uses other site's wp-content folder. Visuallization:- ![enter image description here](http://i.stack.imgur.com/KEf4w.png) **Constraints:-**   1. Site A and Site B are on different shared web hostings. Each having its own Cpanel.


title: Page template no longer exists - metaboxes won't save

text: Ok, this is a weird one. I first experienced this on an older theme that I developed - I assumed I had some buggy code in there somewhere, but couldn't figure it out even with the help of another couple developers. Now I have a new theme, super lightweight - no buggy code, and it's happening again. Here's the issue:   1. User has a theme installed with a custom page template - they save their page with this page template.   2. User switches themes, and the page template no longer exists - the "Page Template" option is no longer visible, as the new theme has no page templates.   3. When a user tries to save a options inside of a metabox (any metabox), the option simply reverts back to where it was before saving. When the user creates a new, fresh page - the metabox saves just fine - no issues. This only comes up when a page is looking for a page template that was installed that's no longer there. I assume WordPress would have some sort of check in the core to see if the page template no longer exists - so what's going on? In my old theme, I ended up using this code:               add_action('admin_init','pro_update_page_template_issue');     function pro_update_page_template_issue()     {         global $post;              if ( get_option('pro_updated_page_templates') == 'true' )             return;              add_option('pro_updated_page_templates','true');              $args = array(             'post_status' => 'publish',             'posts_per_page' => -1,             'post_type' => 'page'         );         $posts = get_posts($args);         foreach ( $posts as $post ) {             $page_template = $post->page_template;             if( !locate_template($page_template) ) :                 update_post_meta($post->ID, '_wp_page_template', 'default');             endif;         }     }      This works, but I would rather find the cause of this issue in my new theme. Is this only happening to me? Can anyone else replicate the issue? Thanks!


title: Link category archive from category archive template

text: All my posts belong to categories. There're at least 30 categories and sub- categories with 10 or more posts per category. When opening               http://example.com/category/subcategory       only the latest 3 posts are displayed which is fine. Now I'd like to create a link to a site (`http://example.com/library/category/subcategory` or `http://example.com/category/subcategory/library`) displaying ALL posts of this category. It's not for grouping by year and / or month, just for displaying all posts with a custom template sorted e.g. by date. I searched a lot but did not find a tutorial which fits my needs. Can anybody help me how to do this? I'm using this plugin to assign custom templates to my categories. Let's say I'm using template A for all categories and template B for all sub-categories. To clarify my target: I'm searching for a way to force wordpress to use a template C in order to display ALL posts of a certain category/sub-category. I'd like to insert a link at the bottom of template A and B "Show all posts of this category".


title: register_activation_hook on multisite

text: I am working on creating a plugin for a multisite wordpress framework that is enabled by default for all (by me, the _super administrator_ ) When it activates it is required to create 2 tables where it will store some precedural information. Right now I am working on creating the first (most important) table. The p_install function is called because of the options I set at the end of the function.               global $wpdb;     global $p_db_version;     $table_name = $wpdb->prefix . 'p_table';     $wpdb->p_table = $wpdb->prefix . 'p_table';     $charset_collate = '';     if (!empty($wpdb->charset)) {         $charset_collate = "DEFAULT CHARACTER SET {$wpdb->charset}";     }     if (!empty($wpdb->collate)) {         $charset_collate .= " COLLATE {$wpdb->collate}";     }                              $sql = "CREATE TABLE {$table_name} (       id mediumint(9) NOT NULL AUTO_INCREMENT,       blog_id mediumint(9) NOT NULL,       create_date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,       modify_date datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,       created_by mediumint(9) NOT NULL,       modified_by mediumint(9) NOT NULL,       is_active tinyint(1) DEFAULT 0 NOT NULL,       p tinytext DEFAULT '' NOT NULL,       v mediumint(9) DEFAULT 0 NOT NULL,       c mediumint(9) DEFAULT 0 NOT NULL,       json_data text NOT NULL,       type mediumint(9) DEFAULT 0 NOT NULL,       UNIQUE KEY  id (id)     ) {$charset_collate};";                              require_once(ABSPATH . 'wp-admin/includes/upgrade.php');     dbDelta($sql);                              delete_option('p_db_version');     delete_option('p_db_sql');     delete_option('p_db_timestamp');                              add_option('p_db_version', $p_db_version);     add_option('p_db_sql', $sql);     add_option('p_db_timestamp', date('l jS \of F Y h:i:s A'));      ` But it fails to create the table. Please advise. **Edit 1** After reading PatJ's answer I feel the need to clean up some air:   1. I got my table creation code from the `dbDelta()` documentation   2. I have edited my code and used the **two space** policy # Answer And the answer is that a `datetime` cant have the `CURRENT_TIMESTAMP` default value since **MySQL 5.6.5** so I changed `modify_date` from `datetime` to `timestamp` and all is good. Credits to: sebthebert Thank you.


title: WP Query outputs three items within a div

text:
At present I have a basic query that outputs 12 custom posts, each in a div. I need to restructure this to output four divs, each with three of these items inside. So it's sort of like a nested div. To explain, here is the current HTML output (for 12 items)
the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here
      What I need is something more like this:

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

the content comes out here

      Here is my current query:               <?php          query_posts(array(                      'post_type' => 'custom_job',                     'showposts' => 12                  ) );               ?>             <?php while (have_posts()) : the_post(); ?>

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

<?php echo get_the_excerpt(); ?>

             <?php endwhile;?>


title: Wordpress gallery shortcode - include author's images

text: I'm using the built-in wordpress gallery shortcode to display all images of a category -- documentation found here: Wordpress Gallery Shortcode Codex \--- By using [gallery category="1"] How could I add a filter to only show the images/media the current user has uploaded in the gallery's category? (I have a plugin that allows separating my media library into categories) I have added this code to my function.php which successfully filters the images to only the current user's uploaded images in the backend, but does not work with the gallery shortcode on the front end of a post. functions.php code:               function my_files_only( $wp_query ) {         if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) !== false ) {             if ( !current_user_can( 'level_5' ) ) {                 global $current_user;                 $wp_query->set( 'author', $current_user->id );             }         }     }     add_filter('parse_query', 'my_files_only' );      So I'm looking for something like [gallery category="1" author="%currentuser%"] the wordpress gallery shortcode is listed here: (I choose not to post the code as it is quite large) media.php If this is feature (current user) is not built into the code, how could I add it to this existing code? I'm also open to any plugins that would do the trick, most that I have tried that claim to do the functionality I am wanting have not worked. I would love if this worked with nextgen gallery, but doesn't appear to be in the cards. Thanks!


title: Get image paths from RSS feeds

text: I'm displaying the content from one wordpress blog page on my server onto a different wordpress blog on the same server. Apparently the only way is through RSS feed. The images don't show up. I var_dumped the RSS object and there are no image paths. How do I get the image paths, or the filename of the image? Or how do I force the source blog to include the image information in the feed.


title: Remove Multisite

text: This is a site I'm working on, but did not build. It is on a multisite network- but I would like to get it back to normal. There are no other sites on the network. All of the instructions tell me to remove lines from wp-config and edit htaccess, but I have no htaccess file, and my wp-config does not contain the "Include Multisite" line that all the instructions tell me to remove. Here is my entire wp-config file (with passwords changed): (Edited; please post only the relevant parts of files, and also use the code button.)


title: Manipulated shortcode output

text:
I have a problem with a plugin I developed that registers a shortcode. The shortcode returns a string with valid HTML but some themes seems to manipulate the HTML returned by the shortcode, and I really can't understand what is the reason. For example, this is the correct output of my shortcode:

Kate

      and this is the output I get with some theme:

Kate

      As you can see there is some extra tag after the closing of the 'caption' DIV. Maybe these themes apply some kind of HTML validation/sanitization?


title: How to increase image size returned from Flickr oEmbed in Twenty Twelve theme

text: I've been using the excellent Flickr Gallery plugin for a while but while upgrading a site to WP3.5 and the Twenty Twelve theme, I stumbled across oEmbeds and notice that Flickr is supported natively. I did a quick test and sure enough, simply placing the URL to a Flickr image page produces an image in the post – but it's a tiny 320 pixels wide. Given the content space appears to be about 625 pixels wide, it would be much better to have the 500 pixel image returned. I've found mention of the max width setting, which it now appears is not present in the WP3.5 admin interface. The only reason I was considering switching to the native capability was to remove customisation (the plugin I have is dead easy to use). Do I have to create a child theme simply to set this width? Or am I missing something? Any tips appreciated.


title: Wordpress Setting page can not be saved by html radio

text:
I have this php Code to make a option page that activate a function if the user set "active" and turn off the function, if the user set "Not active".               <?php     add_action('admin_menu', 'custom');     function custom() {     add_menu_page('settings', 'settings', '8', 'custom', 'customfunc');     }     function customfunc(){     $wpp_rg = get_option('wpp_rg');     if ($_POST['submit']):     update_option('wpp_rg',$_POST['wpp_rg']);     endif;     ?>
     <form action="" method="post">

             test mode :
                                   <input name="wpp_rg" type="radio" value="1" id="RadioGroup1_0" <?php echo ($wpp_rg==1 ? 'checked="checked"' : '') ?> />                     active
                                   <input name="wpp_rg" type="radio" value="2" id="RadioGroup1_1" <?php echo ($wpp_rg==2 ? 'checked="checked"' : '') ?>/>                     not active

             	             <input type="submit" name="wpp_submit" value="save" class="button" />

     </form>
     <?php     }          $wpp_rg = get_option('wpp_rg');                    /******************** IF1 ***********************/          if ($wpp_rg==1) {          echo "Active";                    }     if ($wpp_rg==2) {          echo "Not Active";          }     /******************** IF1 ***********************/               ?>      But the problem is that, the html radios are not working ! when i click "not active " and save, nothing happen ! What is the problem ? ?


title: Single page template for custom post_type

text: I registered a custom post type with the following code:               #Register custom post type for Stars of the Month     add_action( 'init', 'sdp_create_star_type' );     function sdp_create_star_type() {              register_post_type( 'sdp_star',             array(                 'labels' => array(                     'name' => __( 'Stars' ),                     'singular_name' => __( 'Star' ),                     'add_new_item' => 'Add New Star of the Month',                     'edit_item' => 'Edit this Star',                     'all_items' => 'All Stars'                 ),             'public' => true,             'has_archive' => true,             'rewrite' => array('slug' => 'stars'),             'menu_icon' => 'dashicons-star-filled',             'menu_position' => 5, //just below posts             'supports' => array('title', 'thumbnail')             )         );         //flush_rewrite_rules(); //<--This doesn't work either     }      I named the template `my_theme/single-sdp_star.php` as per the WP naming conventions. PROBLEM: No matter what I do, the wrong template file gets used: `my_theme/single.php`. I already tried re-saved the permalinks (many times) and this does not help. What else could be I be missing?


title: Adding a Taxonomy Filter to Admin List for a Custom Post Type?

text:
I have created a Custom Post Type called `'listing'` and added a Custom Taxonomy called `'businesses'`. I would like to add a dropdown list of Businesses to the admin list for the Listings. Here is what this functionality looks like in admin list for Posts _(I would like the same for my Custom Post Type):_ ![Categories Dropdown in Posts](http://i.stack.imgur.com/XBYZX.png) Here is my current code _(And here is the same code on Gist.):_               <?php     /*     Plugin Name: Listing Content Item     Plugin URI:     Description:      Author:      Version: 1.0     Author URI:      */          class Listing {       var $meta_fields = array("list-address1","list-address2","list-country","list-province","list-city","list-postcode","list-firstname","list-lastname","list-website","list-mobile","list-phone","list-fax","list-email", "list-profile", "list-distributionrange", "list-distributionarea");            public function loadStyleScripts() {         $eventsURL = trailingslashit( WP_PLUGIN_URL ) . trailingslashit( plugin_basename( dirname( __FILE__ ) ) ) . 'css/';         wp_enqueue_style('listing-style', $eventsURL.'listing.css');       }            function Listing() {         // Register custom post types         register_post_type('listing', array(           'labels' => array(             'name' => __('Listings'), 'singular_name' => __( 'Listing' ),             'add_new' => __( 'Add Listing' ),             'add_new_item' => __( 'Add New Listing' ),             'edit' => __( 'Edit' ),             'edit_item' => __( 'Edit Listing' ),             'new_item' => __( 'New Listing' ),             'view' => __( 'View Listing' ),             'view_item' => __( 'View Listing' ),             'search_items' => __( 'Search Listings' ),             'not_found' => __( 'No listings found' ),             'not_found_in_trash' => __( 'No listings found in Trash' ),             'parent' => __( 'Parent Listing' ),           ),           'singular_label' => __('Listing'),           'public' => true,           'show_ui' => true, // UI in admin panel           '_builtin' => false, // It's a custom post type, not built in           '_edit_link' => 'post.php?post=%d',           'capability_type' => 'post',           'hierarchical' => false,           'rewrite' => array("slug" => "listings"), // Permalinks           'query_var' => "listings", // This goes to the WP_Query schema           'supports' => array('title','editor')         ));              add_filter("manage_edit-listing_columns", array(&$this, "edit_columns"));         add_action("manage_posts_custom_column", array(&$this, "custom_columns"));              // Register custom taxonomy              #Businesses         register_taxonomy("businesses", array("listing"), array(           "hierarchical" => true,            "label" => "Listing Categories",            "singular_label" => "Listing Categorie",            "rewrite" => true,         ));              # Region         register_taxonomy("regions", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Regions' ),             'popular_items' => __( 'Popular Regions' ),             'all_items' => __( 'All Regions' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Region' ),              'update_item' => __( 'Update Region' ),             'add_new_item' => __( 'Add New Region' ),             'new_item_name' => __( 'New Region Name' ),             'separate_items_with_commas' => __( 'Separate regions with commas' ),             'add_or_remove_items' => __( 'Add or remove regions' ),             'choose_from_most_used' => __( 'Choose from the most used regions' ),           ),           "hierarchical" => false,            "label" => "Listing Regions",            "singular_label" => "Listing Region",            "rewrite" => true,         ));              # Member Organizations         register_taxonomy("organizations", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Member Organizations' ),             'popular_items' => __( 'Popular Member Organizations' ),             'all_items' => __( 'All Member Organizations' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Member Organization' ),              'update_item' => __( 'Update Member Organization' ),             'add_new_item' => __( 'Add New Member Organization' ),             'new_item_name' => __( 'New Member Organization Name' ),             'separate_items_with_commas' => __( 'Separate member organizations with commas' ),             'add_or_remove_items' => __( 'Add or remove member organizations' ),             'choose_from_most_used' => __( 'Choose from the most used member organizations' ),           ),           "hierarchical" => false,            "label" => "Member Organizations",            "singular_label" => "Member Organization",            "rewrite" => true,         ));              # Retail Products         register_taxonomy("retails", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Retail Products' ),             'popular_items' => __( 'Popular Retail Products' ),             'all_items' => __( 'All Retail Products' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Retail Product' ),              'update_item' => __( 'Update Retail Product' ),             'add_new_item' => __( 'Add New Retail Product' ),             'new_item_name' => __( 'New Retail Product Name' ),             'separate_items_with_commas' => __( 'Separate retail products with commas' ),             'add_or_remove_items' => __( 'Add or remove retail products' ),             'choose_from_most_used' => __( 'Choose from the most used retail products' ),           ),           "hierarchical" => false,            "label" => "Retail Products",            "singular_label" => "Retail Product",            "rewrite" => true,         ));              # Farming Practices         register_taxonomy("practices", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Farming Practices' ),             'popular_items' => __( 'Popular Farming Practices' ),             'all_items' => __( 'All Farming Practices' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Farming Practice' ),              'update_item' => __( 'Update Farming Practice' ),             'add_new_item' => __( 'Add New Farming Practice' ),             'new_item_name' => __( 'New Farming Practice Name' ),             'separate_items_with_commas' => __( 'Separate farming practices with commas' ),             'add_or_remove_items' => __( 'Add or remove farming practices' ),             'choose_from_most_used' => __( 'Choose from the most used farming practices' ),           ),           "hierarchical" => false,            "label" => "Farming Practices",            "singular_label" => "Farming Practice",            "rewrite" => true,          ));              # Products          register_taxonomy("products", array("listing"), array(           'labels' => array(             'search_items' =>  __( 'Search Products' ),             'popular_items' => __( 'Popular Products' ),             'all_items' => __( 'All Products' ),             'parent_item' => null,             'parent_item_colon' => null,             'edit_item' => __( 'Edit Product' ),              'update_item' => __( 'Update Product' ),             'add_new_item' => __( 'Add New Product' ),             'new_item_name' => __( 'New Product Name' ),             'separate_items_with_commas' => __( 'Separate products with commas' ),             'add_or_remove_items' => __( 'Add or remove products' ),             'choose_from_most_used' => __( 'Choose from the most used products' ),           ),           "hierarchical" => false,            "label" => "Products",            "singular_label" => "Product",            "rewrite" => true,         ));                   // Admin interface init         add_action("admin_init", array(&$this, "admin_init"));         add_action("template_redirect", array(&$this, 'template_redirect'));              // Insert post hook         add_action("wp_insert_post", array(&$this, "wp_insert_post"), 10, 2);       }            function edit_columns($columns) {         $columns = array(           "cb" => "<input type=\"checkbox\" />",           "title" => "Business Name",           "description" => "Description",           "list-personal" => "Personal Information",           "list-location" => "Location",           "list-categorie" => "Categorie",         );              return $columns;       }            function custom_columns($column) {         global $post;         switch ($column) {           case "description":             the_excerpt();             break;           case "list-personal":             $custom = get_post_custom();             if(isset($custom["list-firstname"][0])) echo $custom["list-firstname"][0]."
";             if(isset($custom["list-lastname"][0])) echo $custom["list-lastname"][0]."
";             if(isset($custom["list-email"][0])) echo $custom["list-email"][0]."
";             if(isset($custom["list-website"][0])) echo $custom["list-website"][0]."
";             if(isset($custom["list-phone"][0])) echo $custom["list-phone"][0]."
";             if(isset($custom["list-mobile"][0])) echo $custom["list-mobile"][0]."
";             if(isset($custom["list-fax"][0])) echo $custom["list-fax"][0];             break;           case "list-location":             $custom = get_post_custom();             if(isset($custom["list-address1"][0])) echo $custom["list-address1"][0]."
";             if(isset($custom["list-address2"][0])) echo $custom["list-address2"][0]."
";             if(isset($custom["list-city"][0])) echo $custom["list-city"][0]."
";             if(isset($custom["list-province"][0])) echo $custom["list-province"][0]."
";             if(isset($custom["list-postcode"][0])) echo $custom["list-postcode"][0]."
";             if(isset($custom["list-country"][0])) echo $custom["list-country"][0]."
";             if(isset($custom["list-profile"][0])) echo $custom["list-profile"][0]."
";             if(isset($custom["list-distributionrange"][0])) echo $custom["list-distributionrange"][0]."
";             if(isset($custom["list-distributionarea"][0])) echo $custom["list-distributionarea"][0];             break;           case "list-categorie":             $speakers = get_the_terms(0, "businesses");             $speakers_html = array();             if(is_array($speakers)) {               foreach ($speakers as $speaker)               array_push($speakers_html, 'slug, 'businesses') . '">' . $speaker->name . '');               echo implode($speakers_html, ", ");             }             break;         }       }            // Template selection       function template_redirect() {         global $wp;         if (isset($wp->query_vars["post_type"]) && ($wp->query_vars["post_type"] == "listing")) {           include(STYLESHEETPATH . "/listing.php");           die();         }       }            // When a post is inserted or updated       function wp_insert_post($post_id, $post = null) {         if ($post->post_type == "listing") {           // Loop through the POST data           foreach ($this->meta_fields as $key) {             $value = @$_POST[$key];             if (empty($value)) {               delete_post_meta($post_id, $key);               continue;             }                  // If value is a string it should be unique             if (!is_array($value)) {               // Update meta               if (!update_post_meta($post_id, $key, $value)) {                 // Or add the meta data                 add_post_meta($post_id, $key, $value);               }             }             else             {               // If passed along is an array, we should remove all previous data               delete_post_meta($post_id, $key);                    // Loop through the array adding new values to the post meta as different entries with the same name               foreach ($value as $entry)                 add_post_meta($post_id, $key, $entry);             }           }         }       }            function admin_init() {         // Custom meta boxes for the edit listing screen         add_meta_box("list-pers-meta", "Personal Information", array(&$this, "meta_personal"), "listing", "normal", "low");         add_meta_box("list-meta", "Location", array(&$this, "meta_location"), "listing", "normal", "low");       }            function meta_personal() {         global $post;         $custom = get_post_custom($post->ID);         if(isset($custom["list-firstname"][0])) $first_name = $custom["list-firstname"][0];else $first_name = '';         if(isset($custom["list-lastname"][0])) $last_name = $custom["list-lastname"][0];else $last_name = '';         if(isset($custom["list-website"][0])) $website = $custom["list-website"][0];else $website = '';         if(isset($custom["list-phone"][0])) $phone = $custom["list-phone"][0];else $phone = '';         if(isset($custom["list-mobile"][0])) $mobile = $custom["list-mobile"][0];else $mobile = '';         if(isset($custom["list-fax"][0])) $fax = $custom["list-fax"][0];else $fax = '';         if(isset($custom["list-email"][0])) $email = $custom["list-email"][0];else $email = '';     ?>

Firstname:	<input name="list-firstname" value="<?php echo $first_name; ?>" />

Lastname:	<input name="list-lastname" value="<?php echo $last_name; ?>" />

Email:	<input name="list-email" value="<?php echo $email; ?>" size="40"/>

Website:	<input name="list-website" value="<?php echo $website; ?>" size="40"/>

Phone:	<input name="list-phone" value="<?php echo $phone; ?>" />

Mobile:	<input name="list-mobile" value="<?php echo $mobile; ?>" />

Fax:	<input name="list-fax" value="<?php echo $fax; ?>" />

          <?php       }            // Admin post meta contents       function meta_location() {         global $post;         $custom = get_post_custom($post->ID);         if(isset($custom["list-address1"])) $address1 = $custom["list-address1"][0];else $address1 = '';         if(isset($custom["list-address2"])) $address2 = $custom["list-address2"][0];else $address2 = '';         if(isset($custom["list-country"])) $country = $custom["list-country"][0];else $country = '';         if(isset($custom["list-province"])) $province = $custom["list-province"][0];else $province = '';         if(isset($custom["list-city"])) $city = $custom["list-city"][0];else $city = '';         if(isset($custom["list-postcode"])) $post_code = $custom["list-postcode"][0];else $post_code = '';         if(isset($custom["list-profile"])) $profile = $custom["list-profile"][0];else $profile = '';         if(isset($custom["list-distributionrange"])) $distribution_range = $custom["list-distributionrange"][0];else $distribution_range = '';         if(isset($custom["list-distributionarea"])) $distribution_area = $custom["list-distributionarea"][0];else $ddistribution_area = '';       ?>

Address 1:	<input name="list-address1" value="<?php echo $address1; ?>" size="60" />

Address 2:	<input name="list-address2" value="<?php echo $address2; ?>" size="60" />

City:	<input name="list-city" value="<?php echo $city; ?>" />

Province:	<input name="list-province" value="Ontario" readonly />

Postal Code:	<input name="list-postcode" value="<?php echo $post_code; ?>" />

Country:	<input name="list-country" value="Canada" readonly />

Profile:	<input name="list-profile" value="<?php echo $profile; ?>" size="60" />

Distribution Range:	<input name="list-distributionrange" value="<?php echo $distribution_range; ?>" size="60" />

Distribution Area:	<input name="list-distributionarea" value="<?php echo $distribution_area; ?>" size="60" />

        <?php       }     }          // Initiate the plugin     add_action("init", "ListingInit");     function ListingInit() {        global $listing;       $listing = new Listing();       $add_css = $listing->loadStyleScripts();     }      How can I do add a dropdown list of Businesses to the admin list for the Listings?


title: What is the easiest and cheapest way to sell a download on my website?

text: I know that there are several e-commerce plugins, like JigoShop, WP E Commerce, and Woo Commerce. I also know there area lot of payment gateways like authorize.net and Paypal. However, if I have a really simple piece of software that I want to sell on my website, a single file download, what is the easiest and cheapest way to accomplish this? Can I use one of the WP plugins without having to pay for PayFlow Pro to allow the download?


title: Multi-site User Sessions

text: I have a client that wants to create several WordPress sites and utilize a "site switcher" at the top, sort of like ThemeForest.net. I know in WP 3 you can create multiple blogs on the same installation, but what about enabling users who login to one blog to be logged into all of the blogs in the WordPress installation? Is this possible?


title: Millennial Media PHP Setup ( Code Integration )

text: I know this going to be very easy question for people with good PHP knowledge. I have a WordPress website self hosted. I designed it for mobile devices and I would like to install Millennial Media advertisements in it. Millennial Media does not really provide detailed instructions and web resources strangely are not available! I have knowledge in HTML,CSS and JavaScript but very poor in PHP :( . any way I can do some changes PHP to achieve what I want, but I can't write them from zero and integrate them by my self. Ok long story short This the code provided by Millennial Media:               <?php      /*--------------------------------------------------------------*/      /* Millennial Media PHP Ad Coding, v.7.4.20                     */      /* Copyright Millennial Media, Inc. 2006                        */      /*                                                              */      /* The following code requires PHP >= 4.3.0 and                 */      /* allow_url_fopen 1 set in php.ini file.                       */      /*                                                              */      /* NOTE:                                                        */      /* It is recommended that you lower the default_socket_timeout  */      /* value in the php.ini file to 5 seconds.                      */      /* This will prevent network connectivity from affecting        */      /* page loading.                                                */      /*--------------------------------------------------------------*/           /*------- Publisher Specific Section -------*/      $mm_placementid = 123456;      $mm_adserver = "ads.mp.mydas.mobi";           /* The default response will be echo'd on the page     */     /* if no Ad is returned, so any valid WML/XHTML string */     /* is acceptable.                                      */     $mm_default_response = "";          /*------------------------------------------*/          /*----------- BEGIN AD INITIALIZATION ----------*/     /*----- PLEASE DO NOT EDIT BELOW THIS LINE -----*/     $mm_id = "NONE";     $mm_ua = "NONE";     @$mm_ip = $_SERVER['REMOTE_ADDR'];          if (isset($_SERVER['HTTP_USER_AGENT'] )){          $mm_ua = $_SERVER['HTTP_USER_AGENT'];     }          if (isset($_SERVER['HTTP_X_UP_SUBNO'])) {               $mm_id = $_SERVER['HTTP_X_UP_SUBNO'];     } elseif (isset($_SERVER['HTTP_XID'])) {               $mm_id = $_SERVER['HTTP_XID'];     } elseif (isset($_SERVER['HTTP_CLIENTID'])) {               $mm_id = $_SERVER['HTTP_CLIENTID'];     } else {               $mm_id = $_SERVER['REMOTE_ADDR'];     }          $mm_url = "http://$mm_adserver/getAd.php5?apid=$mm_placementid&auid="               . urlencode($mm_id) . "&uip=" . urlencode($mm_ip) . "&ua="               . urlencode($mm_ua);     /*------------ END AD INITIALIZATION -----------*/     ?>          <?php     /* Place this code block where you want the ad to appear */     /*------- Reusable Ad Call -------*/     @$mm_response = file_get_contents($mm_url);     echo $mm_response != FALSE ? $mm_response : $mm_default_response;     /*--------- End Ad Call ----------*/     ?>      I want the Advertisement to appear in the footer area ( I will edit the footer.php in twenty eleven theme ) but I want to know where shall I put these pieces of codes in wordpress files or shall I create a new ones and what to name them? would some please help me with this issue and provide me with the file's names that required to be edited and how would they look like in the end ? Thanks


title: How to create this kind of sub-menu in new line?

text: In my design I need use this kind of wordpress custom menu. Menu (I am able to do this) ![enter image description here](http://i.stack.imgur.com/7ZtG6.png) Menu element with sub menu. (but not this one) ![enter image description here](http://i.stack.imgur.com/ZLEzB.png) In this UI , I can not able to separate sub-menu to the new line with CSS. Then how can I add specific menu sub menu to new line.


title: Restrict Author role to only 3 wp-admin pages

text:
I allow the author user role to add/edit posts (using a custom post type called "User Posts") as well as add/edit their own media from wp-admin. I currently have it set up so that the only menu items they see are the "User Posts" "New User Post" "Media" and "Upload Media", with these URLs: post- new.php?post_type=tsv_userpost edit.php?post_type=tsv_userpost upload.php media-new.php The only problem is that if the user types in the URL of, for instance, post- new.php (without the custom post type part) Wordpress still allows them to see that page. No bueno. Is there a way to redirect or display an error message to users if they are not admins and if they land on any wp-admin page EXCEPT the above URLs? I have tried using this code (just for the post-new.php page) from another thread, but it doesn't seem to do anything:               //Show error message if authors try to access wrong wp-admin pages     add_action('admin_head','my_restrict_access');     function my_restrict_access_meassage(){         global $pagenow;         if ($pagenow == 'post-new.php' && !current_user_can( 'switch_themes' )){             echo '

You Dont have the right permissions to access this page

';             exit();         }     }      Thanks is advance. **EDIT:** Here's the code I ended up with that works:                       //Restrict access to authors in wp-admin pages         //Show error message if authors try to access wrong wp-admin pages         add_action('admin_head','my_restrict_access');         function my_restrict_access(){             $Path=$_SERVER['REQUEST_URI'];             $basepath='http://www.theseattlevine.com/wordpress/wp-admin';             $URI='http://www.theseattlevine.com'.$Path;                      if      (   ($URI ==($basepath . '/post-new.php')) && !current_user_can ('manage_categories') ) {                             echo    '

You Dont have the right permissions to access this page. Try these links instead:

The Vine Homepage

Add a new user post

Your dashboard

';                             exit();                             }                 elseif      (   ($URI ==($basepath . '/edit.php')) && !current_user_can ('manage_categories') ) {                             echo    '

You Dont have the right permissions to access this page. Try these links instead:

The Vine Homepage

Add a new user post

Your dashboard

';                             exit();                             }              }


title: How can I detect whether a BuddyPress page is active from within my theme?

text: I'm trying to work sub-menus into my theme but am running into issues when navigating to BuddyPress pages (as opposed to standard WP pages, posts, etc.). Basically, what I want to do is have pages (where appropriate) display a sub menu, ala: ![http://skitch.com/zamoose/d12ns/about-us-delta-sigma-theta-sorority-inc- south-jersey-alumnae-chapter](http://i.stack.imgur.com/cIZie.jpg) But when I navigate to pages that exist under BuddyPress' control, I get the following: ![http://skitch.com/zamoose/d12nu/delta-sigma-theta-sorority-inc-south-jersey- alumnae-chapter](http://i.stack.imgur.com/fgSgM.jpg) I'm using the following to generate the sub-menu:               if (is_page()) {       global $wp_query;            if( empty($wp_query->post->post_parent) ) {         $parent = $wp_query->post->ID;       } else {         $parent = $wp_query->post->post_parent;       }            if(wp_list_pages("title_li=&child_of=$parent&echo=0" )) { ?>         <ul id="subnav">         <?php            wp_list_pages("title_li=&child_of=$parent&echo=1" );         ?>         </ul>         <?php        }     }      Where am I going astray?


title: Move excerpt meta box to above content editor

text: I found a WordPress hook called "`edit_form_after_title`" to add a text box after the title. How can I use this hook to display the excerpt after the title while creating a new post?


title: Why isn't is_home() working correctly?

text: I put a `if(is_home())` bit in my theme's functions.php and it doesn't seem to work. The function containing this bit is called on init so `is_home` should work already.


title: Show contact 7 form in popup

text:
I am creating map link on a image and it has two links to open video and contact form. I am making popup with _lightbox_ but its not working. here is my code.. ## HTML
                  <?php echo do_shortcode("[contact-form-7 id='4' title='Registration Form']"); ?>
      ## CSS               div.map {         position: relative;     }          div.map > img {         display: block;         max-width: 100%;     }          div.map > a {         display: block;         position: absolute;     }          div.map > a:hover {         background-color: rgba(255, 0, 0, .5);     }          div.map > a.a {         top: 0;         left: 0;         width: 50%;         height: 50%;     }          div.map > a.b {         top: 0;         left: 50%;         width: 20%;         height: 50%;     }          div.map > a.c {         bottom: 0;         right: 0;         width: 20%;         height: 50%;     }          #pop-up-form { display: none; }


title: How to add option box in "Edit Post" plugin API?

text: This might be kind of simple, but I couldn't find a way to do so in the WP docs. My plugin currently uses custom fields for things I could just have radio buttons/check boxes for each post. How do I add a little section where I can have such options rather than custom fields?


title: Add filter to the end of the post

text:
I have a function which is used to display a video, I want this video to be shown after the post, It should display the video when the post ends. I have added filter to it, but then too, the video is shown before the post. Here is the filter which I am using:               function append_the_video($content) {                 global $post;                 $content .= youtube_video();                 return $content;                 }         add_filter('the_content', 'append_the_video');      edited entire function               <?php     function youtube_video()     {     ?>
          <?php           $newvar = urlencode(get_the_title());     include_once(ABSPATH . WPINC . '/rss.php');     $rss = fetch_rss('http://gdata.youtube.com/feeds/base/videos?q='.$newvar.'&client=ytapi-youtube-search&v=2');         $maxitems = get_option('novideos');              $items =is_array($rss->items) ? array_slice($rss->items, 0, $maxitems) : '' ;                                 ?>
     <?php if (empty($items)) {echo "No current video uploads by ".get_the_title();}     else foreach ( $items as $item ) : ?>     <?php     $youtubeid = strchr($item['link'],'=');      $youtubeid = substr($youtubeid,1);     ?>
Latest Videos of <?php the_title(); ?>:

     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="320" height="265">     <param name="movie" value="http://www.youtube.com/v/<?php echo $youtubeid ?>&hl=en&fs=1" />          <object type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $youtubeid ?>&hl=en&fs=1" width="320" height="265">
<a href="http://www.youtube.com/v/<?php echo $youtubeid ?>">View movie»
          </object>          </object>
     <?php endforeach; ?>

     <?php          }     function append_the_video($content) {             global $post;             $content .= youtube_video();             return $content;             }     add_filter('the_content', 'append_the_video');          ?>


title: How can I do a URL redirection when an user uses wrong login details?

text: I have got this form for login from the front-end.                  <form action="<?php echo site_url('wp-login.php', 'login_post'); ?>" method="post" <?php /*id="login-page-form"*/ ?>>                                      <?php _e('Usuario', 'gp_lang'); ?>                                 <input type="text" name="log" id="log" value="<?php echo esc_html(stripslashes($user_login), 1) ?>" size="22" placeholder="<?php _e('Usuario', 'gp_lang'); ?>" />                                      <?php _e('Contraseña', 'gp_lang'); ?>                                 <input type="password" name="pwd" id="pwd" size="22" placeholder="<?php _e('Contraseña', 'gp_lang'); ?>" />                                      <input type="submit" name="submit" value="<?php _e('Login', 'gp_lang'); ?> →" class="button" />                                 <input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> <?php _e('Recuerdame', 'gp_lang'); ?>                                 <input type="hidden" name="redirect_to" value="<?php if(preg_match("/key=/", $referrer)) { echo home_url(); } else { echo $referrer; } ?>"/>          </form>      Everything works fine except when the user uses wrong login details. If an user enters a wrong username or password the next page is "wp-login.php". But I want it to redirect to my homepage (get_site_url) with proper message to the user about the wrong login.


title: Plugin to turn off RTE on select page

text: Anyone know of the plugin that lets you selectively turn off the RTE, on a per-page or posts basis?


title: better wordpress minify problem

text: i am using better wordpress minify plugin but it breaks site due to one of css file               http://www.mydomain.net/?mcsf_action=main_css&ver=3.1.1      i would like to add it into exception list so that it ignores it here's screen-shot for admin panel http://bayimg.com/jaHFdAaDj it says **Type in one script handle (NOT filename) per line** so what should be the script handle in this case thanks it looks like this `http://www.domain.net/wp-content/plugins/bwp- minify/min/?f=?mcsf_action=main_css&ver=1.2.2,wp-content/plugins/wp-e- commerce/themes/ishop/ishop.css,wp-content/plugins/wp-e- commerce/themes/compatibility.css,wp-content/plugins/wp-e- commerce/js/product_rater.css,index.php?wpsc_user_dynamic_css=true&category=5,wp- content/plugins/wp-e-commerce/js/thickbox.css` firephp shows Minify: GET param 'f' invalid (see MinApp.php line 63)


title: WordPress Cron how to find out my event recurrence?

text: In my plugin I'm able to set a cron event like so:               wp_schedule_event(time(), 'daily', 'myhookname');      But want I want to do is be able to find out what recurrence I have set for `myhookname`. The reason why is that I'm offering a setting to allow the recurrence to be changed. What I need to do is check if the recurrence setting has changed from what its currently set as and if so remove the event and reschedule the event with the new recurrence. So if there a function like this:               $recurrence = wp_current_event_recurrence('myhookname'); // returns hourly/daily/etc


title: Title how does page no work in Twenty Eleven

text: I would like to understand how does twenty eleven title page no works.. sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) ); I dont understand the above part as in the __() function the arguments are $text and $domain what is $domain and how does %s print's no. Below is the whole code of title thank you               <title><?php     /*      * Print the <title> tag based on what is being viewed.      */     global $page, $paged;          wp_title( '|', true, 'right' );          // Add the blog name.     bloginfo( 'name' );          // Add the blog description for the home/front page.     $site_description = get_bloginfo( 'description', 'display' );     if ( $site_description && ( is_home() || is_front_page() ) )         echo " | $site_description";          // Add a page number if necessary:     if ( $paged >= 2 || $page >= 2 )         echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );          ?></title>


title: How to Loop with the final result formatted differently?

text: I need to list post_title's in this specific format (note the last title in the list **must not** have a comma)                   "post_title","post_title","post_title"      I thought a mini-loop might work. Here's what I'm using                           <?php query_posts('cat=0$posts_per_page=-1'); // query to show all posts independant from what is in the center;                     if (have_posts()) :                         while (have_posts()) : the_post(); ?>                             '<?php the_title(); ?>',                         <?php endwhile; endif;                     wp_reset_query();                     ?>]">      But I need the final post_title to have no trailing comma?