title: CSS styling of native (inbuilt) wordpress thumbnails

text: I really hope someone will be able to help me with this as it should be really simple but I am struggling! I am working on the 'native' or inbuilt wordpress thumbnail gallery (not a plugin). I want to make it responsive. At the moment, on smaller screens, the thumbnails just get smaller... I am trying to have them re-arrange themselves so that for example on screens above 1000px wide there are 5 thumbnails in a row, then between 700and 1000 px it goes down to 3 etc.. So my questions are: -where in the wordpress folder is/are the css file(s) that affects these thumbnails? (they are the native, or inbuilt thumbnails that come with wordpress, regardless of my theme) -How would you go about doing this? I want to set up media queries in the CSS file mentioned above, once I find which one it is... does that sound right? I am thinking of keeping the original styling and adding stuff to it, including the media queries. Is that possible or do I need to unhook the css and thenrewrite it from scratch? If that is the case, how do I unhook? In which file does this happen? Any help at this stage would be most gratefully received... any help, pointers, snippets etc would be a huge help. Thanks in advance, Maya


title: Add register form inside theme template

text: Goodafternoon guys, I was wondering how I can add a custom register form inside my wordpress theme. So it will fit the styling of the website and doesn’t redirect to the normal register and login form. I look out for your response. Thank you.


title: Return code from save_post action?

text: I'd like to understand what value I should return from a WordPress `save_post` action function. This example from the save_post documentation both explicitly and implicitly returns without a value:               function my_project_updated_send_email( $post_id ) {              // If this is just a revision, don't send the email.         if ( wp_is_post_revision( $post_id ) )             return;              $post_title = get_the_title( $post_id );         $post_url = get_permalink( $post_id );         $subject = 'A post has been updated';              $message = "A post has been updated on your website:\n\n";         $message .= $post_title . ": " . $post_url;              // Send email to admin.         wp_mail( 'admin@example.com', $subject, $message );     }     add_action( 'save_post', 'my_project_updated_send_email' );      However, this example from the add_meta_box documentation very specifically returns the $post_id that was passed in if it returns early, but returns nothing if the function executes to the end.               /**      * When the post is saved, saves our custom data.      *      * @param int $post_id The ID of the post being saved.      */     function myplugin_save_postdata( $post_id ) {            /*        * We need to verify this came from the our screen and with proper authorization,        * because save_post can be triggered at other times.        */            // Check if our nonce is set.       if ( ! isset( $_POST['myplugin_inner_custom_box_nonce'] ) )         return $post_id;            $nonce = $_POST['myplugin_inner_custom_box_nonce'];            // Verify that the nonce is valid.       if ( ! wp_verify_nonce( $nonce, 'myplugin_inner_custom_box' ) )           return $post_id;            // If this is an autosave, our form has not been submitted, so we don't want to do anything.       if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )            return $post_id;            // Check the user's permissions.       if ( 'page' == $_POST['post_type'] ) {              if ( ! current_user_can( 'edit_page', $post_id ) )             return $post_id;            } else {              if ( ! current_user_can( 'edit_post', $post_id ) )             return $post_id;       }            /* OK, its safe for us to save the data now. */            // Sanitize user input.       $mydata = sanitize_text_field( $_POST['myplugin_new_field'] );            // Update the meta field in the database.       update_post_meta( $post_id, '_my_meta_value_key', $mydata );     }     add_action( 'save_post', 'myplugin_save_postdata' );      There's no indication on that page of why it's returning `$post_id` if it returns early. There doesn't seem to be any actual documentation on the save_post Codex page one way or the other. I've seen conflicting advice around the web, too. The example of creating an Action function in the Plugin API documentation looks like it's also a `save_post` action, and returns the `$post_id` passed in on success, though it doesn't say why:               function email_friends($post_ID)  {         $friends = 'bob@example.org,susie@example.org';         mail($friends, "sally's blog updated",            'I just put something on my blog: http://blog.example.com');         return $post_ID;     }      Can anyone tell me what I, if anything, I should be returning from my `save_post` actions, and why, preferably with some kind of official reference?


title: Wordpress as a Facebook app

text: I´m setting up a WP based app and due to some limitations on facebook page tabs and mobile phones I´m trying to set up a redirect that directs the pages accourding to device and if its visited through either page_tab, direct url or canvas. ie. The redirect URL is set in a Custom Field for the specific page visited, if that isnt set it suppose to determin what post type it is before redirecting one or the other way. If its visited by cellphone it should redirect at all but run the page as normal. If the page is visited directly though browser it shour redirect to the custom field url set (if posttype is page) and to a specific canvas app if the post type is "course"... If visited (with appdata set / through facebook page tab) it should show as normal... Because of the redirect it needs to be in header before any other headers are sent (?) The question is... How can I on a efficient way - redirect users that visit a URL directly ie. //fu.viralapps.no/tamtamtam to the facebookversion //www.facebook.com/TheTamTampage/App123123123. but only when the site is visited through a desktop/laptop computer. And not through a smartphone/pad. AND the page to redirect to is diffrent for each page (redirect url set as custom field in WP page) //fu.viralapps.no/tamtamtam => //www.facebook.com/TheTamTampage/App123123123 //fu.viralapps.no/tamtamtam2 => //www.facebook.com/TheTamTampage/App232323232 //fu.viralapps.no/tamtamtam3 => //www.facebook.com/TheTamTampage/App3434343434 The facebookpage - tab/app will not redirect its iframed page because it contains a "Signed Request" automaticly through facebook. Here is my code so far... (some echos for debugging added)               <?php     $signed_request = $_REQUEST['signed_request']; // Get the POST signed_request variable.           if(isset($signed_request)) // Determine if signed_request is blank.      {      $pre = explode('.',$signed_request); // Get the part of the signed_request we need.      $json = base64_decode($pre['1']); // Base64 Decode signed_request making it JSON.      $obj = json_decode($json,true); // Split the JSON into arrays.      $page = $obj['page']; // Get the page array. It has a sub array.           echo("Your App Data: " . $obj['app_data']);               // RUN PAGE AS PLANNED!               $geturl = "appdata found";                }      else      {          // NO APP DATA FOUND - CHECK IF WE ARE MOBILE               //detect user agent.     $useragent=$_SERVER['HTTP_USER_AGENT'];     if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i',$useragent)||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($useragent,0,4)))          //Mobile detected - Stay on this URL     {          $geturl = "mobile";                         }else          //No mobile - Redirect for Facebook Page Tab / canvas         {                  //get the url for the current page             $isgeturl = get_field('redirect_app_url');                  if(isset($isgeturl)){                 //WE HAVE A SET URL                 $geturl = $isgeturl;             }else{                 //WE DONT HAVE A SET URL                      //What are we dealing with?                 $PostType = get_post_type( get_the_ID() );                      if ($PostType == "course") {                     $geturl = "https://apps.facebook.com/fu-kurs/" . the_slug();                 }else {                     $geturl = "https://fu.viralapps.no/?ref=confused";                 }                            }                 // header('location: '.$geturl);             echo $geturl;         }          // die('No signed request avaliable.'); //If there is no signed_request, stop processing script.      }          ?>


title: Assign a list of categories with a parent category

text: I imported hundreds of locations and other categories. Now I have a list of locations in categories to which I would like to assign the "Location" category as its parent. I have tried sql but the structure is a bit too complex. And I looked around for a plugin but with no luck. Thanks a lot for helping.


title: How to show only text from post in WordPress

text: How do I retrieve just the text of a post in WordPress not including any pictures?


title: WP 3.3 > Still no option to enable automatic image overwrites?

text: I was really excited to see the new functionality with the media manager in WP 3.3 (specifically drag and drop uploads and automatic file type recognition) But I was disheartened to see no relief in terms of the confusing manner in which WP continues to handle image overwrites (by appending a number to the image and creating a duplicate version). Does anyone have a workaround that I can implement in my theme's functions.php to enable automatic image overwrites, replacing the original image with the new one, and without changing the filename?


title: simply loop through posts

text:
I know this is a really newbie question, but I can't seem to get the loop to pull from the posts. all it is doing is pulling from the page itself. I made a template and added the loop to it.               <?php     if( have_posts() ) {       while( have_posts() ) {         the_post();         ?>
<?php the_title(); ?>
         <?php       }     }     ?>      edit: here is all the code: http://pastebin.com/k2rDu53b


title: Creating an Events Feed with Sub Pages/Posts for Each Event

text: I am currently working on creating an events section for a website. My original plan was to create a custom post type for Events and create a new post for each event. Then I would query the top five events on the home page. My problem is that I need to have sub pages/posts for each event. These pages/posts will need to show up in a sidebar when the single event post is viewed. Is that possible? Can I create a parent/child relationship with each event post and its sub posts or would it be better to use custom taxonomies to organize this information? The site will be client updated, so I need to create a system that is straightforward and sustainable with a logical permalink structure. Any help would be greatly appreciated. Thanks!


title: Post UI Tabs plugin double fade effect

text: After clicking a tab (any tab), the fade in effect occurs twice. Curious how to only have this occur only once. I disabled every plugin to ensure that this was not a JS conflict elsewhere and it appears to be isolated to this plugin: http://www.ernestsports.com/products/ernest-sports-es12-golf-improvement/ Great plugin. Works like a champ! Thanks in advance ~


title: Read more doesnt work with query posts

text: The tite says it all. If I comment out the `query_posts` it works, if I don't it doesn't.               <?php // retrieve one post with an ID of 1     query_posts('p=27');      global $more;     $more = 1;     ?>     <?php while (have_posts()) : the_post(); ?>          <?php the_content('read more'); ?>     <?php endwhile;?>


title: How to rename theme's root directory?

text: I want to rename the theme's root folder for security purpose. I put these in `wp-config.php` file: But I want to rename the theme's root directory also:                define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/assets' );      define( 'WP_CONTENT_URL', 'http://www.domain.in/assets');           define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/extension' );      define( 'WP_PLUGIN_URL', 'http://www.domain.in/assets/extension');      So, how to rename the theme's root folder like this way?


title: What is the proper url for facebook api to work with wordpress?

text: This may seem silly but after google searching it I was unable to find a solution. I'm using the newest facebook PHP SDK and wordpress. I've tested my code in plain php and it works like a charm. When I convert it into wordpress plugin I am unable to provide the correct facebook url. When I click on the connect button I get the warning: > Given URL is not allowed by the Application configuration.: One or more of > the given URLs is not allowed by the App's settings. It must match the > Website URL or Canvas URL, or the domain must be a subdomain of one of the > App's domains. No matter how I rearrange the urls I continue to receive this error when attempting to connect. Can anyone provide insight on what is the proper way to integrate the two and make the url proper?


title: Sidebars are no longer working

text: I am trying to figure out why my sidebar is no longer working. I tried reinstalling my theme, disabling all of my plugins, and uploading a fresh version of widgets.php, with no luck. I am using the Photogram theme, but the problem doesn't go away if I change to a different theme. Here is what I see when I go to my widgets page: ![Widgets page](http://i.stack.imgur.com/7gIpw.png) ![Zoom in of the area](http://i.stack.imgur.com/VLQl6.png)


title: Prevent certain subscribers from seeing specific taxonomies (changes frequently)

text: I've created a taxonomy (let's call it `tax`). I need to limit what a user can see. The users can't edit anything, just read the blog. If it was just setting what they could see once, I'd probably just create a new user role, but what they will be viewing will change frequently.   So for an example:                  user1 can view tax1, tax4        user2 can view tax3        user3 can view tax1, tax2      Then next week that all changes (kinda like checking out a movie or a book then returning it).      How can a make sure that the users can't view any other taxonomies than the ones they're assigned?      I'm hoping there is a function that I just haven't found that is something like:               if(!get_taxonomy(ID)){         echo "You're not permitted to view this";     }else{         //Continue with showing page...     }            I already have things set up so that in their user profiles I can assign them their taxonomies. So on the frontend when the page pulls up I can check which taxonomies they can see. But they can still navigate to other taxonomies. If they see that they're on `http://website/tax1/` then they could just type in `http://website/tax2/` and see the other taxonomies.      This has to be done on an individual user basis and not assigned to a role since there will be so many different users and so many different taxonomies.      Sorry I can't provide a live example; it's being developed locally and it contains some sensitive info.      If I need to clarify anything I'm more than happy to.      Thanks for the help!


title: Buddypress register.php user redirect

text: In my buddypress I have set the register page as homepage. Now whenever a logged-in user tries to access the register page(homepage), they are redirected to Members directory. I want it to change to, home page. is there any way? I have tried changing the buddypress/bp-members/bp-members-signup.php file this way:               // If the user is logged in, redirect away from here     if ( is_user_logged_in() ) {         if ( bp_is_component_front_page( 'register' ) )             $redirect_to = bp_get_root_domain() . '/' . bp_get_members_root_slug();         else             $redirect_to = bp_get_root_domain();              bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );              return;     }      To this:               // If the user is logged in, redirect away from here     if ( is_user_logged_in() ) {         if ( bp_is_component_front_page( 'register' ) )             $redirect_to = bp_get_root_domain() . '/';         else             $redirect_to = bp_get_root_domain();              bp_core_redirect( apply_filters( 'bp_loggedin_register_page_redirect_to', $redirect_to ) );              return;     }      **I am getting this error:** The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. Anyone knows how to fix this?


Is it possible to make the heading on a page different text to the text of the menu item? I have a page with a very long title and I'd like to make the clickable menu text shorter. Site is here: http://richardclunan.com


title: Best way to sort estates and query them (for rent? yes/no. contains office space? yes/no)?

text: I´m building a real estate site where Estates is a custom post type. I want to be able to tick a checkbox or something similare on the edit page, where I can choose if the estate is for rent, if it contains office space etc. And then be able to query against this in different templates. I´m wondering what´s the best way to achive this. I´m using 'Advanced Custom Fields' to type in a lot of information about the estates and that is working well. I thought I could just use a custom field checkbox for this aswell but it seems you can´t query against a custom field value if the values are in an array. Should I be using taxonomies instead? I could do that, but it makes less sense for the user and I don´t want them to be able to add terms, which they can. Any suggestions?


title: Using True Type Fonts (ttf)

text: I have found some nice True-Type fonts on the web, and I would like to use them for specific roles in a specific theme of my WP blog (e.g., `H2` or post titles). How do I change the theme to use the fonts for these roles?


title: What file is the standard frontpage that lists all the posts?

text: I want to edit something in my theme but i can't find the file that lists all the blogposts on the homepage. In the 'Reading' settings i have: Front page displays - your latests posts as the chosen option. When i edit index.php i cannot see the changes so that is not it. So what phpfile does wordpress use to generate 'your latest posts' ? Thanks in advance!


title: How to display this meta data (an array) in form of a function (created with a custom write panel)?

text:
I'm using the following code to create custom write panels:               <?php          $key = "project";     $meta_boxes = array(         "project_services" => array(             "name" => "project_services",             "title" => "Services",             "description" => "List the services provided for the project."),         "project_name" => array(             "name" => "project_name",             "title" => "Name",             "description" => "Write the name of the project."),         "project_overview" => array(             "name" => "project_overview",             "title" => "Overview",             "description" => "Write an overview of the project.")         );          function create_meta_box() {         global $key;              if( function_exists( 'add_meta_box' ) ) {             add_meta_box( 'new-meta-boxes', ucfirst( $key ) . ' Description', 'display_meta_box', 'post', 'normal', 'high' );         }     }          function display_meta_box() {         global $post, $meta_boxes, $key;     ?>
          <?php         wp_nonce_field( plugin_basename( __FILE__ ), $key . '_wpnonce', false, true );              foreach($meta_boxes as $meta_box) {             $data = get_post_meta($post->ID, $key, true);     ?>
     <label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?>     <input type="text" name="<?php echo $meta_box[ 'name' ]; ?>" value="<?php echo htmlspecialchars( $data[ $meta_box[ 'name' ] ] ); ?>" />
<?php echo $meta_box[ 'description' ]; ?>

          <?php } ?>
     <?php     }          function save_meta_box( $post_id ) {         global $post, $meta_boxes, $key;              foreach( $meta_boxes as $meta_box ) {             $data[ $meta_box[ 'name' ] ] = $_POST[ $meta_box[ 'name' ] ];         }              if ( !wp_verify_nonce( $_POST[ $key . '_wpnonce' ], plugin_basename(__FILE__) ) )             return $post_id;              if ( !current_user_can( 'edit_post', $post_id ))             return $post_id;              update_post_meta( $post_id, $key, $data );     }      Now, I can call that metadata in the following way:               <?php $data = get_post_meta( $post->ID, 'project', true ); ?>
<?php echo $data[ 'project_services' ]; ?>
      But I would like to call it in this way:
<?php project_services(); ?>
      Any suggestions?


title: Is there a way of posting or inserting content directly to the database (without entering the wp-admin)?

text: Is there a way of for instance, insert a post and assign a category to it, without accessing Wordpress' back-end?


title: Using Custom Post Meta Values in Shortcode

text: I'm trying to display meta content from a custom post type in a shortcode. I'd like to simply provide a post_id and be able to display all the meta content.               [my_shortcode post_id=""]      I'm new to PHP and writing shortcodes, this seems as though it should be fairly simple... I know the following is wrong:               function promotion_function($atts) {     extract(shortcode_atts(array(         'promo_id' => '',     ), $atts));     global $post;     $meta_values = get_post_custom($promo_id, 'product_desc');          $output = $meta_values;     return $output;     }     add_shortcode('promotion', 'promotion_function');      The above code gives me the string "Array" in my page. I can't find an example of how to do this, any help would be greatly appreciated.


title: How to add another user to this remove_menu function?

text: Pretty self-explanatory. How does one add another user to this function for functions.php, i.e., user2, who will be shown different menu items than user1? I tried adding another `if($current_user->user_login == 'user2')` condition, but no luck. User2 will have different admin rights, if that matters. But basically, I need to be able to show one set of menu items to user1 and another set to user2, so I need to figure out some if else logic. But I tried that, and I get a "can't redeclare a previously declared" error for the menu function.                 function remove_menus()     {         global $menu;         global $current_user;         get_currentuserinfo();              if($current_user->user_login == 'user1')         {             $restricted = array(                                 __('Links'),                                 __('Comments'),                                 __('Appearance'),                                 __('Plugins'),                                 __('Profile'),                                 __('Tools'),                                 __('Settings')             );             end ($menu);             while (prev($menu)){                 $value = explode(' ',$menu[key($menu)][0]);                 if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}             }             }     }          add_action('admin_menu', 'remove_menus');


What is the benefits of the table 'wp_term_taxonomy' in wordpress, why they don't collect all terms data in the table 'wp_terms' like that: id name slug term_group taxonomy description parent count what is the principle they depends on ?


title: Does using a custom query_var create a security hole?

text: Say I put the following code in functions.php               function add_my_query_vars($qvars) {       $qvars[] = "new_var";       return $qvars;     }          add_filter('query_vars', 'add_my_query_vars');      If somebody requests `my.site.com/?new_var=[MALICIOUS CODE]`, can they cause any damage? If not, why not? **Edit for clarity** : I know that user input should be considered harmful. My question is whether WP vets the data that makes it into $wp_query.


title: Force string into signup form

text:
I am running WP multi-site and BP. The plugin in question is Anti-Splog by WPMUDEV. They have advised they do not support customisations. Anti-Splog tries to limit spam blogs from appearing on your multi-site network. I am running a subdomain install. Therefore, on the form where the signup for a subdomain occurs, I want to autofill the value of the form box, and lock it so the user sees the subdomain. However, even by forcing the $string as the value, it will not continue on to create the new subdomain blog. It says, please enter a value. This is the random string code:                  $subdomainhash = array_merge(range(0,9),range('a','z'));        shuffle($subdomainhash);        $newsubdomain = implode('',array_slice($subdomainhash,0,32));        echo $newsubdomain;      Now, to force users to use that string on the select subdomain form I have to edit the following code:                   ' . __('Site Domain:') . '';          if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
<?php echo $errmsg ?>
     <?php }          if ( !is_subdomain_install() )              echo '' . $current_site->domain . $current_site->path . '<input name="blogname" type="text" id="blogname" value="'. esc_attr($blogname) .'" maxlength="60" />';     else         echo '<input name="blogname" type="text" id="blogname" value="'.esc_attr($blogname).'" maxlength="60" />.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '';          if ( !is_user_logged_in() ) {         if ( !is_subdomain_install() )          $site = $current_site->domain . $current_site->path . __( 'sitename' );         else             $site = __( 'domain' ) . '.' . $site_domain . $current_site->path;              echo '
(' . sprintf( __('Your address will be %s.'), $site ) . ') ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '
';     }      It doesn't seem to matter if I force $blogname or $site to be $newsubdomain. It does not fill the value of the form, or replace the above strings. I can't get it working? The subdomain box needs to be the random subdomain string above on a new site registration. Can any php guru could help please? Thanks in advance, Johnny


title: Adding more tabs to horizontal navigation bar

text: currently i'm using raindrops theme developing my page. Raindrops is using 'menu-header', 'theme_location' => 'primary')); ?> to generate the horizontal navigation bar, which only shows a tab linked to posts->categories. I wish to add more tabs beside the original tab, such as faq, contact us etc. which can be linked to pages, posts or other url's etc, how can it done? thanks


title: contact 7 plugin stops some pages from working properly

text: I started to use contact 7 plugin and I'm having a slider and some effects on other images when i activate the plugin they stop working this is the web page               http://www.digitalways.com.sa/       I don't understand what it do! if it stops the javascript or css files but I searched in the files if it has the same names and stopping them from working but it have different names i tried to add this code to function.php so i could add jQuery by the right way but it gave me server error               jQuery(document).ready(function(){     function my_init() {     if (!is_admin()) {         // comment out the next two lines to load the local copy of jQuery         wp_deregister_script('jquery');          wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js', false, '1.3.2');          wp_enqueue_script('jquery');     }      }       add_action('init', 'my_init');       });


title: wp-e-commerce plugin - Second Test Gateway payment option

text: How can I add a second Test gateway to wp-e-commerce payment options? I need one for cash-on-delivery and a second for Bank-Transfer. A similar question was asked at wp-e-commerce plugin - custom payment option but the answer does not cover this issue.


title: How do I get rid of or change the footer in my child theme?

text: I want to remove the default theme name and "powered by WP" text in the footer of every page. I've created a child theme to hold all my customizations from the original theme so that my customizations won't be obliterated when the original theme is updated. Where can I change the text that is generated into the "colophon" div?


title: Wordpress where clauses in db select

text: I'm currently struggling with implementing a feature for wordpress site. I would like to get the count of all users which have the key `pending_approval='true'` and `is_photographer='true'` (located in `wp_usermeta`. How could that be achieved? I've been searching through the documentation, but I couldn't find an proper example. Example code:               $users_sent_to_admin = new WP_User_Query(array(                                                  'meta_query' => array(                                                      array(                                                          'key' => 'pending_approval',                                                          'value' => 'true',                                                          'compare' => '='),                                                      array(                                                          'key' => 'is_photographer',                                                          'value' => 'true',                                                          'compare' => '='                                                      ),                                                  )                                              ));          $users_sent_to_admin = new WP_Query($users_sent_to_admin);


title: How do I get resized thumbnails?

text: I'm getting post thumbnails by calling `the_post_thumbnail(array(400,300), true);` However, this displays the fullsize featured image, just resized with the html "height" and "width" tags. This is not good for loading times. I've tried regenerating thumbnails and that doesn't make a difference. Isn't there a way to get thumbnails that have been resized?


title: Using htaccess and php to protect file, MIME problem

text: I'm using the method described here: Protecting WordPress Media Uploads Unless User Is Logged In (Based off of How to Protect Uploads, if User is not Logged In?. The redirect is working perfectly, yet when a logged in user does try to access the folder, the file appears corrupt. (PDFs blank gray screen and an error message "this pdf may not be diplaying correctly" and images show a blank screen and an image which displays "The image [image-name] cannot be displayed because it contains error."               `$mime = wp_check_filetype($file);     if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )     $mime[ 'type' ] = mime_content_type( $file );          if( $mime[ 'type' ] )     $mimetype = $mime[ 'type' ];     else     $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );      The culprit is in this segment:               header( 'Content-Type: ' . $mimetype ); // always send this     if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) )     header( 'Content-Length: ' . filesize( $file ) );`      When I comment out this section, the errors go away, but the file returns a garbled mess of language instead of the actual rendering of the file. Anyone faced this problem before or have any ideas as to what I could check for? Thanks in advance. UPDATE: The plugin http://omninoggin.com/wordpress- plugins/wp-minify-wordpress-plugin/ is causing the conflict. I will disable it for now.


title: Display multiple custom post type lists on homepage - multiple loops

text:
I've got to display 6 boxes on the homepage of a site I'm working on and struggling with the code. I've managed to get this far:               <?php      $term = get_term( hotelCategoryID, 'accommodation-category' );     $output = '
 ';     if (function_exists('get_terms_meta'))     {          $category_hotel = get_terms_meta(hotelCategoryID, 'image_taxonomy',true);          }     if($category_hotel ) :      $output .= 'name.'" />';     endif;     $output .= '
                      corner
'.$term->name.'
'.                     $term->description.'
';?>     <?php       $args = array('post_type' => 'accommodation','tax_query' => array( array('taxonomy' => 'accommodation-category','field' => 'id','terms' => hotelCategoryID)));     query_posts($args);?>     <?php if (have_posts()) : $count_post = 0;         $output .= '

';        while (have_posts()) : the_post();      if($count_post==5) $output .='

';      $count_post++;      $output .= '
'.get_the_title().'
';      endwhile;      $output .= '

             +   MORE '.$term->name.'-   LESS '.$term->name.'

';     endif; wp_reset_query();     $output .= '
';?>      But when I copy the code and modify it to get the information from another custom post type it just displays one block on the homepage, I assume it's an issue with the loop in this code. I've tried various other codes but this is the one that I need as it has "5" highlighted posts, and then the rest aren't. Could someone give me an idea on how to edit the loop so I can display 6 of these on one page please? Thanks!


title: Wordpress function when file is uploaded, deleted or edited

text: I need to call this bit of PHP when a file is uploaded, deleted or edited. $output = shell_exec("bash ./upload.sh"); echo $output; I can't seem to find the right code to execute this when any of the above happen. Examples and help would be greatly appreciated.


title: Why doesn't this page query work?

text: This should be easy. I need to query to display one page in a tab. Just pull one page by one query, but I'm doing something (maybe lots) wrong here: **Edit: Hah. I forgot`the_content` It works now.**               <?php          $the_query = new WP_Query; $the_query->query ('pagename=about' );          while ($the_query->have_posts()) : $the_query->the_post(); ?>          <?php the_content(); ?>  //forgot this          <?php endwhile; ?>


title: Any insights into Transient API locking, cron and threading?

text: How does one go about locking down transient API requests for multiple threading? Has anything done some benchmarking, just how much can the transient API handle for multiple concurrent requests? It seems like it might cause some severe bottlenecks if not managed properly. Also how would one go about forcing the transient API using WP's built in cron? For instance I have a transient firing on page load that I gather statistics from ( another seperate function) but if a page isn't visited then the transient is not updated, how would you loop through all the pages/posts using transient API to force an update? The cron might also be effective in dealing with my first question to avoid multiple threading, too many requests and performance. I have been wondering about this and recently a core dev alluded to it on a blog post, the Transient API is so simple to use but seems to lack some documentation for advanced management. Any insights would be really appreciated.


title: Multi-Site Subfolder User Permission Issue

text: Currently I have a header file checking to see if users are logged in, and then a "landing" page which allows them to view all the sites they have access to within my multisite network. This functionality is working great - but I can't seem to figure out how to prohibit them from manually entering the path to the subfolder if they do not have access to it (IE: User A has access to Sites A and B but not C - Currently you can still access it by typing in http://www.example.com/Subfolder-C/ path). My code is below for header file, which I'm assuming is where I would be going to input the remaining code to prevent them from accessing the site without being a user on the multisite instance.               <?php      /*     Template Name: Brand Home     */     ?>     <?php     //ini_set('display_errors',1);      //error_reporting(E_ALL);     ?>     <style type="text/css">     body {background-color:black;}      </style>     <?php global $current_user;       get_currentuserinfo();     ?>     <?php     if ( is_user_logged_in() ) {     ?>     <?php brand_login($current_user->ID); ?>      And then this is my functions.php code that deals with logins               add_filter( 'login_url', 'mysite_login_url', 10, 2);     function mysite_login_url( $force_reauth, $redirect ){     $login_url = '/';          if ( !empty($redirect) )         $login_url = add_query_arg( 'redirect_to', urlencode( $redirect ), $login_url );          if ( $force_reauth )         $login_url = add_query_arg( 'reauth', '1', $login_url ) ;          return $login_url ;     }               $sitepath = array();          if(is_user_logged_in()) {     global $current_user;     $blogs = get_blogs_of_user( $current_user->id );      if($blogs) {          foreach ( $blogs as $blog ) {             $blogpath = $blog->path;              if ($blogpath == '/diesel/') {              $sitepath[intval($blog->userblog_id)] = 'href="/diesel/" class="opaque" ';              }              if ($blogpath == '/michael-kors/') {               $sitepath[intval($blog->userblog_id)] = 'href="/michael-kors/" class="opaque" ';              }              if ($blogpath == '/marc-by-marc-jacobs/') {               $sitepath[intval($blog->userblog_id)] = 'href="/marc-by-marc-jacobs/" class="opaque" ';              }          }      }     }


title: adding a filter to a shortcode?

text: <?php echo do_shortcode('[mingleforum]'); ?>      inserts the mingle forum into my content! is it possible to use add_filter() on that?


title: Force index.php have_posts() loop to exit if no sticky posts found

text: I'm currently using the code below to list sticky posts on my index.php. However, when no sticky posts are present, its loading the latest posts (up to the number specified in "settings > reading > blog posts show at most ___ posts". How can I alter the script so that if there are no sticky posts, it exits out of the while?               query_posts(array('post__in'=>get_option('sticky_posts')));          if (have_posts()) :     while (have_posts()) : the_post();


title: Cant get theme to change footer color through theme customizer

text: I am having an issue trying to configure the theme I am working on to allow the footer color to be changed. So far all of my other options work so I am geussing it is an issue with the way I am calling back to the css class. This is the footer class:                .footer {      background: #f7f7f7;      height: 150px;      position: relative;      z-index: 7;      -webkit-box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);      -moz-box-shadow: 0 2px 20px rgba(0,0,0,0.4);      -ms-box-shadow: 0 2px 20px rgba(0,0,0,0.4);      -o-box-shadow: 0 2px 20px rgba(0,0,0,0.4);       box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);      } This is how I am calling it from the theme:                function theme_header_css() {      ?>             <style>                 .footer {             background: <?php echo my_theme_mod( 'hero_footer_color' ); ?>;             }             </style            <?php       }       add_action( 'wp_head', 'theme_header_css' );      I tried calling background-color instead of background but that doesn't seem to work. I am thinking that I am not calling the class right. Can anyone give me a hand? **EDIT:** When I check the page CSS I can see that it is attempting to override the background color, although it is not producing a value and appears like this: .footer { background: ; } After checking through multiple times it is the proper setting, so I am at a loss to what it is, if it is not the CSS. **Here is get_theme_mods()**                function my_get_theme_mods() {     $defaults = array(               'my_hero_title'                 => '',         'my_hero_description'           => '',               'my_hero_background_color'      => '#17649a',         'my_hero_background_image'      => '',         'my_hero_background_repeat'     => 'no-repeat',         'my_hero_background_position'   => 'center',                 'my_footer_color'               => '#f7f7f7',     );          return $defaults;


title: Wordpress tags select

text: I want change the default Wordpress tag feature to something different. 1\. Create two types of tags- 'Parent' Tags and 'Child' Tags. To make it clear, Say, the parent tags are Fruits, Animals, asian countries, etc. The child tag will contain apple, cow, mango, nepal, america, lion, and many more.... How can I make a taxonomy to select these tags inside wordpress and create two fields to select the tags- one for the parent tags and the other for the child tags. And, if only one type of 'parent' tag is selected, child tags of only that parent tag could be added.


title: Wordpress not showing full text in feed

text: I have been reading around and I cannot figure out why (even with the full text option checked in settings) that my feed will only display excerpts of posts instead of full posts. Any ideas? here is the link - http://lynchbryan.com/feed


title: Capturing POST data

text: I am trying to modify the Member Status Plugin so that the status are based on the data saved on a custom database table. Basically I wanted to change the administration menu with a form that can manually update the data saved in the database. I noticed the current form is pointing to /wp-admin/options.php but im very new to WP (2 days) and not sure why it is so. How can I direct the form to pass it to the plugin instead so I can update the data on the table? I am assuming once I can do that I can only use AJAX to do the same thing, am I right on this?


title: wp-cron: freeze at "now"

text: sorry for the silly question. Briefly I have a wp (v. 3.5.1) blog using a heavily modified (by myself) theme. Everything works fine except for wp-cron. Listed jobs appears in (for instance) crontrol and time passes until they come to "now" (which means that the job should start). Anyway nothing happens: scheduled post freeze at "now", my custom functions freeze at "now" and so on. Everything works if I manually run it (so no code problems). I tried to disable wp-cron (with `define('DISABLE_WP_CRON', true);` and set up a custom wp-cron (with its crontab entry) but without success. Finally I get the following error message: > There was a problem spawning a call to the WP-Cron system on your site. This > means WP-Cron jobs on your site may not work. The problem was: connect() > timed out! which disappear if I set `define('ALTERNATE_WP_CRON',true);`. Thanks in advance for the help...


title: wp_commentdata: error in documentation?

text: The page http://codex.wordpress.org/Database_Description#Table:_wp_commentmeta lists the meta_id field of the `wp_commentdata` table as being both `PRIMARY KEY` and `DEFAULT NULL`. But a primary key cannot be null, not even in MySQL, AFAIK, as running the following code in phpmyadmin confirms:               CREATE TABLE Baz (x bigint unsigned primary key default null);          #1067 - Invalid default value for 'x'       So, is there an error in the documentation? Thanks.


title: the_content inside my own theme does not retain line breaks / enters like in the admin

text: Ok, I tried everything. the_content, get_the_content, filters, disabling plugins, Chtulu. Nothing. In my own theme, the content retains the format given in the admin editor (like bold, italic, justify...) but not line breaks. The text is "all together", all "attached". I can't "detach" subtitles from the paragraph, for example. What should I look for?


title: illegal offset in option add

text:
I downloaded a plugin to dissect that I could use to learn the settings api with. It's a simple background uploader and as you can see fairly straight forward. When trying to recreate it however using my own set of options I almost always run into an illegal offset warning. After reading up on the issue the problem seems to be rooted in the option not being defined as an array and thus not recognizing the 'image' key. My question, with this code working absolutely fine, where within this script does it define the option as a usable array? I write what appears to be exactly the same thing, only changing the option names, and keep getting an illegal offset warning.

Full Screen Background Image
             <?php             if ( ! isset( $_REQUEST['updated'] ) )                 $_REQUEST['updated'] = false;             ?>             <?php if ( false !== $_REQUEST['updated'] ) : ?>}

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

             <?php endif; ?>             <form method="post" action="options.php">                      <?php settings_fields( 'fsb_register_settings_4' ); ?>
Choose Your Image

                     <input id="fsb_settings_4[image]" name="fsb_settings_4[image]" type="text" class="upload_field" value="<?php echo $fsb_options['image']; ?>"/>                     <input class="upload_image_button button-secondary" type="button" value="Choose Image"/>                     <?php _e( 'This image will be applied to the background of your website' ); ?>

                     <?php if($fsb_options['image']) { ?>                         <img src="<?php echo $fsb_options['image']; ?>" id="fsb_preview_image" style="padding: 3px; border: 1px solid #f0f0f0; max-width: 600px; overflow: hidden;"/>                     <?php } else { ?>                         <img src="<?php echo plugin_dir_url( __FILE__ ) . 'preview.jpg'; ?>" id="fsb_preview_image" style="padding: 3px; border: 1px solid #f0f0f0; max-width: 600px; overflow: hidden;"/>                     <?php } ?>

                     <input type="submit" class="button-primary" value="<?php _e( 'Save Options' ); ?>" />
<?php echo esc_url( $fsb_options['image'] ) ?>

                       </form>

     <?php                 }     function fsb_init_admin() {     add_menu_page( 'General Settings', 'General Settings', 'administrator',   'display-      settings', 'fsb_admin_page' );     }     add_action('admin_menu', 'fsb_init_admin');          // register the plugin settings     function fsb_register_settings() {     register_setting( 'fsb_register_settings_4', 'fsb_settings_4' );     }     add_action( 'admin_init', 'fsb_register_settings' );


title: Save Custom Fields

text: I am working in a new project using WordPress. I have created some Custom Posts and now I have to relate some custom posts like categories. I created a custom dropdown menu inside the custom posts. The dropdown displays the title of the customs post but I don´t know how to save them. Here is my code:               /* add custom field to my customo post */          add_action('admin_menu', 'related_post_options_box');          function related_post_options_box() {     add_meta_box('post_info', 'Related Information', 'related_post_info', 'related', 'side', 'high');     }          function related_post_info() {     global $post;     /* List the posts*/         query_posts( array('post_type' => array( 'related', 'produktkrav', 'filtreringskriterie' )));             echo '<select name="related" id="related" multiple>'.              '<option value="" selected="selected">Select a post</option>';             while ( have_posts() ) : the_post();     echo '<option value="';             the_permalink();             echo '">';             the_title();             echo '</option>';         endwhile;              echo '</select>';     }      I would like to use the function save_post but I don´t know how. Of course, the dropdown has to allow multiple selection.


title: Get a list of existing transients

text: I have been using transients a lot in WordPress since I discovered them, however to ensure my sites update properly when a post is edited or created I added a function to delete transients on post save. This works great however I need to keep a list of all the transients I create throughout the site and then mention each one by name in my function. This is especially troublesome when I name the transients automatically, for example some transients are named based on their post title. Is there a way in WordPress to get a list of all the transients currently created on the site? I'd like to clear them all on post save. I'd like to do this whilst avoiding directly deleting the database entries (ie I'd like to use the delete_transient() function rather than just delete all the transients directly in the database).


I'm getting a really cryptic error and I'm not sure where to begin. The site (http://www.petcercise.com/) works fine, but when I attempt to go to /wp-admin/ I get the following error: > Fatal error: Exception thrown without a stack frame in Unknown on line 0 I've googled it and searched the Worpress support site. This error seems to be commonly associated with new plugins, but I have not recently installed any new plugins on this site. I have two questions:   1. How do I go about diagnosing the root cause?   2. How do I go about recovering from this error if I can't diagnose the problem?


title: Is there a decent private message plugin for Wordpress?

text: I've tried Private Messages for Wordpress, but are there any alternatives?


title: Why Better WP security plugin returns 418 I'm a Teapot "error"?

text: I am working on the Wordpress website and all of a sudden after deploying it on the server, I started seeing a problem where some of the pages on my website return `418 I'm a Teapot` as Response status and error as content. After going through a few posts on **HTCPC Protocol** and blogs on the same problem. I figured that it has something to do with plugin **Better WP Security** , which I recently installed on my Wordpress site also I found following code in `inc/secure.php` file under plugin code, responsible to return that response.               $bwpsmemlimit = (int) ini_get( 'memory_limit' )           //if they're locked out or banned die     if ( ( $bwpsoptions['id_enabled'] == 1 || $bwpsoptions['ll_enabled'] == 1 ) &&           $this->checklock( $current_user->user_login ) ) {          wp_clear_auth_cookie();     @header( 'HTTP/1.0 418 I\'m a teapot' );     @header( 'Cache-Control: no-cache, must-revalidate' );      @header( 'Expires: Thu, 22 Jun 1978 00:28:00 GMT' );     die( __( 'error', $this->hook ) );          }      But as I am new to Wordpress and PHP. So I am Not able to figure out, what exactly is going wrong there. I also checked solution of problem given here, which says "It is mainly because of ftp transfer to server from local network" but I doubt its the case here as I can see that the problem persists even though we access website from different Network IPs, which were Not used in website deployment process. > One **Temporary solution** that I found for the problem was, to delete > lockout entries from Wordpress database table `<wp-prefix>_bwps_lockouts` > (e.g. wp_bwps_lockouts) for your IP-Adress. Using this table, Better WP > Security plugin locks the user IP for some duration (typically 15 mins). It will be very helpful to get an idea on Why **Better WP Security** plugin does this. So that we can take necessary steps to prevent this in future.


title: Fetch Data from other website in wordpress (screen scraping)

text: I have 1 really challenging question. I would like to fetch some product info from another website (our sister website) by just inputting product ids in my editor. So for example lets say I enter DR490, DR508 in my post editor and publish the post. Now I would like to fetch data from following URL http://isabellaoliver.com/DR490 and http://isabellaoliver.com/DR508 and I would like to fetch some selected content from those webpage, content such as Product name, Product price, product image etc. and would like to display it on our magazine . I would also like to style the fetched content according to my convinence. Now the Question is "Is it possible ?" if Yes "Than How ? " Thanks a lot in advance !


title: Favicon storage - which folder should be used?

text: This question is not technical but rather "ideological" - where in WP should favicon be stored (in "correct" way)? Should it be in the root (where wp- config.php) is stored OR should it be in current theme's folder? Or should 2 copies be kept (which I don't want to do)? I know, either way will work and will result in no errors but I'd like to know better/correct/more semantical, etc. way.


title: How do I know which plugin uses the most resource?

text: After installing several new plugins I discovered my site is getting slower. Is there a way to know which plugin utilizes the most resource without using the obvious method of activating/deactivating each plugin one by one?


title: Comments are assigned to wrong or related post

text:
This issue is driving me nuts since weeks :(( Please help me. The comments are assigned to related posts and are visible on other posts also. For ex. The page redirects to post "Sports" when I post the comment on "Food" But the same comment is visible on all the other posts like "Tours", "News" etc., Most likely, the comment is assigned to the last "related post" To be more clear: Sports Page | V Related Posts - News, Tours, Food Now, the comment goes to the post "Food" here's the code               <?php get_header(); ?>                  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                  <?php              $image1 = get_post_meta(get_the_ID(), 'tz_upload_image', true);             $image2 = get_post_meta(get_the_ID(), 'tz_upload_image2', true);             $image3 = get_post_meta(get_the_ID(), 'tz_upload_image3', true);             $image4 = get_post_meta(get_the_ID(), 'tz_upload_image4', true);             $image5 = get_post_meta(get_the_ID(), 'tz_upload_image5', true);             $image6 = get_post_meta(get_the_ID(), 'tz_upload_image6', true);             $image7 = get_post_meta(get_the_ID(), 'tz_upload_image7', true);             $image8 = get_post_meta(get_the_ID(), 'tz_upload_image8', true);             $image9 = get_post_meta(get_the_ID(), 'tz_upload_image9', true);             $image10 = get_post_meta(get_the_ID(), 'tz_upload_image10', true);             $folder_name = get_post_meta(get_the_ID(), 'folder_name', true);             $product_name = get_post_meta(get_the_ID(), 'product_name', true);             $product_id = get_post_meta(get_the_ID(), 'product_id', true);                  $comingSoonButton = "";                  $downloadButton = "";                  $buyButtonImage = "http://www.appdesignvault.com/images/site/red-button/buy-this-theme-slash.png";             if($product_id == 22)             {                 $buyButtonImage = "http://www.appdesignvault.com/images/site/buy-now-49.png";             }                  $themeLinkNoMember = '<form name="PaymentForm" method="post" action="http://www.appdesignvault.com/dap/paypalCoupon.php">             <input type="hidden" name="cmd" value="_xclick"/>             <input type="hidden" name="currency_code" value="USD" />             <input type="hidden" name="item_name" value="'.$product_name.'" />
<input class="trans" type="image" src="'. $buyButtonImage. '" border="0" name="submit" alt="Make payments with PayPal - its fast, free and secure!" />
             </form>';                       $themeLink = ''.$downloadButton.'';                       $accessText = 'userhasccess';             $accessShortCode = '[DAP hasAccessTo="'. $product_id .'"]'.$accessText.'[/DAP]';                  $attributes = array('isloggedin' => 'Y', 'errmsgtemplate' => 'Log in or Join');                  if($product_id == 0)             {                 $dlLink = $comingSoonButton;             }             else             {                 $accessContent = dap_shortcode($attributes, $accessShortCode);                      if(strpos($accessContent, $accessText) == true)                 {                     $dlLink = $themeLink;                 }                 else                 {                     $dlLink = $themeLinkNoMember;                            }             }                  ?>

                         <?php                             echo $dlLink;                         ?>
                          <?php $terms = get_the_terms( get_the_ID(), 'skill-type' ); ?>                     <?php $product_price = $product_id == 22 ? '$49' : '$70'; ?>                          <?php if ($product_id == 22){ echo "
Offer ends: 12th Jan 2012.
" ;} ?>

                             <?php echo $product_price; ?>

<?php _e('Features:', 'framework'); ?>

 Sample Project

 Retina (@2x) files

 iOS 5 compatible

 .PSD files

 PNG Artwork

<?php _e('Vault Tags:', 'framework'); ?>

                                 <?php foreach ($terms as $term) :  ?>
<?php echo $term->name; ?>
                                 <?php endforeach; ?>

                         <?php if(0){ ?>                         <?php if(function_exists('dd_digg_generate')){dd_google1_generate('Normal');} ?>                         <?php if(function_exists('dd_digg_generate')){dd_twitter_generate('Normal','emityme');} ?>                         <?php if(function_exists('dd_digg_generate')){dd_fblike_generate('Like Box Count');} ?>                         <?php if(function_exists('dd_digg_generate')){dd_digg_generate('Normal');} ?>                         <?php }?>

                                                       <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">                                  <?php                              $add_info = get_post_meta(get_the_ID(), 'tz_additional_info', true);                              $video_url = get_post_meta(get_the_ID(), 'tz_video_url', true);                             $embeded_code = get_post_meta(get_the_ID(), 'tz_embed_code', true);                             ?>                                  <?php if($video_url !='' || $embeded_code != '') : ?>
                                      <?php if($add_info != '') : ?>
                                     <?php echo stripslashes(htmlspecialchars_decode($add_info)); ?>
                                                                  <?php endif; ?>
                                          <?php tz_video(get_the_ID()); ?>

                                  <?php endif; ?>                                  <?php if(get_post_meta(get_the_ID(), 'tz_portfolio_enable_slider', true) == 'yes') : ?>

                                          <?php                                      if($image1 != '') :                                              $height = get_post_meta(get_the_ID(), 'tz_image1_height', true);                                              if($height == '') :                                                  $height = getimagesize($image1);                                             $height = $height[1];                                              endif;                                          endif;                                     ?>
<img width="696" height="<?php echo $height; ?>" src="<?php echo $image1; ?>" alt="<?php the_title(); ?>">
                                     <?php if($image2 != '') : ?>
<img width="696" src="<?php echo $image2; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image3 != '') : ?>
<img width="696" src="<?php echo $image3; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image4 != '') : ?>
<img width="696" src="<?php echo $image4; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image5 != '') : ?>
<img width="696" src="<?php echo $image5; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image6 != '') : ?>
<img width="696" src="<?php echo $image6; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image7 != '') : ?>
<img width="696" src="<?php echo $image7; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image8 != '') : ?>
<img width="696" src="<?php echo $image8; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image9 != '') : ?>
<img width="696" src="<?php echo $image9; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>                                     <?php if($image10 != '') : ?>
<img width="696" src="<?php echo $image10; ?>" alt="<?php the_title(); ?>">
                                     <?php endif; ?>
                                      <?php if($image2 != '' && get_post_meta(get_the_ID(), 'tz_portfolio_enable_slider', true) == 'yes') : ?>

                                                  <?php if($image2 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image3 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image4 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image5 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image6 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image7 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image8 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image9 != '') : ?>

                                             <?php endif; ?>                                             <?php if($image10 != '') : ?>

                                             <?php endif; ?>

previous

next

                                 <?php endif; ?>
                             <?php else: ?>                                  <?php                              if($image1 != '') : ?>
<img width="696" src="<?php echo $image1; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image2 != '') : ?>
<img width="696" src="<?php echo $image2; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image3 != '') : ?>
<img width="696" src="<?php echo $image3; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image4 != '') : ?>
<img width="696" src="<?php echo $image4; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image5 != '') : ?>
<img width="696" src="<?php echo $image5; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image6 != '') : ?>
<img width="696" src="<?php echo $image6; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image7 != '') : ?>
<img width="696" src="<?php echo $image7; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image8 != '') : ?>
<img width="696" src="<?php echo $image8; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image9 != '') : ?>
<img width="696" src="<?php echo $image9; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                             <?php if($image20 != '') : ?>
<img width="696" src="<?php echo $image10; ?>" alt="<?php the_title(); ?>">
                             <?php endif; ?>                                  <?php endif; ?>

                             <?php the_content(); ?>

<?php echo stripslashes(get_option('tz_related_portfolio_title')); ?>

                         <?php echo stripslashes(get_option('tz_related_portfolio_description')); ?>

                              <?php global $post;                                $postId = $post->ID;                               $query = get_posts_related_by_taxonomy($post->ID, 'skill-type');?>                                   <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post();                               $terms = get_the_terms( get_the_ID(), 'skill-type' );  ?>                               <?php if(get_the_ID() != $postId) : ?>
                                                               <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">                                         <?php /* if the post has a WP 2.9+ Thumbnail */                                 if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) { ?>
                                     <?php tz_lightbox(get_the_ID(), TRUE); ?>
                                 <?php } ?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'framework'), get_the_title()); ?>"> <?php the_title(); ?> <?php edit_post_link( __('edit', 'framework'), '[', ']' ); ?>

                                          <?php /*the_excerpt();*/ ?>                                     <a href="<?php the_permalink(); ?>" class="more-link"><?php _e('Read more...', 'framework'); ?>

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

                  <?php comments_template('', true); ?>                  <?php endwhile; endif; ?>             <?php wp_reset_query(); ?>      Thanks a lot in advance :-)


title: Failed to import media from a local wordpress site to a live one

text: I've been developing a new blog theme for a client locally on my computer and am now in the process of uploading this to the new live server. I used the wordpress export facility to export all the content from the local site and then went into the live installation and used the import facility - I checked the boxed the referred to file attachments - but no media gets imported onto the live blog. I've got about 255 posts and don't fancy having to go in and set the featured image manually for each and every post. Am I doing something wrong? Is there a way I can upload all the media easily?


title: calling categories in a custom post type

text: I'm creating a custom post type by adding the add_action( 'init', 'create_radiotalks' ); text to the functions.php page:               add_action( 'init', 'create_radiotalks' );          function create_radiotalks() {         register_post_type( 'radiotalks',             array(                 'labels' => array(                 'name' => __( 'Radio Talks' ),                 'singular_name' => __( 'Radio Talk' ),                 'add_new' => __( 'Add New' ),                 'add_new_item' => __( 'Add New Radio Talk' ),                 'edit' => __( 'Edit' ),                 'edit_item' => __( 'Edit Radio Talk' ),                 'new_item' => __( 'New Radio Talk' ),                 'view' => __( 'View Radio Talk' ),                 'view_item' => __( 'View Radio Talk' ),                 'search_items' => __( 'Search Radio Talks' ),                 'not_found' => __( 'No radio talks found' ),                 'not_found_in_trash' => __( 'No radio talks found in Trash' ),                 'parent' => __( 'Parent Radio Talk' ),     ),                 'public' => true,             )         );     }      when entering the add new radio talk info, I would like to add the applicable categories and tags, but they do not show up in the admin side bar? How do I make the categories/tags available to my custom post type? thanks for your help. -don


title: How to split authors?

text: I have 3 authors, each of us talk about the same subject but in a different mind/opinion. I want to have 3 pages for each of us and show ONLY the posts for each author one them. Like have a page called AuthorOne that has only the first authors posts, etc. How can I do this?


title: wp-pagenavi only showing first page

text: I'm trying to get pagination to work, I get the nav tools to show, but when i click to move to the next page it loads the first page every time. Here's the code:               <?php $args = array(                         'post_type' => 'page',                         'orderby' => 'title',                         'order' => 'ASC',                         'posts_per_page' => 5,                         'paged' => get_query_var('page'),                         'post_parent' => $parent                     ); ?>               <?php query_posts($args); ?>                    <?php if ( have_posts() ) : ?>                   <?php while ( have_posts() ) : the_post(); ?>                       //get the desired custom field values                    <?php endwhile; ?>               <?php endif; ?>             </div>                  <!-- navigation goes here -->             <div class="naviButs">                 <?php wp_pagenavi(); ?>             </div>      Please if anyone can assist? Or maybe knows workaround?   Thanks in advance!


title: Limit a meta box to a specific category

text: I'm trying to limit a meta_box to posts in a specific category. I'm using this method: http://www.farinspace.com/page-specific-wordpress-meta-box/ and it works rather well But I can't seem to get it to work with categories. Heres' my code:               <?php      // meta box for news category     add_action('admin_init','news_init');          function news_init(){              $post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;              $post = get_post($post_id);              if ($post->post_category == '6'){         add_meta_box('news_details', 'News Details', 'news_details', 'post');         }     }     ?>      I feel like I'm missing a step. Thoughts or ideas? Thank you, Nadine


title: Plugin Handle URL With Custom Theme

text: I need to develop a plugin in which a special page needs to be created. This page will have a completely separate design from the rest of the website, and will be located at a specific URL. I realize short codes are the "proper" way for a plugin to run itself on a page, but how would I go about actually over-riding the entire theme of the page and replace it with my own content? In this case, since it's a single page, I don't want to actually create an entire Wordpress theme-- I just need to be able to essentially start from a blank slate and I can just use my own HTML from there.


title: Alternative to simple fields plugin?

text: I have been building websites with WordPress for a couple years now, and have become very reliant on the Simple Fields Plugin. Essentially this plugin lets me attach extra fields to the bottom of my "edit" pages; for example: repeatable image upload fields, extra text fields, etc... This plugin is currently out-of-date and does not work properly with WP 3.3. I have seen a few other similar plugins - but many aren't free - or don't offer the 'repeatable' aspect I seem to need so often. My _real_ question is how do the big-boys in the field approach this kind of thing. Would you use a plugin, or is this something I should do custom on a per-site basis (like creating custom post-types). Or should I be taking a different approach to the back-end altogether. For example, if I were building a footer 'page' and I wanted the edit page to:   * have a section to upload different images and associate them with links.   * have fields for phone number, fax, address, etc...   * have another 'repeatable' field of links   * other repeatable text fields Sorry for being long-winded, and thank you! **edit** : just checked out Magic Fields - I love it except that it doesn't allow you to choose apply the fields to a specific post-ID - just a specific post type.


title: Display post from specific date

text: How do I display posts by a specific date? If it is 15 July today, it'll display posts from about two or three days ago, like the 12th of July's posts. And tomorrow it'll display the 13th of July's post. How can I achieve this?


title: is_category() in pre_get_posts strange error

text: I have a function that sets posts_per_page option depending on the category viewed. I discovered and error which I can't really understand: first this is how I get the error:               function custom_posts_per_page($query) {              if ( !is_admin() && is_category(4)) {              // Leaving this empty or with content              }          }          add_filter( 'pre_get_posts', 'custom_posts_per_page' );      So I get an error there if WP_Debug is turn to true and when I access a non- exixting category. So if I enter `http://localhost/zz/category/uncategorized` there is no problem but if I enter for example `http://localhost/zz/category/aaaaaaaa` (Category aaaaaaaa doesn't exist), It gets correctly to the 404 page but throws these errors:               Notice:  Trying to get property of non-object in C:\xampp\htdocs\zz\wp-includes\query.php on line 3420     Notice:  Trying to get property of non-object in C:\xampp\htdocs\zz\wp-includes\query.php on line 3422     Notice:  Trying to get property of non-object in C:\xampp\htdocs\zz\wp-includes\query.php on line 3424      What is wrong?


title: return custom taxonomy terms in post object

text: How would I go about returning the custom taxonomies in the post object with WP Query or with get_posts for that matter. yes, I know I can loop over my query and use get_terms or a number of other functions but for what I'm doing, this generates too many queries. I'd rather have all the data stored in one object/array and work with that.


title: jQuery Autocomplete not working with wp_localize_script

text: Bit of background: I am building an autocompleting-search box for a list of Trades (a Custom Taxonomy). I asked this question and very helpfully got a much better understanding of how WordPress and AJAX work together (Thanks G.M)! However, he said that I should use `wp_localize_script` so that the PHP isn't accessible on the front-end. I knew about this function but had never used it so with a bit of reluctance I got stuck in. I found this post which also had an incredibly useful explanation of how WordPress and AJAX work together. I implemented that code provided by Stephen Harris, but I've got an error in my console, whenever I search for anything in the search bar: `TypeError: '["Accountants","Electricians","Painters","Plumbers"]' is not a valid argument for 'in' (evaluating 'b-1 in a')` and here is my PHP code:               wp_enqueue_script("autocomplete", get_template_directory_uri() . '/assets/js/autocomplete.js', array( 'jquery', 'jquery-form', 'json2' ), false, true );     wp_localize_script("autocomplete", "MyAjax_object", array(         'ajaxurl' => admin_url( 'admin-ajax.php' ),         'myajax_nonce' => wp_create_nonce( 'myajax_nonce_val' ),         'action' => 'myajax-submit'     ));     function get_my_suggestions() {         // This function should query the database and get results as an array of rows:         // GET the recieved data: 'term' (what has been typed by the user)         $term = $_GET['term'];         $trades = get_terms( 'trade', array( 'fields' => 'names' ) );         $tradesList = '["' . implode( '","', $trades ) . '"]';              // echo JSON to page  and exit.         $response = $_GET["callback"]."(". json_encode($tradesList) .")";           echo $response;           exit;     }     add_action( 'wp_ajax_myajax-submit', 'get_my_suggestions' );      and JavaScript:               $(document).ready(function() {         $(".main-search-field").autocomplete({         source: function( request, response ) {                   jQuery.getJSON( MyAjax_object.ajaxurl + "?callback=?&action=myajax-submit", request, function( data ) {                     response( jQuery.map( data, function( item ) {                         jQuery.each( item, function( i, val ) {                             val.label = val.whatever; // build result for autocomplete from suggestion array data                         } );                         return item;                     } ) );                 } );               },              minLength: 1,             appendTo: ".search-container"         });      });      Does anyone know why I get that error? The JavaScript loads fine - it adds in the markup for the suggestions list, but it's empty. Also, I've noticed that whenever I search for something in the input box, a class, `ui-autocomplete- loading` is added to the input box. Not sure if that's important but it might help someone out. Thanks for any help :)


title: Shortcode interpreted as text

text: I have the following shortcode in one of my pages               [[Intern: Termine/News]]      This works on a password protected sub page. Now I want that all news of the category Termine/News are on the parent page. So I put the code on the password protected parent page. Now the text is rendered - I only can see the shortcode text. But I should see all the articles! What is wrong? Or do I missunderstanding something? Edit: Figured it out. There was some code directly in the template and so the content in the WP backend was totally ignored. Added the code in the template php file and now it works.


title: Not the typical order by posts by date question

text:
I am using WP_Query to get all posts from a custom post type. This works great for listing out all the posts. However, the post itself has a custom date field and I want to list all posts for a certain month under an `H2` tag that list the month without repeating the month. Currently I can loop through all posts but the `H2` with the month gets spit out every time. I don't want to make a month category either. The posts are for show dates. I want to list out all the dates for June but only have one `H2` with June in it and then all the posts under it. Like this:                1. June         a. Show date         b. Show date         c. Show date      2. July         a. Show date          b. Show date         c. Show date      and not this:                1. June         a. Show date      1. June         b. Show date      1. June          c. Show date      2. July         a. Show date      2. July         b. Show date      2. July         c. Show date      Updated code:               $current_month = '';                         while ($query->have_posts()) : $query->the_post();?>       <?php $date = strtotime( get_field('date') ); $month = date('F',$date); ?

          <?php if ($month != $current_month){                    $current_month = $month;                 echo $month; } ?>


title: List most recently added posts (with a twist)

text:
At first I thought the task was trivial. I'd like to list the most recently added posts (say, 15 of them), but I am adding posts that are dated a few years back, yet I'd like them to show in the list, instead of just the ones that are dated the most recent. This is what I'm doing so far:               <?php         $args = array( 'orderby' => 'modified', 'numberposts' => 15 );         $postslist = get_posts( $args );         foreach ($postslist as $post) :  setup_postdata($post);                  $audio = get_children(                 array(                     'post_parent' => $post->ID,                     'post_status' => 'inherit',                     'post_type' => 'attachment',                     'post_mime_type' => 'audio'                 )             );             $thishref = "";             foreach ( $audio as $attachment_id => $attachment ) :                  $thishref.= wp_get_attachment_url( $attachment_id, 'full' );             endforeach;     ?>
         <a href="<?php the_permalink(); ?>"><?php the_title();?>          (<?php comments_number( '0', '1', '%' ); ?>)           <a title="download" class="downloadlink" href="<?php echo $thishref; ?>">↓
     <?php         endforeach;     ?>      It works, except if I add tags to a post or edit it in any way, the post becomes 'modified' and thus appears in this list, and I'd like to prevent this from happening. In other words, I want to list 15 most recent posts not by their date, not by their modified date, but by the date they were added to the database of posts ('created' date?). Would this be at all possible?


title: Pagination on category.php and tag.php not working

text:
i'm using a query-loop on my template pages like this:               <?php     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     $wp_query = new WP_Query();     $wp_query->query('posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);     global $wp_query;         query_posts(array_merge($wp_query->query, array(             'paged'          => get_query_var('paged'),             'posts_per_page' => 2         )));     ?>     <?php if ($wp_query->have_posts()) : ?>     <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
         <a href="<?php the_permalink() ?>">                     <?php the_post_thumbnail( 'portfolioteaser' ); ?>

<?php the_title(); ?>

              <?php endwhile; ?>     <?php endif; ?>       the pagination works fine with this except on the category.php or tag.php. The first page is showing correctly but for example if i click on "category/categoryname/page/2" it shows no content anymore an dthe pagination disappears... i know it must be something wrong with the query loop... help would be nice! thanks alot, Jochen


title: Where are my js and css links in header?

text: I just found out that there are no javascript and css links in my header.php.               <?php          /**           * The Header for our theme.           *           * Displays all of the <head> section and everything up till <div id="main">           *           * @package web2feel           * @since web2feel 1.0           */          ?><!DOCTYPE html>          <html <?php language_attributes(); ?>>          <head>          <meta charset="utf-8">          <meta name="viewport" content="width=device-width" />          <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', 'web2feel' ), max( $paged, $page ) );                        ?></title>          <link rel="profile" href="http://gmpg.org/xfn/11" />          <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />          <!--[if lt IE 9]>          <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>          <![endif]-->          <?php wp_head(); ?>     </head>      They appear in source view. Can anyone tell me where can I find my f. css and js? :D


title: Show Posts From Same Category OR Same Tag

text: Assume a post is categorized in "Fruit" and tagged with "Apple".   The following code shows posts with category "Fruit" AND tag "Apple"               $args = array(           'tag__in' => $tag_in,           'category__in' => $category_in,       );     query_posts($args);      How to show all posts which are from either category "Fruit" OR tag "Apple"?


title: How to add add_meta_box to specific Page Template?

text: I want to add **add_meta_box** to specific **page** type like Page Template, Like Product Template. I am using this article http://wp.smashingmagazine.com/2011/10/04/create- custom-post-meta-boxes-wordpress/ to try it.


title: how to call files in child theme?

text: I created a child theme **"my-theme"** . In style.css I wrote nothing just the mandatory details I wrote there.               /*     Theme Name:     my-theme     Theme URI:      http://example.com/     Description:    Child theme for the Twenty Twelve theme      Author:         Bhuvnesh     Author URI:     http://example.com/about/     Template:       my-theme     Version:        0.1.0     */      All the style rules I am writting in **"my-theme/css/style.css"** file. Now in **index.php** I am calling **`<?php get_header(); ?>`** this will call **header.php** now in **header.php** file I am calling that css file as `<link href="css/style.css" rel="stylesheet" type="text/css" />` but this is not loading my css. same like this I am calling some **.js** files which are under **"my-theme/js/"** directory as               <script type="text/javascript" src="js/jquery-1.7.2.min.js"> </script>      this is also not loading. I know I am making some mistakes to call files or may be in functions.php . I just copied the full file **functions.php** of **twentytwelve** . Is there any mistake I am doing ? Please tell me what to write in **functions.php** file and how to call files like js files under js directory .php files under includes directory , images under Images directory. I searched how to create child theme and it's done but unable to call files. Please Help me!I will be very thankful to you!!!!


title: wp_editor with media buttons

text: I use `wp_editor()` on the frontend. media_buttons are displayed on default **if** visitor is logged in. I want to display these media buttons whether user is logged in or not. Is there any way to achieve this?


title: How can i add thumbnails images to particular post (using code not admin pannel) in wordpress

text: I am trying to set thumbnails for my post. I have `post_id = 285` and I want to add manually a thumbnail (using code) but I'm not succeeding.               update_post_meta( $post->ID, '_thumbnail_id', $attachment_id );      I got this function reference but I do not understand what is the `$attachment_id` and how can I get it. I have also image name and path of image.


title: WordPress Ajax Problems

text: ## Update I got it to fire using the following curl command: `curl -H "Accept: application/json" -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d "action=vixo_wordpress_signon&data=banjometer" --trace -` Not really sure how to work out to get it to accept json, but hey... ## Original Question I am new to WordPress and I am having problems getting Ajax to work - but I am also having problems understanding how WordPress loads PHP. I have a plugin file:               /usr/share/wordpress/wp-content/plugins/myplugin.php      It has the following code in it:               // set up the ajax calls     add_action('wp_ajax_my_ajax', 'my_ajax');     add_action('wp_ajax_nopriv_my_ajax', 'my_ajax');            function my_ajax () {         debug_log ("My ajax fired...");         echo "banjolalia...";         die ();     }      I want to demonstrate that the ajax has fired using Curl:               curl -X POST http://localhost/wordpress/wp-admin/admin-ajax.php -d '{"action":"my_ajax","data":"banjometer"}' --trace -      (The home page is at `http://localhost/wordpress`) I am expecting to see curl return `banjolalia` and a line appear in the debug log. What I see is the function returns `0` The Ajax is standalone because I am writing single-signon code and I need the child service to query WordPress and see if the user is logged in. Because I am new to WordPress/PHP I do not have a robust development cycle. The way I have been (trying) to get the code to reload is by Deactivating/Activating the plugin on the Admin page. This doesn't seem to work. I wasn't sure if my changes were loading into WordPress so I actually switched the lappie off and on again - but still the Ajax didnt' fire. I have 2 debugging Plugins installed:   * Debug-Bar   * Debug-Console-Bar The problems I have from a Dev perspective are:   * how can I use the PHP console to check what code is loaded/force a reload?   * how can I use the PHP console to see what actions are registed on what hooks?


title: Titles in my sidebar widget appear in all languages - with qtranslate

text:
So here's my code, using the qTranslate plugin:                   query_posts(array('post_type' => 'uk_blog', 'numberposts' => 2));         $i = 0; while(have_posts()): the_post($post);?>         <div class="third-column"<?php if ($i == 1) echo ' style="margin-right:0;"';?>>
<a href="<?php get_permalink($post->ID);?>"><?php the_title();?>

                 <?php $length = strlen(get_the_content());                 echo nl2br(substr(strip_tags(get_the_content()), 0, 500));                 if ($length > 500){                     echo '...
ID) . '">Read more';                 }                 ?>

         <?php $i++; endwhile;?>      The post titles (using the_title();) are actually appearing in all languages at the same time, ie: English titleFrench titleSpanish title. Viewing the HTML source shows that the qTranslate tags that define which bit of a string is for which language are being directly outputted. IE the HTML source is `<!--:en-->English title<!--:--><!--:fr-->French title<!--:-->` The posts are from a custom post type. Any ideas why this might be? Thanks for reading!


title: Require title for pages

text: Is there a way to force users to write a page title before publishing? I have found example of requiring post titles, but not page titles.


title: How to license my commercial WordPress theme?

text: I am planning to sell themes on Themeforest... But i don't have any idea about Theme stuffs... I include some third party stuffs like jQuery, BootStrap, etc., I will include their license. No problem with that. But what about my work? What license should i use for premium WordPress theme? Is it ok to sell my themes without putting License file ?