title: Trying do build a contact form

text:
I have some problem making my contact form work. The contact form should only be in one simple site. So i created two templates. The first template only has the form. The other one have the php code to send a mail. But i cant make the form contact the other template Here is the first template               <?php     /*     Template Name: Contact 1     */     ?>          <?php get_header(); ?>

               <form method="post" action="http://www.sbk-sm.se/lydnad-agility.2012/index.php/kontakt-2">         Namn:
         <input type="text" name="name" />
         Email:
         <input type="email" name="email" />

              Till:         <select name="mailTo">             <option value="adibbinhaider@gmail.com">Ex2 Mail</option>             <option value="">Ex2 Mail</option>         </select>

         Meddelende:
         <textarea name="msg"></textarea>         <input type="submit" value="Skicka" name="submit">     </form>

               <?php get_sidebar(); ?>     <?php get_footer(); ?>      Here is the second template               <?php     /*     Template Name: Contact 2     */     ?>          <?php         if($_POST["name"] != "")             {             echo "Medelende har skickats ";             $name = $_POST["name"];             $emailFrom = $_POST["email"];             $mailTo = $_POST["mailTo"];                  $msg = "Från: \n";             $msg .= "Namn: " .$name;             $msg .= "\nE-Mail: " .$emailFrom;             $msg .= "\n\n";                  $msg .= "Till: \n";             $msg .= $mailTo;             $msg .= "\n\n";             $msg .= "Meddelnde: \n";             $msg .= $_POST["msg"];             $msg .= "\n\n";                  $subject = utf8_decode("SM Lydnad & Agility 2012 Kontaktformulär");             $headers = utf8_decode("From: " .$emailFrom."\r\n");                  mail($mailTo, $subject, utf8_decode($msg), $headers);              }     ?>      So I cant get to the second template, WP says the site doesnt exists


title: Wordpress comment reply link image

text: I'm currently setting up comments for a Wordpress theme I'm created, I have just successfully created **nested comments** but I'm having issues removing the word ' **reply** ' from the reply button in order to use an image via the css. The code I'm using at the moment for the reply link is as follows:               <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>      I need the word 'reply' to completely disappear and just rely on my css button which is as follows:               ol.commentlist li div.reply { width:104px;height:35px;background-image:url(images/comment_reply.png); }     ol.commentlist li div.reply:hover { background-image:url(images/comment_reply_rl.png);}     ol.commentlist li div.reply a { float:left;width:104px;height:35px;background-image:url(images/comment_reply.png); }      All help will be massively appreciated. Thanks in advance!


title: Post thumbnail relative link and HTML modify

text: I want to remove the website url from all `the_post_thumbnail()` so they become relative and remove/add attributes from the output. So far I got the following code added to functions.php of the theme, xcept I am not sure how to modify the thumbnail `$html` for the second part. Help is appreciated               add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );          function my_post_image_html( $html, $post_id, $post_image_id, $size ) {              // Create relative url using pars_url in php         $relURL = wp_get_attachment_url( $post_id ); // Get Post thumbnail Src instead of permalink         $relURL = parse_url( $relURL );         $relURL = $relURL['path'];               //Pass the relURL to post_thumbnail_html modify the src attribute         $html = '' . $html . $imgsrc .$post_id . '';              return $html;     }


title: Is there a way to display all my posts on a single Google Map?

text: Id' like to geotag all my posts and display them on a single google map. is this possible? do you know a plugin that does this? thanks!


title: WordPress Permission Problems on Ubuntu 12.04 with LAMP stack

text: Permissions when associated with WordPress is something that I would never understand. Here are the problems: First problem is uploading. If I start from a fresh Ubuntu 12.04 installation then moving onto the installation of LAMP stack which I usually do by > sudo apt-get install lamp-server^ then the installation of WordPress. Uploading anything within WordPress will not work. Not themes nor plugins nor data. However, I fixed that by adding files & directories to www-data/apache user & group. Themes, plugins, data can now be uploaded within WordPress. I also added **currentuser** and root to the usergroup, www-data. > File: www-data:www-data 644 > > Directory: www-data:www-data 755 Where do I get the idea to do this? It's from a StackOverflow answer which I found a few months ago. Second, is script execution. In this case, PHP. Despite having the correct perms, 644 (666 sometimes) for files and 755 for directories. However, some WordPress plugins still can't write to them to unless having 777 perms. What's funny is when I look at the support forums of the stubborn plugin, I see no one else reporting this issue. Help? This is something I have been struggling to solve for months. I can either go   * a) Find the perms-hungry file and give it 777    * b) Stop using the plugin It's usually b) btw. The plugins that I'm having problems with are: 1) Ep HashImage 2) Easy- Instagram Basically what they do is download images from an external source and downloads it to wp-content/ not sure specifically where though. I have tried searching for solutions such as using suexec & suPHP. However, that always ends with my server not working entirely. Is there any other solutions? Do help me on this, thanks!


title: Switching a Site to WordPress and Leaving It Live Until Ready

text: I know there will be a Homer Simpson moment (hitting head, as I say DOH) when one of you give me an insanely simple answer, but oh well...I need an answer, so here goes. Have built 25 or so WordPress sites but all from scratch using modified premium templates. Now, I am redoing a BIG site that is currently built in a custom format and want to leave it live until the new WP site is done and then upload it with no downtime. What is the best way to do this??? So I use another domain name and build it and then just copy everything? or use the current name and add WP and then build it under some secret path??? Help and thank you in advance ;-D Kathy


title: Displaying audio player as preview in audio post in WP3.6

text: I'm testing the new Wordpress 3.6 Release Candidate 2 and it's [audio] shortcode and there is something I can't figure out. The post contains the following content: _[audio http://wpthemetestdata.files.wordpress.com/2008/06/originaldixielandjazzbandwithalbernard- stlouisblues.mp3]_ How can I extract this shortcode and it's URL and display it as a player in the post preview in `index.php`? I found the new functions at the bottom of this page ( http://codex.wordpress.org/Version_3.6 ) but I can't figure it out how can I manually display the player on the index as it is shown in `single.php`.


title: Full sized images in RSS Feed

text: On my WordPress site all my images from all posts are using a width of 630px (with a full width of 1280px). For obvious reasons on my site I only display the 630px version and the user can click on it to see the full size version. However, the same setup is not available via RSS. I'm targeting an RSS reader that will display my post only on high-end smartphones screens with HD (720p) and FHD (1080p) resolution. You can imagine that the 630px images will not look too good. Is there an easy way to replace the 630px images with their full sized versions (1280px)?


title: Gallery Shortcode: using link attribute to link to a specific image size

text: When [gallery link="file"] is used, it calls the original image file source. It it possible to create a shortcode filter that links to a specific size, like: [gallery link="medium"] or [gallery link="custom-size-name"] (referring to an additional image size created with add_image_size() in functions.php.)


title: What are the details for function argument wp_update_plugin()

text: While looking at `wp_update_plugin()` function.               function wp_update_plugin($plugin, $feedback = '') {         if ( !empty($feedback) )             add_filter('update_feedback', $feedback);              include ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';         $upgrader = new Plugin_Upgrader();         return $upgrader->upgrade($plugin);     }      Its very hard to know what data type I should send as first argument `$plugin`. Is it the plugin name, file name or object? Also the second argument `$feedback`. What is the purpose of it?


title: What is the difference between RELATION "AND" and "OR" in TAX_QUERY?

text: Because if I use: `'relation' => 'AND'` or `'relation' => 'OR'` the results are always the same. Why?


title: Using pre_get_posts to set posts per page, how do I?

text: I am trying to use pre_get_posts to set posts per page for a single term within a taxonomy. One thing that is throwing me off is setting the term to apply the pre_get_posts to. Here's my code:               function filter_press_tax( $query ){     if( $query->query_vars['tax_query']['taxonomy'] == 'press' && $query->query_vars['tax_query']['terms'][0] == 'press' ):         $query->query_vars['posts_per_page'] = 5;         return;     endif;     }//end filter_press_tax      I'm not quite understanding how to access the taxonomy and term in the $query. Yes the taxonomy and term have the same name. Is this a bad idea? I do not have a custom query set up on the taxonomy-press-press.php template for the 'tax_query' is this the problem? Any help is appreciated! Thanks


title: Showing a list of posts when homepage is custom

text: I am developing a custom theme. I edited my home.php to show something custom. I also edited index.php to display a list of posts or other things. After this I can't get a list of all posts which was by default displayed at the home page. Which URL can I use to access the list of posts?


title: Strategy On Building Plugin Using Eclipse

text: Anyone who has experience in building wordpress plugin using eclipse PDT? My situation is:   * I need to build plugin that extend another plugin (look at it as premium version from another plugin)   * I already created project `plugin core`(the original plugin) by importing from svn repository   * I created eclipse library called `wordpress` and added it to `plugin core` project.   * I created another project `plugin extender` which will host scripts I created. The problem is, how to easily test it to wordpress, without having to manually copy-paste those project to `wp-content/plugins`? Is there anyway to automatically copy those files to `wp-content/plugins`? Or, do you guys have another solutions to this problem? As a side note, I'm working on windows 7. I'm aware of windows's `mklink`. However, my htdocs in on FAT32 partition and I'm in situation where I have to use Windows in the following months.


title: Clone plugins (and settings) to new installation?

text: Is it possible to clone the plugins and settings from a WordPress site to a new fresh install? I don't want any of the content from the original site I just want all the plugins used and their settings. Just ftp'ing the plugins into the new install doesn't work. It's really important that all the settings are saved from the one site to the other as this will save a huge amount of time.


title: How to create a load more post entries like Twitter?

text: Hey guys, last days i have been trying to figure out how to do that. As read on http://net.tutsplus.com/tutorials/javascript-ajax/create-a-twitter-like- load-more-widget/ but inside wordpress. And i have finally come with a solution, may not be the best one but i hope you guys can improve my code and post it here just like i`m doing. Feel free to use it wherever you want. (my coding skills are really bad so First you need to include jquery on your header. Insert this code on the page you wanna display the posts:               <?php     session_start();     $number_of_posts = 3;     if (!$_SESSION['posts_start']) { $_SESSION['posts_start'] = 0; }     $_SESSION['posts_start'] = $_SESSION['posts_start'] ? $_SESSION['posts_start'] : $number_of_posts;     $total_posts = wp_count_posts('post');     $total_posts = $total_posts->publish;     ?>           Create a php file inside your themes folder (mine is called mais-posts.php) with the following code:               <?php         require( '../../../wp-load.php' );              if(isset($_GET['start'])) {             echo my_get_posts($_GET['start'], $_GET['desiredPosts']);             $_SESSION['posts_start'] += $_GET['desiredPosts'];             exit();         }     ?>      I hope it may help anyone who is looking for something like this. So if you have any suggestion to this code please post below.


title: Retrieving a Value from a wp-database

text:
why my sql statement is not returning any value.. is this wrong?               <?php                  global $wpdb;             $result = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->wp_frm_item_metas"));             foreach ($result as $item){                 $eventname= $result->meta_value;             }                  ?>
<?php echo $eventname;?>
      What I'm doing is, I'm displaying the data stored in database using formidable form.. (not pro).. Is there something wrong with my code?


title: How to get post author name by its ID inside a function?

text: i'm trying to get the author name using the "`the_author_meta`" function. After doing that I need to pass the value inside an array and return that with "json_encode". Let me show:               $autor_id = $post->post_author;     $autor_name = the_author_meta('user_nicename', $autor_id);     echo $autor_name;      The `$autor_name` `echo` works fine but when i do the following code it returns null on my script: ...               $results['author'] = $autor_name;     $posts[] = $results;     }          return json_encode($posts);      it returns that: `"author":null` How can i make it display the author name like: `"author":admin`?


title: How do i login when i cant access wp-login.php?

text: i have a self hosted wordpress install on a server in a virtbox at home.   i was trying out plugins from the wordpress.org site, and after enabling some securtiy plugins, i found i couldnt access the wp-login.php page anymore.   i get a function of one of the plugins telling me the site is forbidden and doesnt exist.   the problem is, i am not exactly sure which plugin did this.   i dont have a login link on the front end of the page also.   the plugins i have installed are bulletproof security, lockdown wp-admin, ultimate security checker, and wp security scan.   the install is on an ubuntu server with no GUI, host is mac osx, but i can access it from the network.   if i just delete the plugins from the wordpress directory, will that work?


title: Should we localize custom-made themes / plugins?

text: Does anyone know how much do the localization functions from WordPress affect the speed of a website? Do you think it's worth replacing all strings with gettext inside a theme, even if it will only be used on a single, english website?


title: How to shorten the Permalink after WP>WP blog import?

text: We've imported a blog from one domain to another and the permalink thats been created for category archives is: domain.com/category/graphic-design- blog/tips-for-artist/ where **category/graphic-design-blog/** is superflous. The permalink structure is set to the default (2011/10/post-name) and this is working fine for single posts. Yoast's WP SEO plugin is installed, but there are no changes made under the permalink section of the plugin. Any suggestions as to why this is happening / how I can fix it? Thanks, Tim


title: How to add current, parent, and ancestor menu item IDs to body_class()?

text: (just got reccommended to post this over here from stack overflow...) I am just starting with Wordpress (defecting from Joomla)- having a bit of difficulty getting started. One thing I am trying to do is make a custom plugin that allows the user to add custom backgrounds to the site, based on the active menu item. So what I am trying to do is get the active menu id (like 'menu-item-xx' that is added to the nav li's) and active parent menu id so I can add these to the body classes. Is this something I can get from anything built into Wordpress or is this something I will need to make a custom for? Any pointers most welcome... **UPDATE** I have solved this now with a custom function that you can find below


title: how to create a post type like comments

text: I want to create a post type but don't allow to create new item on the back- end, the item of this post type can be only created on the front-end by the user. How can I do this? Thank you


title: Development before domain name chosen

text: I have a new customer who hasn't chosen a domain name yet but I need to start development for him using a subdomain of my domain. I'm on Bluehost using add- on domains and subfolders. Is there a way to convert the permalinks in the content easily? Can they be changed with SQL once he's selected a domain name?


title: Custom Taxonomy + JQuery Tabs

text:
I have created small widget on my home page which is using JQuery tabs plugin. So tabs nav is made of custom taxonomy titles and content below should be relevant to those tabs. So in other words every time user will click on tab I would like to display posts only relevant to that taxonomy. Here is my code so far:               //This part of my code creates tabs navigation
     <?php     $terms = get_terms('post_category');     foreach ($terms as $term) {         $wpq = array ('taxonomy'=>'post_category','term'=>$term->slug, 'posts_per_page' => -1);         $myquery = new WP_Query ($wpq);         $article_count = $myquery->post_count;         echo "
";             echo "slug.">";                 echo $term->name;             echo "";         echo "
";     }     echo "
";          // This part of my code creates tabs content where I would like to also include my loop     // which will display relevant posts depending on taxonomy     foreach ($terms as $term) {         echo "
slug."\">";             //loop to go here         echo "
";     }          ?>      Can anyone help me with creating that loop?


title: Replace & with &

text: I have a plugin that unfortunately I have no control over, the problem I am experiencing is that it doesn't use `&` in place of `&` and so breaks the sites validation. Is there a function I can use in my functions.php which will replace all instances of `&` with `&`? After some investigation inside the plugin I have found the following snippet which is generating the invalid code....                   static function GetPermalink($incomingLink = null) {             $blogUrl = get_bloginfo("url");             $urlSlug = dsSearchAgent_Rewrite::GetUrlSlug();             $canonicalUri = self::$CanonicalUri;                  if (isset($canonicalUri) && (!$incomingLink ||     preg_match("/dsidxpress-data/", $incomingLink)))                 return "{$blogUrl}/{$urlSlug}{$canonicalUri}";             else                 return $incomingLink;         }      It is the $canonicalURi variable that is holding the invalid link, am I right in thinking I need to apply the esc_attr to this variable?


title: Assign Custom post to Custom Taxonomy

text: I have a custom taxonomy called 'product_type' and a a custom post called 'product'. I have a cron job that is pulling in data from an external system and adds products as custom posts using `insert_post($post)`. This returns the post id. I now need to assign the product to the 'DVD' product_type in the taxonomy. I have tried `wp_set_object_terms( $object_id, 'dvd', 'product_type' )` but I dont know what goes in the object_id variable, post_id doesnt work. Can anyone help please? John


title: Creating Advanced Search with text & Dropdowns

text: I am working to develop an advanced search option. Where there will be fields:   1. Text input Field (Post Title)   2. Dropdown (it will be a taxonomy)   3. Dropdown (it will be a taxonomy) Basically I need this kind of search option. Please take a look at the image to better understand. I am using the solution found here for searching taxonomies but I need to integrate the text field which will get data from Post Title field.. ![enter image description here](http://i.stack.imgur.com/68nae.jpg)


title: Installing Solr for dedicated search

text: I am looking for a dedicated search engine that doesn't need to search through my MySQL database, but accesses a xml/xhtml file for **fast** search capabilities. Faceted search is a huge requirement. I went with a service called Open Solr for two reasons: 1. It's a free Solr hosting service. 2. My hosting provider does not support Java or Tomcat. I set up a free account, indexed my website, and installed the Solr for WordPress plugin. Thinking I was good to go, I got several errors in my WordPress site:   1. When I check server settings in the WP admin panel, I get a Ping Failed! message   2. When I try and run a search, I get the error: Fatal error: Uncaught exception 'Exception' with message '"0" Status: Communication Error'


title: Show last n comments

text: let's say I have posts with hundreds of comments, and that I want to show only the last N comments and then a link to a page read them all. How would I display the last N comments? Thank you, Dino.


title: Add a series of checkboxes to theme options

text: Hi I made a theme options by this tutorial This options have multicheck type by checkboxes. I don't know how to make it work. I'm try to exclude page using this multicheck. This is my array with options:               $pages = get_pages('sort_column=post_parent,menu_order');     $pageids = array();         foreach ($pages as $page) {             $pageids[$page->ID]= $page->post_title;         }     array( "name" => "Exclude page",             "desc" => "",             "id" => $shortname."_excludepage",             "type" => "multicheck",             "options" => $pageids,             "std" => ""),      This screen show how this function looks in my DB:               http://i.stack.imgur.com/QFwV7.png      `512` is the ID of a page that I try to exclude. Look's like this in admin:               http://i.stack.imgur.com/31TQa.png      In my template I've use this standart method for exclusion:               wp_list_pages("exclude=get_option('src_excludepage'));      Please help me with this function! Thank you!


title: How to make pages metabox display all hierarchy in menu admin?

text: Running WP 3.9.1 I've got lots of pages and sub pages. When I get to create menu lots of sub pages doesn't display on the right level, but some do? This is how the pages metabox is displayed The pages metabox should display something more like this * * * **_EDIT_** Number in screenshot are a bit screwed sorry about that. The problem is after the first few all the pages are displayed on the same level but they shouldn't. It should look like this   * Page 1      * SubPage A of Page 1     * SubPage B of Page 1        * SubPage 1 of SubPage B       * SubPage 2 of SubPage B       * SubPage 3 of SubPage B   * Page 2      * SubPage A of Page 2        * SubPage 1 of SubPage A       * SubPage 2 of SubPage A     * SubPage B of Page 2        * SubPage 1 of SubPage B       * SubPage 2 of SubPage B ... * * * Any idea what cause this or how to fix it, so i can manage my menu?


title: Add additional field to custom post_type

text: I am trying to add another field (subtitle) to my already created and existing custom post_type: team (code from functions.php in my * _child_ *theme)               <?php     /**      * Custom Post type register framework      */     include(get_stylesheet_directory(). '/inc/acpt/init.php');     add_action('init', 'makethem');     function makethem() {         $args = array(             'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail', 'excerpt'  ),             'hierarchical' => true,         );              $team = new post_type('team','team', false,  $args );          }          /**      * Initialize the metabox class      */     add_action( 'init', 'be_initialize_team_meta_boxes', 9999 );     function be_initialize_team_meta_boxes() {         if ( !class_exists( 'team_Meta_Box' ) ) {             require_once( get_stylesheet_directory(). '/inc/metaboxes/fisio-metaboxes.php' );             require_once( get_stylesheet_directory(). '/inc/metaboxes/init.php' );              }     }     ?>      And this is the code in fisio-metaboxes.php                   <?php     /**      * Include and setup custom metaboxes and fields.      *      * @category YourThemeOrPlugin      * @package  Metaboxes      * @license  http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)      * @link     https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress      */          /**      * Define the metabox and field configurations.      *      * @param  array $meta_boxes      * @return array      */      add_filter( 'team_Meta_Box', 'team_sample_metaboxes' );     function team_sample_metaboxes( array $meta_boxes ) {         $prefix = '_team_';         $meta_boxes[] = array(                 'id'         => 'team_details',                 'title'      => 'Team details',                 'post_type'      => 'team', // Post type                     'context'    => 'side',                 'priority'   => 'high',                 'show_names' => true, // Show field names on the left                 'fields'     => array(                     array(                         'name' => 'Subtitle',                         //'desc' => '',                         'id' => $prefix . 'subtitle',                         'type' => 'text'                     ),                 ),             );         return $meta_boxes;     }          add_action( 'init', 'team_initialize_team_meta_boxes', 9999 );     /**      * Initialize the metabox class.      */     function team_initialize_team_meta_boxes() {              if ( ! class_exists( 'team_Meta_Box' ) )             require_once get_stylesheet_directory(). '/inc/metaboxes/init.php';          }      The problem is that when in the wp-admin i whant to add a new team's post_type post, the post_type doesn't have the subtitle field What am I missing? Edit: In case you Didn't notice I've never done this before. I am following this steps with no succeed.. -EDIT- I am also trying like this:               $meta_boxes[] = array(                 'id'         => 'team_details',                 'title'      => 'Team details',                 'pages'      => 'team', // Post type                     'context'    => 'normal',                 'priority'   => 'high',                 'show_names' => true, // Show field names on the left                 'fields'     => array(                     array(                         'name' => 'Subtitle',                         'desc' => 'This is the subtitle',                         'id' => $prefix . 'subtitle',                         'type' => 'text'                     ),                 ),             );      -EDIT- Also tried passing the post_type as an array               'pages'      => array('team'), // Post type


title: Ordering of gallery images without using shortcode in theme

text: I using the built-in gallery in wordpress to store and sort images inside a custom post type. In the theme I was using:               $attachments = get_posts(                      array('post_type' => 'attachment',                            'post_parent' => $post->ID,                            'orderby' => 'menu_order'                      )                    );      The above code returns the gallery images correctly, but in the wrong order. When I look at the content field for the post containing the gallery, it contains the gallery data:               [gallery ids="2,5,7,8"]      So, my guess is that the built-in gallery doesn't store the sorting in a separate field like `menu_order` instead it stores a sorted list of attachment ids in the content field of the parent post. So my question is what would be the best way to get the gallery images sorted correctly from the theme? I tried something like:               $matches = array();     if(preg_match('/ids="(.*)"/', $post->post_content, $matches)) {         $ids = $matches[1];              $query = "SELECT * FROM $wpdb->posts ".                  "WHERE post_type = 'attachment' &&                         post_parent = $post->ID ".                  "ORDER BY FIELD(ID, $ids)";         $attachments = $wpdb->get_results($query);      }      This seems to work but is there a cleaner way of doing this.


title: Using file_exists to check file in Uploads

text: Context: For a site's images used in a particular section, each post relies on a base name put into meta data, which then is used with automatic extensions to generate large images, gallery thumbnail images, and an index page thumbnail as well. For example, if Example_Name is the base name, then:   `Example_Name_2-LG.jpg` is the second large image in the series   `Example_Name_2_SM.jpg` is the corresponding second gallery thumbnail image   `Example_Name_IN.jpg` is the index thumbnail chosen to represent the set By using meta data and PHP conditionals, all the client has to do is put in the base name once and upload the appropriately named images to the Uploads folder, and the page template fills in the blanks. All this is working fine, with one catch. There are seven slots for the thumbnails, and the page displays _all_ of the thumbnail divs, even if there are less than seven thumbnail images in the Uploads folder. I'd like to wrap each thumbnail div with a conditional that uses `file_exists` to check for the existence of thumbnail images actually in the Uploads folder, so that if the named image doesn't exist at the indicated file path, the corresponding empty div (and its hyperlink) won't appear. I've tried constructing absolute paths using the `wp_uploads_dir` function, as well as `bloginfo('template_directory')` and even the deprecated `TEMPLATEPATH`, but have only succeeded in generating PHP errors. I'm assuming this is a path problem or something particular I don't understand about the PHP function `file_exists`. Page blow-up example using wp_upload_dir:               <?php          $upload_dir = wp_upload_dir();          if ( file_exists( echo $upload_dir['baseurl'] . '/' . echo get_post_meta($post->ID, '_meta_example_name', true) . '_7_SM.jpg') ) {     ?>         <div id="thumb7" class="thumb">  <!-- Should appear only when Example_Name_7_SM.jpg exists -->             ...         </div>          <?php } ?>      Any suggestions appreciated.


title: Display current taxonomy term when inside custom post type

text: Well, this should be pretty simple, however I couldn't find answer anywhere on the web. all answers I found were close but no exactly what I needed. what I need is to display just the current term of a custom post type I am in. **not all the terms just one!** (the relevant one) this is what I'm using but it displays ALL the terms which is not good for me:               <?php     $taxonomy = 'genre';     $queried_term = get_query_var($taxonomy);     $terms = get_terms($taxonomy, 'slug='.$queried_term);     if ($terms) {       foreach($terms as $term) {         echo $term->name;       }     }     ?>      remember - I would like to display it in my single post type template can anyone suggest? thanks


title: Plugin like the "I Love It" Theme?

text: I'm looking for a plugin that allows users to give a 'thumbs up' or otherwise say they like a post. Additionally, I want to be able to display a graphic with the number of likes/loves/'thumbs ups' when the posts are shown in a list. This theme seems to have the functionality I am looking for: http://themeforest.net/item/i-love-it-content-sharing-wordpress- theme/full_screen_preview/698475 A user can click the heart to say they 'love' the post, the number of people who 'love' the post is shown in the excerpt as well. Our website has Product Reviews and Recipes, and I'm wanting to find a plugin (or code, if need be) that will allow people to say, "Yes, I've tried this and love it too!". Then in the grid-layout of posts (of both Product Reviews and Recipes), users would be able to see how many others like those specific products or recipes. Is there a plugin out there that would allow me to do what I'm trying to accomplish? Thank you!!


title: Customized widget area - how to override or filter class xoxo?

text: I need some help with restyling my alternate widget areas. I've created some new widget areas, and placed one into the main content of my **index.php**. This works just fine, however i want to style it differently.   * **WordPress:** 3.0.4   * **Theme:** Twenty Ten Child (twentyten-child)   * **Server:** Local/MAMP I've tried creating new style definitions for this particular widget area, mainly wanting to get rid of the list bullets. I've also tried `list-style: none` with every one of the widget css definitions in my child theme's stylesheet, _this doesn't appear to be working_. Firebug shows that the widget has a class of `xoxo` so i removed reference to that class in my file **sidebar-content.php** and there’s no such string in either the parent or child theme's functions. The widget I’m calling to the area is WP's **_default blogroll widget_**.   1. Is there any way to remove the xoxo class attached to this widget from within the theme twentyten, perhaps using a filter?   2. How can I resize the widget widths to allow them to fill up the custom widget area – or will they automatically do so? The sidebar html for this widget area as follows:               <?php      /* Theme:twentyten-child-kw     Alt Sidebar containing the content widget areas.     @package WordPress     @subpackage Twenty_Ten     @since Twenty Ten 1.0 */ ?>          <div id="content" class="alt-widget-area" role="complementary">          <?php /* When we call the dynamic_sidebar() > function, it'll spit out the widgets for that widget area. If it instead returns false, then the sidebar simply doesn't exist, so we'll hard-code in some default sidebar stuff just in case. */     if ( is_active_sidebar( 'alt-content-widget-area' ) ) : ?>     <?php dynamic_sidebar( 'alt-content-widget-area' ); ?>     <?php endif; // end content widget area ?>          </div><!-- #content .alt-widget-area -->      In my child theme's style sheet, created definitions for the class `alt- widget-area` are based on the parent theme's definitions for `widget-area`, however, the class `xoxo` is taking precedence over everything. Any suggestions please?


title: Adding file types in wordpress

text: I am trying to upload java files to my word press blog but it does not let me upload any files with .java extension. It says _".java” has failed to upload due to an error_ *File type does not meet security guidelines. Try another.* So how do I add .java extension so that it allows me to upload java source code. I am using wordpress version 3.0.4. Thanks.


title: Error 404 on pagination on homepage

text:
I have a blog Post home page with the following code in `home.php`:

Featured Products
     <?php      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;     wp_reset_query();     mp_display_products('&post_type=product&paged=' . $paged, $display) ; ?>

      Now the homepage works just fine, but the ?paged=2 throws an error 404. Don't know why. In products categories the pagination works fine too. Any help would be appreciated. **EDIT** Here is the code to the function `mp_display_products()`               function mp_display_products($query = '', $display){                  wp_reset_query();                  //$new_query_wp = new WP_Query($query) ;             $new_query = query_posts($query) ;                       wp_simple_pagination(/*array('base' => 'store/products')*/);                     $i = 1 ;                  if($display == 'row'){                     echo '
' ;             }                  if ( $new_query != '' ) : ?>                          <?php /* Start the Loop */ ?>                     <?php foreach ($new_query as $post) {                                          $sale_price = get_post_meta($post->ID, 'mp_sale_price', true) ;                                     $sale_price = $sale_price[0] ;                                     $price = get_post_meta($post->ID, 'mp_price', true) ;                                          //Determines end_price                                     if($sale_price == 0){                                                  //End price is normal price                                             $end_price = '$'.$price[0] ;                                          }                                     else{                                                  //Or end price is  sale price                                             $end_price = '$'.$sale_price ;                                     }                                     //If theres a sale price                                     if($sale_price != 0){                                                  //We display                                             $price = 'RRP: $'.$price[0].'' ;                                          }                                     else{                                                  //Or we don't                                             $price = "" ;                                     }                             ?>                             <?php //We display each product                                  //Let's shorten the title string                             $title = $post->post_title ;                             $string_size = 25 ;                                  //Test if string is longer that string_size                             if(strlen($title) > $string_size){                                          $title = substr($title, 0, $string_size).'...' ;                                  }                                  //Check if we need a grid of a row display                             if($display == 'grid'){                  //Inventory             $inventory = get_post_meta($post->ID, 'mp_inventory', true) ;                                  ?>                     <article class="post-<?php echo $post->ID ; ?> product post-product-<?php echo $i ; ?>">
<a href="<?php echo get_permalink( $post->ID ) ; ?>" title="View product: <?php echo $post->post_title ; ?>"><?php echo $title ; ?>
                                  <?php //Test if there is a thumbnail                             if(has_post_thumbnail($post->ID)){                                          echo '
' ;                                     mp_product_image( $echo = true, $context = 'list', $post->ID, $size = 200 ) ;                                     echo '
' ;                                  }                             else{                                          echo '

' ;                                  }                             ?>
                                          <?php echo $price ; ?>                                     <a href="<?php echo get_permalink($post->ID) ; ?>">Details                                     <?php echo $end_price ; ?>                             <?php                                  //If inventory isn't empty                             if(!empty($inventory)){                                     mp_buy_button( $echo = true, $context = 'list', $post_id = $post->ID ) ;                             }                                          ?>

                                  <?php                                  }//end grid display                             //Start row                             else{                                          echo '
                                                  ' ;                                             if(has_post_thumbnail($post->ID)){                                                          echo '
' ;                                                     mp_product_image( $echo = true, $context = 'list', $post->ID, $size = 88 ) ;                                                     echo '
' ;                                                  }                                             else{                                                          echo '

' ;                                                  }                                          echo '
ID ).'" title="View product: '.$post->post_title.'">'.$post->post_title.'
                                             ID ).'">Details	                                             Customer Rating:' ;                                             if(function_exists('kk_star_ratings')) : echo kk_star_ratings($post->ID); endif;                                          $comments_count = wp_count_comments( $post->ID );                                          echo 'Reviews ('.$comments_count->approved.')	                                             '.$end_price.'';                                             mp_buy_button( $echo = true, $context = 'list', $post_id = $post->ID ) ;                                     echo '
' ;                                  }                                       $i++ ;                                  if($i == 4){ $i = 1 ; }                                  ?>                          <?php }                             if($display == 'row'){                             echo '
' ;                     }                     ?>             <?php else : ?>             <?php endif; ?>

             <?php             wp_simple_pagination(array('base' => 'store/products'));     }


title: PHP5, Inheritance, Singleton - action & filter hook limitations

text: I'm currently working on a plugin, which uses the builtin cron functionality of wordpress. Instead of using PHP4, I want to use PHP5 with inheritance and the singleton design pattern. I run in some limitations with the action & filter hook mechanism and wanted to ask, if you have an other approach for this problem. I've stripped out all not relevant parts from the example code. If you need the full code for demostration, please post here so I can add an pastbin link. **Example:** In the base class "Cron" I want to declare all methods, which describes a cron job. To register a new cron-entry I use add_action with the hookname and a callable method. **The problem:** To call this action-hook, the builtin wordpress function do_action needs access from outside to this method. To solve the problem, I declared the method as public static. But this doesn't seems right either. The method should not be accessable from outside. It should be private. Only the MyCron class should have the permission to access this method. I tried different things as you can see in the comment block in the example. Only if I declare the constructor public (which would destroy the singleton pattern), I'm able to set the method to private. But then, everytime I add an event, a new MyCron object would be created. Any suggestions? Thanks, Roman               class Cron {         private $_events;              protected function __construct() {             $this->_events = array();         }              protected function addEvent($timestamp, $recurrence, $hookname, $hookmethod, $args = array()) {             $this->_events[] = $hookname;                  if (!wp_next_scheduled($hookname)) {                 wp_schedule_event($timestamp, $recurrence, $hookname, $args);             }                  add_action($hookname, $hookmethod);         }     }          class MyCron extends Cron {         private static $_instance = null;              public static function getInstance() {             if (is_null(self::$_instance)) {                 self::$_instance = new self();             }                  return self::$_instance;         }              protected function __construct() {             parent::__construct();                  /* Note:               * The passing action hook must be public static to be callable from outside. An other option is to declare the constructor              * public. But this means, everytime I add e new event I will create an new object of MyCron. This is the reason why I              * the singleton php design pattern with a private/protected constructor.              *               * This doesn't work either:              * 1) $this->addEvent(time(), 'daily', 'webeo-daily-event', 'MyCron::getInstance->myDailyEvent');              * 2) $this->addEvent(time(), 'daily', 'webeo-daily-event', 'MyCron::getInstance::myDailyEvent');              * 3) $this->addEvent(time(), 'daily', 'webeo-daily-event', array('MyCron::getInstance', 'myDailyEvent'));              * 4) $this->addEvent(time(), 'daily', 'webeo-daily-event', create_function('', 'return MyCron::getInstance()->myDailyEvent();'));              * 5) $this->addEvent(time(), 'daily', 'webeo-daily-event', function() { return MyCron::getInstance()->myDailyEvent(); });              */             $this->addEvent(time(), 'daily', 'webeo-daily-event', array($this, 'myDailyEvent'));              }              public static function myDailyEvent() {             // do this every day with wp cron         }     }


title: How do I test whether [gallery] is empty?

text: How do I test whether there are any images attached to a post? I'm using the gallery shortcode, but I want to put it in a conditional so the surrounding styling isn't displayed if the gallery is empty.


title: Connect another DB and fetch records from some tables

text: I want to connect with another wp db & then fetch records from new connected db then close that db. I follow How can I connect to another WP database and use WP_Query? but after connect to new db if I print `$wpdb` it does not show the new db tables. here is the code:               global $wpdb;     $wpdb_backup = $wpdb;     $wpdb = new wpdb( NEWS_DB_USER, NEWS_DB_PASSWORD, NEWS_DB_NAME, NEWS_DB_HOST );     # Do your stuff here...     var_debug($wpdb);     # then when done...     $wpdb = $wpdb_backup;      below variables I defined in wp-config.php               NEWS_DB_USER, NEWS_DB_PASSWORD, NEWS_DB_NAME, NEWS_DB_HOST      and output is:               wpdb Object     (         [show_errors] =>          [suppress_errors] =>          [last_error] =>          [num_queries] => 0         [num_rows] => 0         [rows_affected] => 0         [insert_id] => 0         [last_query] =>          [last_result] =>          [result:protected] =>          [col_info:protected] =>          [queries] =>          [prefix] =>          [ready] => 1         [blogid] => 0         [siteid] => 0         [tables] => Array             (                 [0] => posts                 [1] => comments                 [2] => links                 [3] => options                 [4] => postmeta                 [5] => terms                 [6] => term_taxonomy                 [7] => term_relationships                 [8] => commentmeta             )              [old_tables] => Array             (                 [0] => categories                 [1] => post2cat                 [2] => link2cat             )              [global_tables] => Array             (                 [0] => users                 [1] => usermeta             )              [ms_global_tables] => Array             (                 [0] => blogs                 [1] => signups                 [2] => site                 [3] => sitemeta                 [4] => sitecategories                 [5] => registration_log                 [6] => blog_versions             )              [comments] =>          [commentmeta] =>          [links] =>          [options] =>          [postmeta] =>          [posts] =>          [terms] =>          [term_relationships] =>          [term_taxonomy] =>          [usermeta] =>          [users] =>          [blogs] =>          [blog_versions] =>          [registration_log] =>          [signups] =>          [site] =>          [sitecategories] =>          [sitemeta] =>          [field_types] => Array             (             )              [charset] => utf8         [collate] =>          [real_escape] => 1         [dbuser:protected] => root         [dbpassword:protected] =>          [dbname:protected] => africac_web         [dbhost:protected] => localhost         [dbh:protected] => Resource id #320         [func_call] =>          [is_mysql] => 1     )


title: how to make nsfw post with thumbanil

text: iam making a comic site like 9gag the front end upload page contains title upload image tags NSFW [checkbox] if every thing is normal the image become featured image of the post , i want the NSFW option to work , so if the uploader click the check box value (yes) will stored in costume filed called NFSWEG, so in the loop page iam showing the thumbnail by this code               <?php        if(has_post_thumbnail())  {         the_post_thumbnail(array(400,400, true),         array("class" => "aligncenter featured_image")           ); } ?>      iwant to replace the thumbanil with another image if the post have the value yes in the costume files your code worked perfectly now i want to implant it in this can you help me again i tried really but the is always an error idont know why thanks that was enough


title: get_the_term_list() display in ul li and remove <a> tag

text:
I want to remove tag in get_the_term_list()               <?php echo '
';     echo get_the_term_list( $post->ID, 'portfolioType', '
', ',

', '
' );     echo '
'; ?>      It's need to return

List one

List two

      i tried with preg_replace() but not working


title: How to remove the Theme Customization Button from the dashboard and themes options page?

text: In my Wordpress theme that I've currently been building I do not take advantage of the Wordpress Theme Customization API. As much as I would like too, I've invested far too much time into my own personal theme options framework for changing things. This leads me to my question. How do I remove the blue, "Customize Your Site" button from the dashboard as well as link shown when viewing Appearance > Themes? I did some Googling, but my Google-Fu failed and couldn't find a solution that didn't use CSS or Javascript. Ideally a hook to remove it would be best. But if there is no clean way to do so, a JS and or CSS solution would be fine.


title: Auto-Populate Image After Media Upload

text:
I am trying to auto-populate an image on a theme page using the native Wordpress media uploader, but I want the image to populate before the option is saved. With the code below, the url to the image is populating correctly into the `input` field automatically, but I cannot figure out how to get the image to display:                                 <input style="float:left; width:80%" id="upload_image" type="text" name="upload_image" value="<?php echo $options['upload_image']; ?>" />           <input style="float:right" id="upload_image_button" type="button" value="Upload Image" />
            <img id="upload_image" name="upload_image" src="<?php if ($options['upload_image'] != "" ) { echo $options['upload_image']; } ?>" />                 	      ADDED CODE: Here is the script for the #upload_image_button               jQuery(document).ready(function() {          jQuery('#upload_image_button').click(function() {      formfield = jQuery('#upload_image').attr('name');      tb_show('', 'media-upload.php?type=image&TB_iframe=true');     return false;     });          window.send_to_editor = function(html) {      imgurl = jQuery('img',html).attr('src');      jQuery('#upload_image').val(imgurl);      tb_remove();     }          });


title: Removing <p> tags around <div> tags

text: I’d like to stop WP from wrapping `<p>` tags around `<div>` tags in the TineMCE editor … Here’s what I’ve got:               function filter_ptags_on_images($content) {         return preg_replace('/<p>([^>]*)<\/p>/i', '$1', $content);     }          add_filter('the_content', 'filter_ptags_on_images');      That removes all `<p>` tags around text but nothing that is wrapped in `<p><div>text</div></p>`. I’d also like to know a solution if I have nested `<div>` tags like `<p><div><div>text</div></div></p>`.


title: Change position of entry title

text:
I've been unable to move the post entry title to under the post's image. Whenever I do this, the title moves under the content and appears just above the footer. **loop-single.php -**               <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

          <table id="post-<?php the_ID(); ?>" <?php post_class(); ?>

<?php the_title(); ?>

<?php the_subtitle(); ?>

     <?php the_content(); ?>      Here is my site. What am I doing wrong?


title: Plugin Breaking Wordpress Login

text: Two issues with this plugin, please help... 1 My plugin is breaking my /wp-admin to where all I get is a white screen instead of forwarding to the login screen, which is also broken when this is enabled. The rest of the site works. 2 Another problem with my plugin is that I can't get it to echo back the files in that directory. There are two files in there styles.css and new.css. I've used this method to display files in a folder before but I can't get it to work here.               <?php      /*     Plugin Name: Call Custom CSS     Description: Call custom CSS files to your theme while still being to recieve theme development updates     Version: 1.1.0     Author: Michele Narup     Author URI: http://michelenarup.com     */          function addcss(){     $directory = get_site_url() . "/wp-content/css/";     $stylesheets = glob($directory . "*.css");          wp_enqueue_style('styles' , get_site_url(). '/wp-content/css/style.css');     //echo $directory;         foreach($stylesheets as $stylesheet)         {          echo "<link rel='stylesheet'";         echo $stylesheet;         echo "type='text/css' media='all' />";         }     }     add_action('wp_head', 'addcss');           ?>      As per a discussion in the comments below I changed the function to now read:                /*     Plugin Name: Call Custom CSS     Description: Call custom CSS files to your theme while still being to receive theme development updates     Version: 1.1.0     Author: Michele Narup     Author URI: http://michelenarup.com     */               function load_my_style () {     wp_register_style('customstyle', get_site_url() . '/wp-content/css/style.css');     wp_enqueue_style('customstyle');     }          add_action('wp_enqueue_scripts', 'load_my_style');      This works but does not fix the white screen problem. /wp-admin is still not rendering anything at all on the page or page source. Also note, problem #2 is now irrelevant based on the new function, I will revisit that later. For now I'm focusing on getting the login screen to work.


title: WP E-commerce and Display Fancy Purchase Notifications

text: I have enabled Display Fancy Purchase Notification for WP E-commerce but it looks like that fancy pop-up window is not working. Console throws an error > jQuery( 'form.product_form, .wpsc-add-to-cart-button-form' ).on( 'submit', > function() { TypeError: jQuery(...).on is not a function but add to cart functionality works. Site is located here: http://www.tozzicollection.com Thanks


title: How to have one post with two seperate media libraries which upload to and load from their repective directories?

text: I am developing a project management program for my engineering company. Clients and jobs are custom post types. I have a custom uploader that I have created using wordpress's native uploader to work as a file manager for each and every client or job in the system loading only files that have been uploaded to only the client / job being viewed in the system. I would need to have a multiple libraries for each one. For example: One for permitting filess and one for general files that might be uploaded on a job. As permitting files only to be viewable to a team of people who deal with permitting issues. Another example: I want to allow multiple people be able to view what clients are in the system and upload certain files that be be of interest but only a select few should have access to view pricing information and contracts that contain sensitive information. From looking at these functions I have ran across and modified slightly, it may not be possible to do what I want without a core 'hack'. Functions:               /**      * Change Upload Directory for Custom Post-Type      *      * This will change the upload directory for a custom post-type. Attachments will      * now be uploaded to an "uploads" directory within the folder of your plugin. Make      * sure you swap out "post-type" in the if-statement with the appropriate value...      * -- This has been edited to create new folder for each      * client / post type / etc under their post id.      * -- This function works in conjunction with limitMediaLibraryItems_56456      * to ensure only the current post type's files are being shown in the file manager      * @see upload_dir directory WP filter      */     function custom_upload_directory( $args ) {              $id = $_REQUEST['post_id'];         $parent = get_post( $id )->post_parent;              // Check the post-type of the current post         if( "rpm_client" == get_post_type( $id ) || "rpm_client" == get_post_type( $parent ) ) {             $args['path'] = plugin_dir_path(__FILE__) . "uploads/clients/" . $id;             $args['url']  = plugin_dir_url(__FILE__) . "uploads/clients/" . $id;             $args['basedir'] = plugin_dir_path(__FILE__) . "uploads/clients/" . $id;             $args['baseurl'] = plugin_dir_url(__FILE__) . "uploads/clients/" . $id;         }         return $args;     }     add_filter( 'upload_dir', 'custom_upload_directory' );          /*      * added - 11/27/13      * -- This function works in conjunction with custom_upload_directory to      * ensure only the current post type's files are being shown in the file manager      * @see posts_where WP filter      */     function limitMediaLibraryItems_56456($where, &$wp_query) {         global $pagenow, $wpdb;         $id = $_REQUEST['post_id'];              // Do not modify $where for non-media library requests         if ($pagenow !== 'admin-ajax.php') {             return $where;         }              // Check post type and direct to correct folder.         if("rpm_client" == get_post_type( $id )){             $where .= " AND {$wpdb->posts}.guid LIKE '%{$id}%'";         }elseif("rfd_job" == get_post_type( $id )){             $where .= " AND {$wpdb->posts}.guid LIKE '%{$id}%'";         }         return $where;     }     add_filter('posts_where', 'limitMediaLibraryItems_56456', 10, 2 );      Anyone have any input that might aide me on this issue?


title: wp-editor-area textarea disapear on cancel-comment-reply-link click

text: I am using this tutorial to implent the wp_editor in comments. everything went fine except when i click on cancel-comment-reply-link. the form move on to its initial position on the bottom of commentlist without the textarea which is making impossible to write. i have to refrech the page to remake it appaear. FYI: my theme uses Threaded Comments               <?php     add_filter( 'comment_form_defaults', 'custom_comment_form_defaults' );     function custom_comment_form_defaults( $args ) {     if ( is_user_logged_in() ) {         $mce_plugins = 'inlinepopups, wordpress, wplink, wpdialogs';     } else {         $mce_plugins = ' wordpress';     }     ob_start();                                                  $settings = array(                                                                  'media_buttons' => false,                                                             'teeny' => true,                                                             'quicktags' => false,                                                                  'textarea_rows' => '20',                                                             'tinymce' => array(                                                             'theme_advanced_buttons1' => ' fontsizeselect, forecolor,backcolor,|,bold,italic,underline,|,' .                                                             'blockquote,|,justifyleft,justifycenter,justifyright,justifyfull ' .                                                             ',|,link,unlink,|, image, undo, redo ' .                                                             ',wp_advxxxxxxxxxx'                                                                 )                                                             );                                             wp_editor( '', 'comment', $settings );                              $args['comment_field'] = ob_get_clean();     return $args;     }               add_action( 'wp_enqueue_scripts', '__inkness_child__scripts' );     function __inkness_child__scripts() {     wp_enqueue_script('jquery');     }          add_filter( 'comment_reply_link', '__inkness_child__comment_reply_link' );     function __inkness_child__comment_reply_link($link) {     return str_replace( 'onclick=', 'data-onclick=', $link );     }          add_action( 'wp_head', '__inkness_child__wp_head' );     function __inkness_child__wp_head() {     ?>          <script type="text/javascript">     jQuery(function($){         $('.comment-reply-link').click(function(e){             e.preventDefault();             var args = $(this).data('onclick');             args = args.replace(/.*\(|\)/gi, '').replace(/\"|\s+/g, '');             args = args.split(',');             tinymce.EditorManager.execCommand('mceRemoveControl', true, 'comment');             addComment.moveForm.apply( addComment, args );             tinymce.EditorManager.execCommand('mceAddControl', true, 'comment');         });                              });     </script>                       <?php        }      I am really confused about this problem please help. thnak you in advance.


title: Custom category conditional

text: I have some custom categories and I want to show a image if its a certain category, for example i did this but its not showing:               if( is_category( 'bikes' ) )     {     echo 'MY IMAGE';     }      Could someone tell me what I have done wrong? Not sure if this will help but this is on the category page for 'bikes':               taxonomy=ait-dir-item-category&tag_ID=35&post_type=ait-dir-item


title: Is there a way to retire old tags?

text: I would like to retire some old tags I used to use. Is there a way to migrate them to a new tag, or even better, remove them from previous posts?


title: WSOD 3.9.1 – Tried Everything so far

text: Hoping someone can help me troubleshoot my White Screen of Death. Site Info:   * WP 3.9.1 (just upgraded)   * PHP Version: 5.4 (just upgraded)   * Single Version   * Many other installs of WP on this server (with same database / php settings) and they are unaffected.   * I was prompted to do the 'Update Database Required' on wp-admin when I first had the issue and I did.   * I CAN log into wp-admin and content is there in the backend working fine with no issue   * All Plugins disabled. What I've done so far:   1. Check version with version.php and database values     * wp_db_version = 27916 (matches database)     * Also checked 'home' and 'siturl' to see if they have the correct url—they do   2. Disabled plugins (renamed plugins folder to plugins.hold)     * After renaming this the site generated a code about wp-super-cache error     * After error, I added a new plugins folder > and downloaded most recent version of the plugin and installed manually     * Error message went away, but still WSOD no html generated     * I set the 'active_plugins' value to 'a:0:{}' in database   3. Deleted custom theme, should be referencing twentyfourteen   4. Manually replaced wordpress base files   5. Tried error reporting on wp-config—no reports generated, still WSOD I'm out of ideas, don't know what else to even search for—and since I can't get error reporting to show anything, I'm at a roadblock.


title: Include a php page with parameters in a Wordpress site?

text: I'm running a homemade website which mostly contains photos and text, but also has a specific page with a dynamic list through a small form. You can list data and add data with a small form. Everything is in a single PHP page with parameters through `GET`. I'm really bad in designing sites and I would like to move it to a WordPress site to take advantage of all plugins and nice themes. But doing that I would like to keep a page in which I would keep my custom form to list and add data. How can I do that ? I was thinking about keeping my old page and show it through an iframe in a WordPress page but isn't there a better solution ? The big problem, I think, is how I can pass a `GET` information inside a WordPress site.


title: How can I display only sticky posts from a parent category on the homepage?

text: On my homepage, I have 3 columns showing varying amounts of information from posts in specific categories (first 2 of them child categories, the third column displays posts from various child categories, but one parent category). I want to determine which posts to display (by category as described) in each, by making them sticky. Help?


title: Search page different title per results

text:
I have a search page that is the code below, it returns different post types based upon a user search, Is there a way I can add the following title to each post type that is found - everything I've tried only adds it to every item (I'm guessing its the loop). #  Custom post type 1 results - title 1 that I need to add --- Results 1 found here #  Custom post type 2 results - title 2 that I need to add --- Results 2 found here Here is my current code:                <?php  if (is_search()) { ?>         <?php if (get_post_type() == 'type_1') {             //Style type_1 ?>         <div id="type_1" <?php post_class(); ?>>
 <a href="<?php echo get_content_link( get_the_content() ); ?>">                 <?php the_post_thumbnail(180, 230); ?>

         <a href="<?php echo get_content_link( get_the_content() ); ?>"><?php the_title(); ?>

         <?php            } else if (get_post_type() == 'type_2') {             //Do different styling         }//endif         else { }             ?>


title: Disable ONLY URL auto complete, not the whole canonical URL system

text: I have a blog with several pages in some category "projects" that are structured/named like this:   * /projects/project-2012   * /projects/project-2013   * /projects/project-2014   * /projects/project-2015 When a user enters URLs like _http://myblog.com/project_ or even _http://myblog.com/proje_ he/she is redirected to the page _/projects/project-2012_. (With a 301 Moved Permanentely!) While I want wordpress to turn URLs resulting in one clearly defined page (e.g. like _http://myblog.com/?p=123_ ) into the canonical form, I want to disable only the URL auto-completion for "unclear" URLs that might point to several pages. My question is: How can I accomplish this? * * * I also did some research...   * The accepted answer to the question Disable Wordpress URL auto complete disables the whole canonical URL system. This is not acceptable for me.   * About four years ago something like this popped up on the Wordpress bug tracker: https://core.trac.wordpress.org/ticket/8948 While some good solutions (like offering a page "We did not found your URL. But were you maybe looking for one of the following pages?") were discussed there, the ticket was closed in the end.   * **EDIT:** There is actually a newer ticket at https://core.trac.wordpress.org/ticket/16557 which covers exactly what I need. It seems to be targeted for the 4.0 release. And the ticket comments also contain a solution (see below).


title: Custom dashboard menu does not stay open for the custom Taxonomy within it

text: ## Short Version: Custom menu with a custom post type that supports a custom taxonomy. The custom post type works, the menu for it works and stays open. The custom taxonomy works, but the sidebar menu doesn't stay open. I need to make the category keep the submenu open, as it does natively (when not placed in another menu). ## Long version: I've got a custom menu created with add_menu_page:               add_menu_page(       'Directory',           // Page Title       'Directory',           // Menu Title       'manage_options',      // Capability       'directory',           // Slug       null,                  // Rendering Function       'div'                  // Menu Icon (or "div" for CSS)     );      I have also created a custom Post Type and a custom Taxonomy. I want to make these appear within my custom menu, which according to the `show_in_menu` argument (See wiki, can't post the link), this should be supported natively. However, it simply **does not work _correctly_**. True, this option does stick the "Manage Directory" link into my custom menu, but it does **not** move the "Add Contact" or "Directory Categories (Custom taxonomy)" links into the menu. Here are a few previews: Custom Menu: http://radleygh.com/images/chrome_2013-114-14-14-16-91.png Default Menu: http://radleygh.com/images/chrome_2013-114-14-14-53-25.png As you can see, the Default Menu has three links. I need to move **all of these** to my custom men (Where I will be adding submenus). One trick I learned awhile back is that you can create submenus for existing pages, and they will behave as if they are the real menu. At least, this works for most things. It does not work with my taxonomy. See the code below:               add_submenu_page( // Manage Directory       'directory',       'Manage Directory',                  // Page Title       'Manage Directory',                          // Menu Title       'manage_options',                    // Capability       'edit.php?post_type=directory_post'  // Slug     );     add_submenu_page( // Add Contact       'directory',       'Add Contact',                            // Page Title       'Add Contact',                            // Menu Title       'manage_options',                         // Capability       'post-new.php?post_type=directory_post'   // Slug     );     add_submenu_page( // Categories       'directory',       'Categories',                             // Page Title       'Categories',                             // Menu Title       'manage_options',                         // Capability       'edit-tags.php?taxonomy=directory_category&post_type=directory_post'  // Slug     );      The above code gives me the links I want, and the "slug" for each is smart enough to point to the correct pages. In fact, it's as if the links are the native ones. But of course, they aren't. The problem though, is that for some reason the "Categories" link alone does not keep the menu open. The others do. I believe the issue is that the taxonomy does not support the "show_in_menu" argument. Even though the argument is "broken" as I explained above, it does at least keep the menu open. * * * Here is the definition for the directory post type and taxonomy, in full               // Register the post type and custom category (aka taxonomy)     function dir_register_directory() {       $args = array(         'labels' => array(               'name' => 'Directory Listings',               'singular_name' => 'Directory Listing',               'add_new' => 'Add Contact',               'add_new_item' => 'Add New Contact',               'edit_item' => 'Edit Contact',               'new_item' => 'New Contact',               'all_items' => 'Manage Directory',               'view_item' => null, // Don't need to view these               'search_items' => 'Search Directory',               'not_found' =>  'No contacts found',               'not_found_in_trash' => 'No contacts found in Trash',                'parent_item_colon' => '',               'menu_name' => 'Directory'             ),         'capability_type'     => 'post',         'hierarchical'        => false,              'public'              => true,         'show_in_menu'        => 'directory', // Nest the link under custom menu         'show_in_nav_menus'   => false, // Do NOT show these listings under Appearance > Menus              'publicly_queryable'  => false, // Will not show up in search results         'query_var'           => false, // Cannot access via ?{query_var}=         'rewrite'             => false, // Entries should not be accessed by URL              'has_archive'         => 'directory_category', // Use our custom taxonomy         'menu_position'       => 1,  // Should be on top of the parent menu's list         'supports'            => array(               'page-attributes', // Used for Sort Order             )        );        register_post_type( 'directory_post', $args );            // Create a custom category section for the Directory page       register_taxonomy(         'directory_category',         'directory_post',         array(           'rewrite' => false,           'hierarchical' => true,           'sort' => true,           'public' => true,           'show_in_nav_menus'   => false, // Do NOT show these listings under Appearance > Menus         )       );            register_taxonomy_for_object_type( 'directory_category', 'directory_post' );     }     add_action('init', 'dir_register_directory');


title: Ajax request returning full page code

text:
I'm having a bit of an issue with an ajax call on a site I've just taken over. I've used similar calls before on other sites so not sure if it's a plugin restriction or conflict but any ideas are welcome! The call is returning the full content of the page rather than the content the id of the post which is what I expected. I have added an alert to the js before the ajax call and the "thisPost" var is set correctly. I've tried a variety of different methods but none seem to let me return the post_id as a json object. In the end the return will be a json object with more details than just the post_id but cut it down till I get it working. `functions.php`               function add_calendar_scripts(){         if (is_page_template('template-eventsplanner.php') ) {             wp_register_script('calendar', ( get_bloginfo('template_url') . '/js/calendar.js'), array ('jquery'));             wp_enqueue_script('calendar');             wp_localize_script( 'calendar', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) );         }     }          add_action('wp_head', 'add_calendar_scripts');          function get_full_event_callback(){         global $wpdb;         $response = array();         $post_id = intval($_POST['posted']);         $response[] = array('id'=>$post_id);         $result = json_encode($response);         echo "post_id";         die();     }     add_action( 'wp_ajax_nopriv_get_full_event', 'get_full_event_callback' );     add_action( 'wp_ajax_get_full_event', 'get_full_event_callback' );      `calendar.js`               jQuery(document).ready(function() {         var container = jQuery('body'),             scrollTo = jQuery('.today');         container.animate({             scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() - 120         });         Shadowbox.init({             skipSetup: true         });         jQuery('.event_box').click( function(){             var pretext = "
Davis Track Hire Job Information
";             var thisPost= jQuery(this).data("event");             var contents, pdf_button;             var data = {                 action: 'get_full_event',                 dataType: 'json',                 posted: thisPost,             };             jQuery.post(MyAjax.ajax_url, data, function(response) {                 if(response!=0){                                 contents = pretext.concat(response);                     pdf_button = "Link to PDF to follow";                     // open a welcome message as soon as the window loads                     Shadowbox.open({                         content:    contents.concat(pdf_button),                         player:     "html",                         title:      "Event Details",                         height:     600,                         width:      500                     });                 }             });         });     });


title: How to include a post type in the admin/backend?

text: I'm changing the backend/admin and want to show a div above the pages. How can I include the pages like the example; ![example](http://i.stack.imgur.com/7dBAZ.jpg)               <?php     include('./tools.php') ;      this works but when I choose edit.php / edit.php?post_type=page it doesn't show anything.


title: How to disable autocomplete on the wp-login.php page

text: It looks like there is not an easy way to add autocomplete="off" to the password input on the WordPress login page without editing the wp-login.php page directly. Is there something I'm missing? I do not want to modify core files.


title: Duplicate post problem

text: I have two loops. One that shows only one post, the other shows four. however i'm getting duplicate posts. Loop one               <?php $my_query = new WP_Query('showposts=1'); while ($my_query->have_posts()) : my_query->the_post(); $do_not_duplicate = $post->ID; ?>      Loop two               <?php $my_query = new WP_Query('showposts=4'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?>      Any ideas?


title: I moved WordPress to root now posts go to 404

text: http://deepdreamers.com/?p=495 I followed the instuction from WordPress on moving your blog. When I click to gothe next page, I get a 404 message and the same happens when I click on on any posts. My Images also won't work, even though they are all there in the uploads folder.


title: Redirections the right way inside a plugin directory

text: I have a plugin, with the stylesheet: /wordpress/wp-content/plugins/pluginName/templates/templateName/style.css I'd like to access: /wordpress/pluginName/templateName/style.css I know I could change the .htaccess in order to do the redirects, but that wouldn't work on non-Apache servers. I could create a general re-direction code called: core.php?t=templateName&f=style.css and then the stylesheet in the template, all of the files, will be called from that specific file. I prefer not to do that. Which ways would you recommend to do that? If I am going the .htaccess way, how can I manage the plugin install/uninstall, and other software re-writing the .htaccess? Does Wordpress manage that somehow? Thanks a lot!


title: Sorting Woocommerce products with numeric titles

text: Just started playing around with Woocommerce, ran into a problem. I have a bunch of items (100+) and all of them only have a number as product title, 1,2,3 etc. The problem is that Woocommerce outputs the products like this: 1,11,12,13,14,15,16,17,18,19,2,20 – and so forth. How can I make it output correctly?


title: update_user_option not working as expected

text: So I was looking into the update_user_option() as I need to update an additional field upon registration. So I found this in wp-login.php:               update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag.          wp_new_user_notification( $user_id, $user_pass );      Somehow I'm not getting the default password nag upon the first login, which makes me thing update_user_option() doesn't work. Anyway, I've added the following line:               update_user_option( $user_id, 'deposit', '5', true );      Which of course didn't work (or maybe I'm looking in wrong place). I want to update 'deposit' field in 'wp.users' table. Could anyone point me what I'm doing wrong? Thanks! ### EDIT: WORKING SOLUTION:               add_action( 'user_register', 'my_save_extra_fields' );     function my_save_extra_fields( $user_id ) {     global $wpdb;                  $cash=5;             $wpdb->update( $wpdb->users, array('deposit' => $cash), array('ID' => $user_id));          }


title: Inserting comments via a procedure

text: I've been playing arround with procedures and tried putting the comment insert into a procedure. I've got some trouble and was wondering if you guys could take a look.               function wp_insert_comment($commentdata) {     $comment_ID = comment_ID;     $comment_post_ID = comment_post_ID;     $comment_author = comment_author;     $comment_author_email = comment_author_email;     $comment_author_url = comment_author_url;     $comment_author_IP = comment_author_IP;     $comment_date = comment_date;     $comment_date_gmt = comment_date_gmt;     $comment_content = comment_content;     $comment_karma = comment_karma;     $comment_approved = comment_approved;     $comment_agent = comment_agent;     $comment_type = comment_type;     $comment_parent = comment_parent;     $user_id = user_id;     global $wpdb;     extract(wp_unslash($commentdata), EXTR_SKIP);          if ( ! isset($comment_author_IP) )         $comment_author_IP = '';     if ( ! isset($comment_date) )         $comment_date = current_time('mysql');     if ( ! isset($comment_date_gmt) )         $comment_date_gmt = get_gmt_from_date($comment_date);     if ( ! isset($comment_parent) )         $comment_parent = 0;     if ( ! isset($comment_approved) )         $comment_approved = 1;     if ( ! isset($comment_karma) )         $comment_karma = 0;     if ( ! isset($user_id) )         $user_id = 0;     if ( ! isset($comment_type) )         $comment_type = '';     $wpdb->insert($wpdb->comments, '$comment_ID','$comment_post_ID', '$comment_author', '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_karma', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id');          $id = (int) $wpdb->insert_id;          if ( $comment_approved == 1 )         wp_update_comment_count($comment_post_ID);          $comment = get_comment($id);               do_action( 'wp_insert_comment', $id, $commen );          wp_cache_set( 'last_changed', microtime(), 'comment' );          return $id;      } So here I only changed the variables on the top because it didn't work out for me with the array that was previously used. I send these variables to:               function _insert_replace_helper( $table, $comment_ID, $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_karma, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id, $format = null, $type = 'INSERT' ) {         $sql = "CALL CommentsProcedure('$comment_ID', '$comment_post_ID', '$comment_author',     '$comment_author_email', '$comment_author_url', '$comment_author_IP', '$comment_date', '$comment_date_gmt', '$comment_content', '$comment_karma', '$comment_approved', '$comment_agent', '$comment_type', '$comment_parent', '$user_id')";                  return $this->query( $this->prepare( $sql, $comment_ID, $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_karma, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id ) );                     }      And this is my Storedprocedure                   DELIMITER $$          CREATE PROCEDURE `CommentsProcedure`(IN comment_ID bigint(20), IN comment_post_ID bigint(20), IN comment_author tinytext, IN comment_author_email VARCHAR(100), IN comment_author_url VARCHAR(200), IN comment_author_IP VARCHAR(100), IN comment_date datetime, IN comment_date_gmt datetime, IN comment_content text,      IN comment_karma int(11), IN comment_approved VARCHAR(20), IN comment_agent VARCHAR(255), IN comment_type VARCHAR(20), IN comment_parent bigint(20), IN user_ID bigint(20))     BEGIN              INSERT INTO wp_comments(comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id)              VALUES(comment_ID, comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id);          END     $$          DELIMITER ;      I have no clue what i'm do wrong, would be helpful if someone could give me some guidance,I've been stuck for so long and im pulling my hair!(Sorry for the bad english, not native speaker, feel free to ask if something is unclear.) Thanks in advance


title: How to Include File from Plugins into Template?

text: I need to include a file from plugin Folder in my template file. How can I do that? Is there any other way to do that rather than:               include('../../..');      Thanks


title: How to move my stats to a self-hosted website?

text: How do I move my stats from my old WordPress.com blog to my new WordPress.org self-hosted website? I've enabled Jetpack and moved my subscribers only. I would really like to keep my precious stats.


title: Having single posts appear under the blog homepage and highlight menu items properly?

text: My Wordpress site which has a static frontpage and the blog page assigned to a subpage of a section. My blog's homepage is: /be-the-first-to-care/first-to-care-blogs/ This works great for the blog page. However when I click through to a single post it breaks out of the hierarchy and appears just as /blog-post/ The menus and submenus don't highlight properly etc. Is there a good workaround for this? I'd like single posts to appear at: /be-the-first-to-care/first-to-care-blogs/blog-post/ Basically I'd like my blog to be the root of any single blog post. Would like this to carry through for category pages etc. Any ideas?


title: Favicon does not showup

text: I activated the All in one Favicon and then uploaded my Favicon in the settings but it does not show up in any browser (my under construction site: http://www.kheemh.com/). Any help will be highly appreciated.


title: Attributing a version number to a child theme's main stylesheet

text: In header.php, I like to attribute a version number to the stylesheet so that the browser gets forced to refresh it. But when working with a child theme, its stylesheet is not explicitely called, rather WordPress automatically seeks it. So how or where to attribute a version number to the child theme's stylesheet?


title: wp_insert_post issue

text: I've got the following code in the 'functions.php' file of a wordpress theme               $ppost_data = build_post( $pID, $pcontent, $pname, $ptitle, $pstatus, $ptype, $pset_comment_status );          wp_insert_post($ppost_data);      and here's the 'build_post()' function:               function build_post( $pID, $pcontent, $pname, $ptitle, $pstatus, $ptype, $pset_comment_status ) {     return array(         'ID'=>$pID,         'post_content'=>$pcontent,         'post_name'=>$pname,         'post_title'=>$ptitle,         'post_status'=>$pstatus,         'post_type'=>$ptype,         'comment_status'=>$pset_comment_status,         'post_author' => 1     );      The variables are all set, and all of the data is in the `$ppost_data` array correctly, but the page isn't being added. No errors are being thrown. Any ideas?


title: Post the content of a specific "Custom Post Type" post within a post using a shortcode

text: The posts on our music blog usually include multiple tracks of music. I want to have each individual track be its own entity--a custom post type called _"track"_ --which I want to be able to insert freely into a post where I wish using a shortcode. The image below explains pretty well what I am looking to do. (Link to the page that I took the screenshot from: _http://iloveomfg.com/210/don-rimini- whatever-kaptain-cadillac-remix/_ ) ![enter image description here](http://i.stack.imgur.com/eq0I3.jpg) I want to create a shortcode, **[track]** , which echoes the entire contents of the 'track' custom post type which id is specified. For example, if the track id is 34, the shortcode to display it within the post would be: **[track id=34]** or **[track id="34"]**. I have taken a look at all the posts related to this topic on this site, and have tried a few of the solutions, but to no avail, so I decided to go ahead and ask for my problem specifically. Can you tell me exactly what I need to do to achieve this? Let me know if you need me to clarify anything.


title: Show Published and Draft posts from Logged in Author

text: Hello there that's what i'm trying to achieve: i have a private page, where only author can access, after log in. i want to show two columns: 1 - excerpts of the latest 8 posts published by the logged in author 2 - excerpts of the latest 8 drafts by the author css and html are all set up for the two columns, but i can get the two contents to show (or at least i managed to get just the author sorting) anyone could help? thank you


title: Custom function for user register in wp?

text: I have a custom template for user registration. I want to use a function to insert users. Can I directly call wp_insert_user() function?


title: Plug-in Conflict: Art Direction and Super Cache

text: I use Art Direction plugin to create customized posts sometimes. I also want to use Super Cache plugin for traffic spikes. However I've found that once you have Supercache activated Art Direction plugin no longer works, due to the way Supercache renders your html. Is there anyway to get around this? Or is there another caching plugin that works with Art Direction?


title: questions of submit wordpress theme

text: > **Possible Duplicate:**   >  Questions about submitting theme to WordPress.org I have created one themes. which is still pending approval or denial. the theme was denied today for the following reasons:               Theme Review:      - Themes should be reviewed using "define('WP_DEBUG', true);" in wp-      config.php      - Themes should be reviewed using the test data from the Theme Checklists          ...........      (TC)      the wp-config.php is wordpress setting file. how to allter my custom theme. thank you.


title: How can I remove or change a border/outline on a picture when it is in a gallery page?

text: You can see on this page: http://www.middlegray.net/ceremonies/ the photos have a white box that is automatically applied to the pic. I want to take it off or make it a different color. Where would I look to change that?


title: If a function requires add_action('init') how can I run it only once on plugin activation?

text: I am using wp_insert_term() to insert a large number of taxonomy terms from a csv file. The contents of that csv file might change occasionally. According to the codex, wp_insert_term() needs to run on add_action('init') but I only want to run it once. How can I achieve that on plugin activation? I am currently just doing this in my plugin's constructor which runs on every page load:                  add_action('init', array($this, 'add_geo_terms'));      and then               public function add_geo_terms() {                   $path = plugin_dir_path( __FILE__ ).'assets/uk-counties.csv';         $row = 1;         if (($handle = fopen($path, "r")) !== FALSE) {             while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {                 $num = count($data);                 $row++;                 for ($c=0; $c < $num; $c++) {                     if ($c == 1) {                         error_log( $data[$c] . "<br />\n");                         wp_insert_term($data[$c],'reseller-regions');                     }                 }             }             fclose($handle);         }     }      I am using the activation functions provided by the wordpress plugin boilerplate so I don't believe this is really a duplicate.               register_activation_hook( __FILE__, array( 'WPS_RESELLER', 'activate' ) );               public static function activate( $network_wide ) {             if ( function_exists( 'is_multisite' ) && is_multisite() ) {                 if ( $network_wide  ) {                     // Get all blog ids                     $blog_ids = self::get_blog_ids();                          foreach ( $blog_ids as $blog_id ) {                         switch_to_blog( $blog_id );                         self::single_activate();                     }                     restore_current_blog();                 } else {                     self::single_activate();                 }             } else {                 self::single_activate();             }         }          private static function single_activate() {         add_action('init', 'add_partner_terms'); // i have tried many variations with classname, self etc         add_action('init', 'add_geo_terms');          }


title: Reactor Theme: Prevent Post Thumb on Post

text:
Reactor Theme is built on Zurb Foundation and is here - I think it's quite good. The theme I am replacing used the featured image in the posts or blog page but not in the post itself. Reactor calls the image in both. I want to try and change that so that I can have the featured image on the blog page and not in the post. It causes a problem because I usually use the image in the post and use that for the blog page. The Reactor theme uses lots of includes, functions, hooks and all that fancy shizzle so I am finding it complicated. I think I have worked out that this is calling in the featured image:               function reactor_do_standard_thumbnail() {      $link_titles = reactor_option('frontpage_link_titles', 0);          if ( has_post_thumbnail() ) { ?>
         <?php if ( is_page_template('page-templates/front-page.php') && !$link_titles ) {              the_post_thumbnail( 'thumb-150' );         } else { ?>                     <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail( 'thumb-150' ); ?>             <?php } ?>
     <?php }     }     add_action('reactor_post_header', 'reactor_do_standard_thumbnail', 4);      The full code for that is here on Git. Am I correct in thinking that this bit of code is what is doing what I think it is? Can anyone give me a clue as to how I change this behaviour? Thanks


title: How to redirect to cart page using wp_redirect

text: I am trying to the redirect on a cart page using a bellow code but,I am not able to redirect on cart page .               wp_redirect("'.home_url('cart').'");


title: Featured Image keeps cropping

text:
I've spent hours trying to figure this out and its driving me mad. I'm not great with php code so I'm not sure if I'm doing this the best way anyway... It should be simple - I have built a custom theme, and all I want to do is display a thumbnail that links to a lightbox effect once clicked. I want my dimensions to be 214 width x unlimited height for the thumbnail, and 500 width x unlimited height for the lightbox effect. No cropping. What I get from the code I currently have is a cropped thumbnail at 214 x 214 and cropped lightbox at 500 x 500. Why is it cropping? I have checked the media settings within my wordpress admin and this makes no difference - assuming my code is overwriting these settings anyway (?) In my function I am using the following code:               add_action( 'wp_enqueue_scripts', 'brian_scripts' );     if ( function_exists( 'add_theme_support' ) ) {     add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 214, 9999, false );     add_image_size('large', 500, 9999, true); //custom size     }      And to display them I'm using:               <?php     /*Template Name: Archive Canvases*/     ?>          <?php get_header('archivecanvas'); query_posts('cat=4&order=ASC'); ?>

<?php the_title(); ?>

<?php if (have_posts()) { ?>     <?php while (have_posts()) : the_post(); ?>

          <a rel="lightbox" href="<?php $image_id = get_post_thumbnail_id();     $image_url = wp_get_attachment_image_src($image_id,'large', true);     echo $image_url[0]; ?>"><?php if ( has_post_thumbnail() ) {     the_post_thumbnail();     }     ?>

<?php the_title(); ?>

<?php the_time('Y') ?>

<?php the_excerpt(); ?>

     <?php endwhile; ?>          <?php } ?>     <?php posts_nav_link(); ?>
          <?php get_footer(); ?>`      Can anyone help or have any ideas if something else is overriding this? It might also be worth pointing out I have used the plugin Regenerate Thumbnails to resize the images I'm pulling through, but these haven't cropped them when I view them in my Media.


title: Correct way to include extra styles & script files?

text: I'm just wondering what is the correct way to do it? Add it in via the theme header? If so, what is the proper way to do it? I see a lot of the other current stuff in there using the bloginfo() function. Thank You!


title: converting custom field date format

text: I am using the More Fields plugin which gives me the ability to create a date formatted YYYY/mm/dd and I want to convert that to be shown like: February 11, 2011 Is this possible?


title: BuddyPress: How to get info of users filtered by some x-profile data?

text: I want the list of users with their email IDs, filtered by some x-profile data. For example, I want to send an email to users who have checked a checkbox on their profile. How can I get the info of users filtered by the x-profile data?


title: How to exclude 2 Portfolio Categories from page?

text:
I want to exclude 2 Portfolio categories (IDs 4 & 23) from a page using the code below but it still displays all categories. Similar code works for 'Posts' but not for 'Port' - can anyone see what I'm doing wrong?

<?php echo the_title(); ?>

                  <?php echo $firstCat[0]->cat_name; ?>

                  <?php             $temp = $wp_query;             $wp_query = null;             $wp_query = new WP_Query();             $args = array(             'post_type' => 'port',             'paged' => $paged,             'posts_per_page' => get_theme_option("portfolio_work_count"),             'category__not_in' => array(4,23)                                );                       if (isset($_GET['slug'])) {             $args['tax_query']=array(                     array(                           'taxonomy' => 'portcat',                           'field' => 'slug',                           'terms' => $_GET['slug']                       )                  );             }