Transfer Wordpress to new Host, Images missing

So I'm helping my wife move her site. I'm moving her from Bluehost to Digital Ocean, she's on WordPress currently and I exported the DB, grabbed all the files, and uploaded everything. Everything seems fine, but the images aren't showing up. The images are on the new server, the `wp-contents/uploads` directory has the right permissions, but when you go into the Media Library...you don't see any images. Now apparently the WordPress export only exports posts, not images. I'm moving a site, I'd like everything. So I manually added an image back into the `wp_posts` table and you can see it in the media library...but you can't preview the image. So, how does WordPress want you to move images from one install to another?


Remove child category from URL

I am moving a custom website with a WP blog to WP in one install The old URL was: domain.co.uk/blog/post-name The New URL is currently (while using a Category URL rewrite of /%category%/%postname%/ ) domain.co.uk/blog/category/post-name Is there a way to remove the child category from the URL so it will be the same as the the old URL (so I don't need to 301 redirect all the old url's) The client still wants the posts to be categorised hence the need for the custom permalink


How to correctly add Javascript in functions.php

I would like to remove some ugly looking arrows that are standard on cart buttons in WooCommerce. To achieve this, I found a tip of adding the following code, which should remove the arrows when the document has loaded. I assume I am going to put it in my functions.php? How exactly would I do that?               $(document).ready(function() {         $(".woocommerce-cart").html(function(i, val) {         return val.replace(" →", "");         });         $(".woocommerce-cart").html(function(i, val) {         return val.replace("← ", "");         });     });      **EDIT** Okay. I've tried this approach: Made a file named 'removeArrows.js' and placed it in my plugin folder. This has the same content as the original code, except jQuery instead $. Then I added the following to functions.php:               function wpb_adding_scripts() {           wp_register_script('my_amazing_script', plugins_url('removeArrows.js', FILE), array('jquery'),'1.1', true);          wp_enqueue_script('my_amazing_script');      }           add_action( 'wp_enqueue_scripts', 'wpb_adding_scripts' );       I can't figure out how to make the code display properly. This did not work. Any suggestions to make this work? jQuery Snippet Source


Remove the height limit on wordpress 3.4.2

I have problems when insert images on my pages. I have a image of 1113 × 731 and I upload it to my wordpress, when I go to Add Object popup, the Full size of the image mode is of: 950 x 342. When I upload a larger sized image this always limit the height to 342, Why? I tried deleting the width/height html attribute from the image, but the URL image looks like this "http://mywordpress.net/wp- content/uploads/2014/06/image-950x342.jpg" This always modify the height to 342, but I cant find these option on any place. ![example image](http://i.stack.imgur.com/CpRVF.jpg) Thanks for the help. Title edited. Sorry Wordpress 3.4.2 This a example code when I insert a image in one of my pages:                     How you can see, the image used in the src is a little version that create wordpress, i want this use the real size url: http://todogangas.net/wp- content/uploads/2014/06/MOVIL.jpg


Why might conditionals not work on a page?

<?php          if (is_single()) {         echo '1';          } elseif ( is_page() ) {         echo '2';          } else {        echo '3';     }          ?>      I put this snippet at the top of index.php, which is what I'm using to govern the layout of my blog post feeds. I then created a new page, set template to default, and left it blank. It shows all of my posts. But the snippet above echoes a 3. It's using index.php as the template, but it's a page. Why isn't it echoing 2? **UPDATE** Since the blog feed page was set in Settings > Reading, I had to use the conditional `is_home();`. Apologies for all of the confusion.


Why does including a file in theme's functions.php not work?

For example, if I write some code (e.d. add a custom post type or something) in my theme's functions.php, it works fine. If I move it to a new file, then `include()` the file in my theme's functions.php file, it no longer works (but debug code using `error_log()` still works. e.g. Here's functions.php:               <?php     // ###### functions.php ######     error_log("fu_debug: Including the post type.");          add_action('init', 'fu_create_project_post_type');     function fu_create_project_post_type() {         error_log("fu_debug: create project post type");              register_post_type( 'fu_project',             array(                 'labels' => array(                     'name' => __( 'Projects' ),                     'singular_name' => __( 'Project' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'projects'),             )         );     }     ?>      That works fine. Now, if I change functions.php to this:               <?php     // ###### functions.php ######     include "newfile.php";     ?>      and put the code inside newfile.php like this:               <?php     // ###### newfile.php ######     error_log("fu_debug: Including the post type.");          add_action('init', 'fu_create_project_post_type');     function fu_create_project_post_type() {         error_log("fu_debug: create project post type");              register_post_type( 'fu_project',             array(                 'labels' => array(                     'name' => __( 'Projects' ),                     'singular_name' => __( 'Project' )                 ),                 'public' => true,                 'has_archive' => true,                 'rewrite' => array('slug' => 'projects'),             )         );     }     ?>      the code no longer works, but the error_log() message still shows up in the logs. Why does the error message still work, but the wordpress code not?


Refine user taxonomy query based on role

I have a bunch of custom user taxonomies which I use to group users by, and then show these users on the front end with the following code (from taxonomy-{term}.php) > >     <?php // Get each user from taxonomy >                 $term_id = get_queried_object_id(); // Get Term ID >                 $term = get_queried_object(); // Get term >                 $users = get_objects_in_term( $term_id, $term->taxonomy ); >                 if ( !empty( $users ) && (/* Condition based on role here > */) ) { >                 ?> >                     <?php foreach ( $users as $user_id ) { ?> >
 >                             <?php /* Image */ echo get_avatar( > get_the_author_meta( 'user_email', $user_id ), '204' ); ?> >
<?php /* Name */ the_author_meta( > 'first_name', $user_id ); ?> <?php the_author_meta( 'last_name', $user_id ); > ?>
 >
<?php /* Short Bio */ the_author_meta( > 'short_bio', $user_id ); ?>
 >
 >                     <?php } ?> >                 <?php } ?> >   The code is working just fine, but I would like to refine the results based on what role the users have. I have a role called "invisible" which lets the user access their profile but they won't be visible on the site until i change the role to one that is visible. Ideally I would like to use something like `if (!user_has_role('invisible'))` I've tried different solutions but I just can't seem to get it right.


Why is my pagination showing up?

I have the following code, Assume this code spits back one post. the page displaying that post will also display pagination. Why? It shouldn't. This code only queries for posts that belong to the post type of post.                   protected function _general_wordpress_loop(){             query_posts("post_type=post");             if($this->_wp_query->have_posts()){                 while($this->_wp_query->have_posts()){                     $this->_wp_query->the_post();                          if(isset($this->_options['post_before'])){                         echo $this->_options['post_before'];                     }                             $this->_components->thumbnail($this->_options);                          $this->_components->title($this->_options);                          the_excerpt();                          if(isset($this->_options['post_after'])){                         echo $this->_options['post_after'];                     }                 }                      if(isset($this->_options['navigation_wrap'])){                     $this->_components->loop_navigation($this->_options['navigation_wrap']);                 }else{                     $this->_components->loop_navigation();                 }                  }else{                 $this->_components->error_page($this->_options);             }         }      A quick run down, we query the post type of post, state if we have more posts, while we have more posts display the post, after the while, display the pagination (if there is a wrap (divs) wrap the nav, else display as normal). If there are no posts, display a custom error page. Pretty basic and simple stuff. How ever I am getting pagination for things like, the category test has one post and I can see pagination. is there a way to say "if you have more then one post display this?" I know `if(have_posts()){}` will do what ever assuming it has more then 0 posts which means pagination will be displayed by that logic.


Passing a varible from jQuery to PHP

I have a a bunch of li's that are a blog but i want to show them enlarged in a colorbox. Therefore I need to know which li I clicked so I can get that ID and use that in my query to get all the date for that post. Now I thought that the best way is to retrieve the blog id with jQuery and then use that to add to my query in the footer.                   <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
         <li id="<?php the_ID;?>">blog
              //My colorbox inline frame         <?php query_posts( 'p="the_ID_of_clicked_li' ); ?>          etc etc      I think this can be done with AJAX but is there a more simple method and give me a clean URL? I haven't AJAX in projects before, so I am a beginner with that. Any thoughts would be appreciated


Why tags are displayed bellow the content and not inside

I am developing a theme for myself and I was wondering why wordpress tags are allways displayed bellow the_content. I know that this can be done via shortcode, but I would like to know if this is for seo purposes, or there is any technical reason? I´am asking because I didn´t find any information on the web... My code: in functions.php (found in here)               function tags_in_post($atts) {    // [tags] outputs post's tags in a span     global $post;     $tags = '';     ob_start();     the_tags( '', ', ', '' );     $tags = ob_get_contents();     ob_end_clean();     return $tags;     }     add_shortcode ('tags', 'tags_in_post');      Than this shorttag [tags] must be used inside the wordpress editor. Thanks


meta_value_num sort glitch

i have a custom query, and I have a meta key that contains a sequence number: 1.1, 1.2, 2.1, 2.2... 11.1, etc the problem occurs when the numerical sequence gets in to double digits, ie. 5.11, 5.12, 5.21 these appear as such 5.1, 5.11, 5.12, 5.2, 5.21 etc instead of 5.1, 5.2, 5.3... 5.11, 5.12 etc how can I make them sort properly!?               $loop = new WP_Query(array(         'factsheet_category' => $term->slug,         'orderby' => 'meta_value_num',          'meta_key' => 'factsheet_id',          'order' => 'ASC'     ));


add_user_meta() vs update_user_meta()

I'm looking at the docs for `add_user_meta()` vs `update_user_meta()`. If the current meta_key does not exist for a user, will `update_user_meta()` automatically add the meta_key for that user or do you have to define the meta_key with `add_user_meta()` first?


setup_postdata doesn`t seem ot be working

I'm having issues with `setup_postdata()`. From my understanding, if I want to use functions such as `the_permalink()` or `the_title()`, I must use `setup_postdata()`. Right now, `the_permalink()` or `the_title()` is returning nothing (blank). I've also tried `echo get_the_title()` to see what happens but even that yields the same result. Here is the code the relates to the problem:                 $posts = get_posts($args);       foreach($posts as $post) {         setup_postdata($post);       ?>
         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
           <?php if(has_post_thumbnail(get_the_ID())): ?>             <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), array(650,200)); ?>             <div style="background: url('<?php echo $image[0]; ?>') center center no-repeat;">
           <?php endif; ?>

             <?php $cat = get_the_category(get_the_ID()); ?>             <?php echo $cat[0]->cat_name; ?>             <?php the_title(); ?>             <?php the_excerpt(); ?>

       <? }       wp_reset_postdata();      So basically, this code is within a function that is a callback function for an AJAX request. The function grabs the next set of posts to simulate someone clicking the next page button. After `get_posts()` the `$posts` variable gets populated by the proper posts so it is getting something. Right now, it responds with just the tags with no data in them. Thanks.


Using "media_handle_sideload" to upload images programmatically does not upload image to Media Library

I am using this code to try to upload images located in my server to Media Library of my wordpress installation.               <?php          include("../../../wp-blog-header.php");         include("../../../wp-admin/includes/file.php");         include("../../../wp-admin/includes/media.php");              $id = 0;         $image = $_SERVER['DOCUMENT_ROOT'] . "/image01.jpg";         $array = array( //array to mimic $_FILES                 'name' => basename($image), //isolates and outputs the file name from its absolute path                 'type' => 'image/jpeg', //yes, thats sloppy, see my text further down on this topic                 'tmp_name' => $image, //this field passes the actual path to the image                 'error' => 0, //normally, this is used to store an error, should the upload fail. but since this isnt actually an instance of $_FILES we can default it to zero here                 'size' => filesize($image) //returns image filesize in bytes             );              media_handle_sideload($array, $id); //the actual image processing, that is, move to upload directory, generate thumbnails and image sizes and writing into the database happens here     ?>      I can see that this code takes my image called "image01.jpg" located in that path and then it put the image to /wp-contents/uploads/. However when I go to the admin panel in wordpress to see the image in the Media Library I cannot see the image. Also there is not any row in the wp_posts of this image. **UPDATE:** I used this time this code:               $result = media_handle_sideload($array, $id);     echo "Finish media handle sideload
";          if ( ! is_wp_error( $result ) ) {         echo "Result
";         print_r($result);     } else {         echo "Error
";         print_r($results);     }     echo "Finish script
";      Nothing is shown is the execution. I can't see the msg "Finish media handle sideload". However the file is moved from path specified in "$image" to "wp- content/uploads". Note that the files is moved, not copied, so if I execute the script without copy again the image to the source (path of $image), I can see some warnings about filesize function likes this: > Warning: filesize(): stat failed for > C:/Users/dlopez/Documents/Development/web-folders/image01.jpg in > C:\Users\dlopez\Documents\Development\web-folders\wp_test\wp- > content\plugins\pods-csv-importer\upload.php on line 16


How can I implement Search feature for Membership site?

I have a membership site where I am using Wishlist membership plugin. There are few Courses for which the user signed up and after signing up, they can get access to different modules and their corresponding lessons. All these lessons have multiple videos, files and pdfs attached to them via custom meta boxes( values are getting stored as serialized array in wp_postmeta table ). Moreover, each user can add his/her notes for each specific lessons( values are getting stored in a custom notes table ). Now, I have to add Search feature on my site which should search for the following things:   1. Post Content   2. Post Comments   3. Custom Meta boxes which consists of different video links, excel file links and pdfs links.   4. Notes which user adds   5. Spoken words in Videos I have tried implementing Relevanssi Pro Search plugin for this since it searches values for custom meta fields as well. But, the result is not satisfactory at all. Can anyone please suggest some good search plugin for this or do I need to go for some custom search solution for this?


How to know if it's a child taxonomy?

I'm in need to know if the current taxonomy is child or parent. How can i achieve this? I need it for the condition in if statement. I need to know               if(this is child taxonomy){          }      Anybody knows how?


Media Library not showing images properly

I'm trying to upload an image, but keep getting an error. Check the attacted image. ![Screenshot](http://i.stack.imgur.com/5YdHF.jpg)


Displaying custom post types with taxonomy

I want to build a page with the members of a team. Because I have too many members, I want to group them by department. Therefore, I created a custom post type **TEAM** with **taxonomy by department** I use the following code to display the team members. I created a new page template.                <?php      $team_posts = get_posts( array(         'post_type' => 'team',         'posts_per_page' => -1, // Unlimited posts         'orderby' => 'title', // Order alphabetically by name     ) );              foreach ( $team_posts as $post ):          setup_postdata($post);              $thumb_src = null;         if ( has_post_thumbnail($post->ID) ) {             $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'team-thumb' );             $thumb_src = $src[0];         }         ?>

                 <?php if ( $thumb_src ): ?>                 <img src="<?php echo $thumb_src; ?>" alt="<?php the_title(); ?>, <?php the_field('team_position'); ?>" class="img-circle">                 <?php endif; ?>

<?php the_title(); ?>

<?php the_field('team_position'); ?>
                 <?php the_field('team_phone'); ?>
                 <?php the_field('mobile_phone'); ?>
                      <a href="<?php the_field('team_email'); ?>"><?php the_field('team_email'); ?>
                 <?php the_content(); ?>

         <?php endforeach; ?>      This is all working well, but as you can see this code displays all the team members no matter in which department they are. Can somebody help me with this matter? I want to have the different departments with the team members on 1 page template. Which functions do I have to use.


Load page HTML content through AJAX

I'm currently building a single page style site that loads all content through AJAX, but will degrade back to a standard page load if javascript isn't present. I have done AJAX loading in the past through wordpress so know my way around it. However I haven't loaded in the contents of an entire page before. What I'm wanting to do is:   1. Hijack clicks to internal URLs and AJAX load the content of their urls into a main content div.    2. I'll wrap the header/footer/sidebars in my post/page template files in a function to check if the load request was made by ajax. If it was it will not echo those in the file.  To do this I need to know how to get the html content of a url in my functions.php. After hours of searching I can't find anything that will let me do it. All the things I've relate to echoing out small portions of the content and not then entire page HTML. It would be great if someone could point me in the right direction! Cheers


Is it wise to delete post revisions and autosaves from database?

I'm just wondering is it wise to delete all post revisions and autosaves from database every once in a while?   I mean they take a lot of database space and apparently have no use after the post has been published.


Page for custom taxonomy

I'm a newbie in WordPress and I've just created a new custom-taxonomy called categories under a custom post type called arts. Is there a way I can create a custom page to display the 'categories's custom type? Such that a user can navigate to arts/categories and see all the terms under the categories taxonomy.


How to allow only Admins or Logged In Users to post links in comments?

I know how to disable HTML in comments, but I'd like the ability to only have Admins be able to post links, or only Logged In users if need be, to have the ability to post links. Is this possible? I am currently using this plugin. I wrote the author of the plugin and he had this to say: "The problem with the function is that it applies to all comments by using a filter. I'm not sure if it's possible to add a condition to it. Instead, you'd have to create a new function: http://www.pastebin.com/q68qkKFX Then, when you echo out your comment, you'd have to do something like this:               echo remove_comment_links($commentID, $commentTEXT);       But with the right variables ($commentID and $commentTEXT doesn't exist). " I used:               <?php $comment_text = get_comment_text();           $comment_id = get_comment_id();           echo remove_comment_links($comment_id, $comment_text); ?>      But it strips out all HTML from all users, instead.


WP_Error message

`PHP Notice: Object of class WP_Error could not be converted to int in /var/www/vhosts/hayhauler.co/httpdocs/wp-includes/functions.php on line 2568, referer: http://hayhauler.co/` I'm not even sure where to start with this or the right question to ask. I know that it is preventing me from posting some information into a database using this:               $wpdb->query($wpdb->prepare(       "         INSERT INTO $wpdb->quotes         (user_ID,origin,destination,broker_ID,quote_ID,estimatedship)         VALUES (%d,%s,%s,%d,%s,%s)       ",       $user_id,       $origin,       $destination,       $brokerID,       $brokerID.'-'.genRandomString(),       $estimatedship     ));      And this error follows it: `mysql_real_escape_string() expects parameter 1 to be string, object given in /var/www/vhosts/hayhauler.co/httpdocs/wp-includes/wp-db.php on line 789, referer: http://hayhauler.co/` Any help or direction would be greatly appreciated.


How can I query posts with newly uploaded images?

I have a custom post type for events. A couple of days after each event photos are sometimes uploaded and attached to the event they were taken at. I want to highlight these image gallerys somewhere on my site, displaying them under a headline "Recently Changed Image Galleries". How can I query posts of type 'event' that have 3 or more image attachments, and order the result by the upload or publish time of the newest attachment?


Ignores post_type when no results

I have a custom searchbox that only searches a particular custom post type. On the results page I have modified seacrh.php to display the results slightly differently. Mainly the title is different.               <?php              if ( 'wpdmpro' == get_post_type() ) : ?>
Documents Search
                          <?php              else : ?>
Search
             <?php endif ?>      This works when there are some rsults, but fails on no results and displays the default title? Why is the confitional failing. the url of the results page shows that the post type is still relevant?               http://siteurl.com/?s=searchterm&post_type=wpdmpro      Any idea?


Images uploaded using media uploader are appearing upside down

A client of mine has come to me with an issue I've never seen before. Some of the images he's uploaded via the media uploader are appearing upside down or sideways. I'm assuming it's because they were taken on a phone and Wordpress is preserving the direction in which they were shot? Is there a fix for this?


How to use shortcodes on a widget sidebar when doing an ajax call?

I'm trying to use a shortcode from Promotion Slider Plugin inside a widget when doing an ajax call. As said here, I could achieve it doing:               add_action( 'init', function() {        ps_register_shortcode_ajax( 'ps_get_slider', '8' );      } );          function ps_register_shortcode_ajax( $callable, $action ) {     if(isset($_POST['href'])) {           $pageId = preg_match( '/^http:\/\/.+\/\?page_id=\d+$/', $_POST['href'] ) ? substr( strrchr( $_POST['href'], '=' ), 1 ) : '8' ;                if ( empty( $pageId ) || $pageId != $action )             return;                call_user_func( $callable );     }     }          function ps_get_slider() {         //require_once('../wp-load.php'); Nothing changes         if ( dynamic_sidebar('Slider') ) : else : endif;         //echo do_shortcode( '[promoslider post_type="news" height="300px" width="70%" numberposts="5" start_on="first" display_title="fancy" display_excerpt="excerpt"  pause_on_hover="pause"]' );  Same output than above         die();      }       but I'm just getting the literal output: `[promoslider post_type="news" height="300px" width="70%" numberposts="5" start_on="first" display_title="fancy" display_excerpt="excerpt" pause_on_hover="pause"]`. Any idea of how could achieve it? _As a note, I first tried just adding`if ( dynamic_sidebar('Slider') ) : else : endif;` into the ajax template, but didn't work._


Parent and child custom post types without options on parent

This might sound an odd one but wondering if the following scenario is possible at all within WP. Would like for example a parent custom post type of : Product Type 1 Underneath it I only want options to have 2 custom post type children within it: News, Reviews (which could be expanded going forward) Product types could then be expanded as well but they are separated by their CPTs in WP. Wouldnt want any other post options for the parent only for the children so no add post under Product Type 1 only under News and Reviews. The CPTs would auto create a permalink structure for /product-type-1/news/ ..reviews/ Is this possible or am I thinking about this all wrong? Its to go into an existing site which is mainly powered by another CMS. It has sections already for say domain.com/product-type-1/ with other areas powered by the main CMS. Was hoping to them piggy back in for domain.com/product-type-1/news/ and ..reviews/ which htaccess will handle sending to WP instead. Thanks for any help in advance.


What's an efficient way to change the post status of many posts at once?

I'm looking for an efficient way to change the post status on many posts at once. I have a custom post type that I'm using as a means to store content that must be approved by a moderator before being published. I'm trying to give the moderator the ability to "approve all" or "reject all" on a fairly large number of posts (100-200 would be common). The best solution I've come up with is to make an ajax call that sends a list of post id's to the server, which loops through them calling the below function:               wp_update_post(array('ID'=> $post_id, 'post_status' => 'publish' ))      This results in a query to the DB for each post, however, and it's much slower than I'd like. Ideally, I'd be able to make a query that changes the post status to 'publish' on all of the post ID's in the list at once, but I can't find any means to do this.


Chopping up a large ajax request of around 200 posts

I've put myself into an uneasy situation, where I have roughly 200 posts I need to load in with jQuery `.load()`. Nothing shows up until the whole `.load()` has executed, of course. Takes roughly 3 to 4 seconds. What would be the best way to chop up the big load query to smaller junks, like 50 posts per query. So that the user would see something at least, most of the posts are under the fold anyway. It can't be a lazy load or infinite scroll, cause there's an Isotope filter at the top and all post eventually have to be in the DOM to be sortable. EDIT: The code that handles the ajax load:               // Get time for measuring the load duration     $then = $.now();          var init2 = function() {         // Du stuff while the ajax load     },     // Do stuff after ajax load     ajaxLoad2 = function(html) {         window.$body.addClass('ajax-load-done');         // Init lazy load on images with Unveil         $('img')             .on("unveiled", function() {                 this.style.opacity = 1;                 $('body, html').scroll();             })             .unveil({                 threshold: 600,                 debounce: 30,             });         // Run title function         titler(html);         init2();         // Measure the time it took to run the ajax request         $now = $.now();         var totalTime = ($now - window.$then) / 1000 % 60;         console.log('all models loaded in ' + totalTime + ' seconds');     };     init2();          // This is the ajax request function     var loadModels = function() {         // Get the site domain         var href = window.location.origin + '/model',             // This is the load container             $underlayer = $('#underlayer');         // Load animation spinner         $underlayer.html("
Loading

Loading models, wait for it...
");         // The actual load         $underlayer.load(href + ' #content>*', ajaxLoad2);     }     var $overlayer2 = $('#overlayer');     // Check from the body class that it is s post type model and single and execute the load     if (window.$body.hasClass('root-single-model') && $overlayer2.offsetParent !== null ) {         loadModels();     }      And heres an illustration what I'm trying to achieve: ![enter image description here](http://i.stack.imgur.com/EblZD.png) The problem is that the 2) ajax load take about too long, about 3 seconds if cached and even up 8 sec if not.


Wooslider custom css

I recently purchased Wooslider plugin and would like to add custom css to override the Woothemes slider defaults. However if I add custom css to the theme css file it gets overridden by the wooslider css since that css comes after my theme css in the head of the document. Is there a way around this? some method or Wordpress script that forces my theme css to appear after the wooslider css perhaps, that would be a more elegant solution than putting css style tags into the head of the document? I was curious as to how other people deal with this issue?


Front-end login: Redirect user to the post they had created

Is is possible to redirect a user on front end login to a post that they have created? I have the form below on the front end which works great to log people in but doesn't quite achieve what I want. I've created a front end registration process, that creates a new user and a post and fills in certain details into that post. On completion of that process they are sent to the post they just created, which then allows them to front end edit all the details. That works perfectly for first time registrants but I can't quite achieve what I want with people that have already registered and want to login. When they fill in their details on the form below, I want it to redirect to the post they created when they registered, is this possible? The users can only ever create **ONE** post... which is acting as a profile. So I want them to be able to log in and get redirected to their profile. If it helps, the username is the same as the post title (the username is the persons company name, which is also the name of the post).                           <?php if (!(current_user_can('level_0'))){ ?>                        <form action="<?php echo get_option('home'); ?>/wp-login.php" method="post" id="login-form">
Please login.
                                                      <input type="text" placeholder="Username" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" />                                                                                <input type="password" placeholder="Password" name="pwd" id="pwd" />
                             <input style="width:14%!IMPORTANT;" name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me
                                   <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
                             <a style="font-size:14px!IMPORTANT;" href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password
                                                         <input style="margin-left:80px;float:left;" type="submit" name="submit" value="LOGIN" class="login-button" />                                                    </form>

                 <?php } else { ?>
                         You are currently logged in, would you like to <a href="<?php echo wp_logout_url($_SERVER['REQUEST_URI']); ?>">logout?
                 <?php } ?>        I'm guessing the following... I need to do something with the username (entered in the form above) then match that with the author of any posts, if that matches then send them to that page... all before the submission of the form above. This needs to be done before the hidden field, so it can enter the username field into the hidden input value.


How to not show tags if the post doesn't have any?

I currently have the following trying to avoid showing tags (the icon in this case) when there aren't any, but the icon continues to show up. Any thoughts?               <?php if ( is_singular() && function_exists('the_tags') ) : ?>
<?php the_tags('', ', ', ' '); ?>
     <?php endif; ?>


In a loop, do not display content that does not have a thumbnail

In a multisite installation, I have a loop set up on my main blog that displays all posts from sub blogs, along with a thumbnail image. The image is important and without one will break the grid. Is there a way to reject posts that do not have a featured image? Thanks.


Display sub menus as separate lists

I need to change the way of rendering menu in WordPress - I guess I should write my own walker class but I'm not sure how to bite it. What I'd like to achieve is to render each level of menu as separate div. So we have pretty standard wp menu:

         Contact

             Blog

Blog

Home

Home

Sample Page

      What I'd like to achieve is this:

Contact

Blog

Home

Blog

Home

Sample Page

      Is it possible to achieve with custom Walker_Nav_Menu class? I'd really appreciate any ideas. Thanks


How to check if a slug exists?

I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks


Displaying the 'time ago' for recent activity within a post/custom post type?

How to get the 'freshness' of a post? (when it was last updated or commented and by who?) > e.g. 48 days / admin (avatar).


Wordpress CodeHighlighter

I've noticed on a couple of websites that the code highlighter can have some options like print / copy to clipboard, ... I've installed CodeHighlighter as a Wordpress plugin in my website but can't find a way to get those options. Any help would be grateful. Thank you


Can serialized arrays in DB be matched against serialized arrays with meta_query?

Say I have an array of checkbox choices associated with a post (a custom field) stored in the database in serialized form. On my site, I present users with the same checkboxes and let them make their choices to "filter" out posts according to their choices. If as little as one of their choices matches a posts choices, that post should be displayed.               $args['meta_query'] = array(       array(         'key' => 'choices',         'value' => $_POST['choices'],         'compare' => 'IN',     ));      As the data in the DB is in serialized form, I hoped that the WP_Query was smart enough to understand that it needed to unserialize the serialized data in the DB before attempting to match. This was not the case, and I am considering submitting this to the WP Trac and see if it can be added as a feature in future releases. My question is whether I have any options here, other than to store my data in another way (which at the moment seems difficult as I am using the plugin _Advanced Custom Fields_ to store it). I looked through meta_query with meta values as serialize arrays, and the answers there pointed me towards storing my data in another way. I hope I can avoid that.


Conditional Statement - check if post has an attachment image

I'm working on a conditional statement (in a loop) that looks for a featured image then grabs a default image if there is none, which I have figured out. But, I also wanted a way to pull the first image (or any image) attachment before going the route of the default image. Having trouble finding the right way to check for an attachment image, then display it. I have added a specific thumbnail size, "featured-thumbs" in the functions.php file of my theme. It would be great if I could utilize this when displaying the attachment image. Here's what I have so far:               <?php $count=0; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                                  <div class="span-9 subfeature append-bottom <?php if(++$count%2==0) echo 'last'?>">                                                                   <?php $thumb = get_the_post_thumbnail(); //Hack for Sitewide Tags Thumbnail process: assigns variable for use in conditional statement below ?>                        <?php if (has_post_thumbnail()) {                        the_post_thumbnail('thumbnail');                        } else                        if ( $thumb ) { //if not checks to see if there's a Sitewide Tags created thumbnail and uses that if there is                       the_post_thumbnail();                        } else {                                             echo '';                   }                             ?>                   Thanks very much.


wpdb->insert: do I need to prepare against SQL injection?

Do I need to use wpdb prepare before wpdb->insert? If I am inserting values into a wordpress table using wpdb->insert, do I need to "clean" my data before inserting it or does this method (wpdb->insert) do that for me?


how do I group content in magazine-style 'issues'?

I am building a website for a magazine. It won't carry the whole content of the mag, just a teaser article or two from each issue. I need to have a page for each issue that features these articles, something like:               http://www.magazine.com/issue/20/      I'd make a template for 'issue' pages that spits out all the associated articles. But wouldn't this mean the client would have to create a blank page for each new issue, and assign the template? That seems eminently breakable. If it could be done dynamically that would be preferable. An alternative would be putting each page in a numbered category and using the standard archive output for that category, but I'd rather use categories for their intended purpose. Is there a standard way of doing it?


How do I export the headlines of all the blog posts in a single category?

I need a list of all the blog post I wrote on a topic. (Basically a list of headlines that are marked with a certain category.) One of my readers once created a list like this and emailed it to me, but I never asked him how he did it and can't find his email.


Taxonomy.php Not Showing Posts

I have the following code in my Functions.php file to create a custom taxonomy and post type. And I have created a series of posts within this post type and attached tags to them.               add_action( 'init', 'create_my_post_types' );          function create_my_post_types() {          register_post_type('portfolio', array(         'label' => __('Portfolio'),         'singular_label' => __('Portfolio'),         'public' => false,         'show_ui' => true,         '_builtin' => false,         '_edit_link' => 'post.php?post=%d',         'capability_type' => 'post',         'hierarchical' => false,         'rewrite' => array('slug' => 'work', 'with_front' => false),         'query_var' => 'portfolio',         'supports' => array('title', 'thumbnail'),         'menu_position' => 5     ));          }          add_action( 'init', 'create_pc_db_taxonomies', 0 );          function create_pc_db_taxonomies() {         register_taxonomy(             'portfolio_tag',             'portfolio',             array(                 'hierarchical' => true,                 'label' => 'Portfolio Tags',                 'rewrite' => array('slug' => '', 'with_front' => false)             )         );     }      I have created a custom loop on my home page and successfully shown my posts from this type which shows they work, however when viewing the taxonomy archive I just get the message that no posts could be found... It is finding the correct template to use just not seeing posts attached to that taxonomy. Here is the code for the Taxonomy.php               <?php if (have_posts()) : ?>
                         <?php while (have_posts()) : the_post(); ?>
                          <?php if ( has_post_thumbnail() ) { ?>                              <a class="fancybox" title="<?php the_title(); ?>" rel="bookmark" href="<?php                         $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' =>'image') );                         foreach ( $attachments as $attachment_id => $attachment ) {                             echo wp_get_attachment_url( $attachment_id, 'medium' );                         } ?>">                             <?php the_post_thumbnail(); ?>                                                   <?php } else { ?>                              <a class="fancybox" title="<?php the_title(); ?>" rel="bookmark" href="http://dummyimage.com/640x480/333/fff&text=x">                             <img src="http://dummyimage.com/300x300/333/fff&text=x" alt="<?php the_title(); ?>" />                                                   <?php } ?>
                  <?php endwhile; ?>
                  <?php else : ?>
<?php _e('Sorry, no posts matched your criteria.'); ?>
                  <?php endif; ?>      **Any ideas why this is not working? Thanks**


Display a paragraph in the index page that won't be displayed in the single post

Can i make it possible for an excerpt to be displayed in the index page but that part of the excerpt will not be displayed in the single post anymore?


How do I apply a class to custom menu items based on user roles

I have a members section on my site and they see specific custom menu items. I'm seeking a way to simply apply a star to the `<li>` based on it's permission level and what the user's role is. Something to the effect of.               if( current_user_can('integrator') || current_user_can('distributor')) :      This is what I have so far and it applies a class to every menu item if the user's role is (whatever). I essentially need to apply the class if another class is present and the user's role is (whatever)...               add_filter('nav_menu_css_class' , 'my_nav_special_class' , 10 , 2);     function my_nav_special_class($classes, $item){             if (current_user_can('integrator') || current_user_can('distributor')){                 $classes[] = 'PARTNER_STAR';             }         return $classes;     }      Courtesy Bainternet from this post Any ideas would be appreciated **Update:** I also want to note that I'm using "Role Scoper" to handle permissions. They do have a template function `is_restricted_rs()` but I'm honestly unsure how to use it currently.


why is unregister_setting() undefined?

trying to call               unregister_setting('general','users_can_register');      so as to removed the option for allowing or dissallowing user registration (it is required in the theme, so it is set programatically) but it is returning `Call to undefined function unregister_setting()...`


Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term

Say, for example, I have the following custom taxonomy:               Term 1        Term 1.1        Term 1.2           Term 1.2.1           Term 1.2.2        Term 1.3     Term 2        Term 2.1      How can I get the children terms of Term 1, not including grandchildren? That is, I want my results to include only Term 1.1, Term 1.2, and Term 1.3. Thanks.


Populate WYSIWYG field with ACF choice

So, I have a custom post type that uses a flexible content field containing a post object field and a wysiwyg field. The post object is to choose a post from a selected post type. After you choose that post from the drop down, I would like to populate the content of that post in to my blank wysiwyg field. Hoping someone has any ideas, been at this for hours with no solution. Thanks! Edit: After some searching I found this. Works great for populating the default Wordpress WYSIWYG field.               add_filter( 'default_content', 'my_editor_content', 10, 2 );          function my_editor_content( $content, $post ) {              switch( $post->post_type ) {             case 'proposal':                 $content = 'Testing my custom function';             break;         }              return $content;     }      I found this link: http://www.advancedcustomfields.com/resources/filters/acf- fields-post_object-result/ but not sure how to incorporate that with my snippet. ![enter image description here](http://i.stack.imgur.com/UHAgN.png)


Loading a post's content, into a div outside the loop, when it's title is selected in a list

I am building a site in wordpress where at a certain part there is a container that has a list of post items (see it as a menu/sidebar), and an empty space where I will load content. When you click on one of the titles from the list of posts, the content of that clicked title is supposed to load into the empty div. Clicking another title from the list of titles should of course replace the previous content. So it looks like this, basically:

          <?php            $my_query = new WP_Query('showposts=10&cat=4');            while ($my_query -> have_posts()) :                 $my_query->the_post();                $category = get_the_category();           ?>

                <? the_title(); ?>

               <?php             endwhile; wp_reset_query();           ?>

         <? the_content(); ?>

      So, I already looked up something for ajax but I don't have any experience with that. What would be the best way too do this?


How to have Tiled Galleries like in WordPress.com?

In a WordPress.com hosted blog, you have the posibility to create picture galleries with a different style than usual: tiles, squared tiles or circles. What plugin are they using to achieve this? I haven't found that feature in a stand-alone WordPress installation.


Best place to store company address

Ok I'm creating a site for a company, this company will have multiple users. In the footer I am trying to include the company name, phone and address but not as a widget. I need to store the information in a place where all users can edit it. In the past I've stored this kind of information in a users profile but that is only good on a single user blog. Where can I store this information where I can easily pick it up in the theme and all users can see/edit it.


Wordpress plugin search does not work and updates are not shown, VPS install

I have configured a VPS running CentOS 6.3 and Plesk 11. The install of a blank version of Wordpress works well. However, I have problems with updating Wordpress and searching for plugins. The two problems:   * When trying to search a new plugin from within the Wordpress backend I get an 'Unknown error'. I have found a lot of references with people having this problem, however it is usually solved by the webhost as this is a server configuration issue. Since I am now my own webhost with the VPS, I would like to know how to solve this myself and improve my server configuration. I did not find anywhere online how to do this in practice.   * A (most likely) related problem is that Wordpress does not show any new updates. The current version of my blank install is 3.4.2 but once logging in, Wordpress does not indicate that I should update to version 3.5. Also after performing an update check, Wordpress does not find the new version. Updating everything manually (via FTP) works well of course. But I would like the update process from within wordpress to work. Anyone any ideas how to improve my PHP or other configurations to solve these update problems? Any help appreciated!


Shortcode to insert <!--nextpage-->

Since wordpress does not have a menu icon (aka "user friendly) way to add the command to a post or page, I'm trying to create a shortcode to do it. However, as logic would have it, its not that easy. Doing this with a shortcode merely inserts into the markup, which is post process, not pre- process as wordpress does it substitution in pre-process. Can anyone shed light on how this can be done?


Create a link which allows visitors to disable a plugin?

Is it possible to create a link that allows site visitors to disable a plugin? I'm using a plugin called "any mobile theme" which automatically detects if the visitor is on a mobile device and automatically switches to a mobile- friendly version of the themes. This works very well, but I would like to give them option to view the full (desktop) version if they prefer. Is it possible to create a frontend link to disable a plugin (the mobile theme switcher) to achieve this? Thanks


Post2Post refusing to show linked posts

I'm trying to construct a catalog page, made out of `product`s and `product- category`s. I have set up both post types, and set up a connection between them in `functions.php` (Using the **Posts2Posts plugin**. The problem I'm having, is that in my `catalog-page.php`, I can't see the connected pages (I can see the Categories using the first loop, but not the connected Products). # Code: ## functions.php (Relevant)               /* ======================        Custom Page Types        ====================== */          add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'product-category',                             array(                                  'labels' => array(                                      'name' => __( 'קטגוריות' ),                                      'singular_name' => __( 'קטגוריה' ),                                      'add_new' => __('קטגוריה חדשה'),                                  ),                                  'public' => true,                                  'has_archive' => true,                                  'hierarchical' => true,                                  'supports' => array(                                      'title',                                      'editor',                                      'thumbnail',                                           'page-attributes'                                  )                                  )         );         register_post_type( 'product',                             array(                                  'labels' => array(                                      'name' => __( 'מוצרים' ),                                      'singular_name' => __( 'מוצר' ),                                      'add_new_item' => __('מוצר חדש'),                                      'new_item' => __('מוצר חדש'),                                      'parent' => __('קטגוריה'),                                  ),                                  'public' => true,                                  'has_archive' => true,                                  'hierarchical' => true,                                  'supports' => array(                                      'title',                                      'editor',                                      'thumbnail',                                           'page-attributes'                                  )                             )              );          }          /*      * Posts2Posts plugin      */     function my_connection_types() {         p2p_register_connection_type( array(                                            'name' => 'products_to_categories',                                            'from' => 'product',                                            'to' => 'product-category'                                       ) );     }     add_action( 'p2p_init', 'my_connection_types' );      ## catalog-page.php (Relevant)               <?php if (have_posts()) {     while (have_posts()) : the_post(); ?>
             <?php             $category_arguments = array(                 "post_type" => "product-category",             );             $category_query     = new WP_Query($category_arguments);             while ($category_query->have_posts()) {                 $category_query->next_post();                 echo "
{$category_query->post->post_title}
";                 $products_arguments = array(                     "connected_type"      => "products_to_categories",                     "connected_items"     => $category_query->post->ID,                     "connected_direction" => "from",                     "nopaging"            => true,                 );                 $products_query     = new WP_Query($products_arguments);                 var_dump($products_query->have_posts(), $category_query->post->ID);                 while ($products_query->have_posts()) {                     $products_query->next_post();                     echo "
{$products_query->post->post_title}
";                     var_dump($products_query->post);                 }                      var_dump($category_query->post);             }      ## This outputs: ### משקפי שמש               boolean false //have_posts() on products     int 81        //Post ID (correct)     object(WP_Post)[1992] //The category post       public 'ID' => int 81       public 'post_author' => string '1' (length=1)       public 'post_date' => string '2012-12-16 23:47:02' (length=19)       public 'post_date_gmt' => string '2012-12-16 21:47:02' (length=19)       public 'post_content' => string 'קטגוריה של משקפי שמש' (length=37)       public 'post_title' => string 'משקפי שמש' (length=17)       public 'post_excerpt' => string '' (length=0)       public 'post_status' => string 'publish' (length=7)       public 'comment_status' => string 'closed' (length=6)       public 'ping_status' => string 'closed' (length=6)       public 'post_password' => string '' (length=0)       public 'post_name' => string '%d7%9e%d7%a9%d7%a7%d7%a4%d7%99-%d7%a9%d7%9e%d7%a9' (length=49)       public 'to_ping' => string '' (length=0)       public 'pinged' => string '' (length=0)       public 'post_modified' => string '2012-12-16 23:47:02' (length=19)       public 'post_modified_gmt' => string '2012-12-16 21:47:02' (length=19)       public 'post_content_filtered' => string '' (length=0)       public 'post_parent' => int 0       public 'guid' => string 'http://localhost/geva/?post_type=product-category&p=81' (length=59)       public 'menu_order' => int 0       public 'post_type' => string 'product-category' (length=16)       public 'post_mime_type' => string '' (length=0)       public 'comment_count' => string '0' (length=1)       public 'filter' => string 'raw' (length=3)


Updating themes customized by users

Can I safely update a theme if a user has _only_ modified it through THEMES > CUSTOMIZED? I know that a user has to clone and create a child theme if they want to edit the php/css/javascript files directly. But, if the only modifications were through the THEMES > CUSTOMIZED, would there changes remain in place after a theme update? ![enter image description here](http://i.stack.imgur.com/WMHp2.png)


Removing featured image from gallery?

I'm having trouble removing the featured image from gallery. ![enter image description here](http://i.stack.imgur.com/7ZgSs.png) I removed all kinds of stuff from those 2 files, but seems like I need to add something, not take away. Here are the pastebin's of 2 files: http://pastebin.com/sBaVzk8y http://pastebin.com/Ae8TkbAP


in jquery read a multidimensional array via wp_localize_script()

From PHP I am pushing a basic array to jQuery via `wp_localize_script()` and then using the array data in my script file. Now I have extended the array into a multidimensional array and can not figure out how to get the data out of the array to use in in the javascript file. Currently I'm extracting the data from the array is like this:               jQuery(document).ready(function($){          var optionA = theme_metadata.dataA;         var optionB = theme_metadata.dataB;      `theme_metadata` is the array that I built in PHP and push to jQuery via `wp_localize_script()`. `dataA` and `dataB` are keys in the array. My new array looks like this:               [theme_meta] => Array         (             [0] => Array                 (                     [dataA] => foo                     [dataB] => bar                 )                  [1] => Array                 (                     [dataA] => this                     [dataB] => that                 )         )      How do I setup my var in the script file to read `[theme_meta][0][dataB]`? Also how can I loop through the array? The numbered key index will not be known, i.e., `[0]- whatever [100]`? I could send over a `key=>value` on how big the array is as a stopping point for a loop, i.e., `'theme_meta_size' => 2` as in the sample array.


Handling an Ajax form submit

I am developing a wordpress plugin that will create a contact form and then submit the details through an ajax request.                       jQuery.ajax({                      type:"post",                 dataType:"json",                 url: ajaxurl,                 data: {action: 'submit_data', info: info},                 success: function(response) {                     alert("Success");                 }             });      This is the function that handles the ajax request:               add_action("wp_ajax_submit_data", "submit_data");     add_action("wp_ajax_nopriv_submit_data", "submit_data");          function submit_data() {               echo "";          die();     }      The link that the user will click to submit the form is :               $link = admin_url('admin-ajax.php?action=submit_data');         Submit      Once the submit link is clicked I recieve the Hello alert and then get taken to a blank page with the URL               http://localhost:81/wordpress/wp-admin/admin-ajax.php?action=submit_data      Why is it taking me to a blank page rather than updating the current page? EDIT ------------------------------------------------- Here is the full jquery function :               $(".button").click(function() {                      $(".error").hide();                      var name = $(":input.name").val();                 if (name == "") {                          $("label#nameErr").show();                     $(":input.name").focus();                     return false;                 }                      var email = $(":input.email").val();                 if (email == "") {                          $("label#emailErr").show();                     $(":input.email").focus();                     return false;                 }                           var phone = $(":input.phone").val();                 if ((phone == "") || (isNaN(phone))) {                          $("label#phoneErr").show();                     $(":input.phone").focus();                     return false;                 }                      var info = 'name:' + name + '&email:' + email + '&phone:' + phone;                      alert(info);                      jQuery.ajax({                          type:"post",                     dataType:"json",                     url: ajaxurl,                     data: {action: 'submit_data', info: info},                     success: function(response) {                         if (response.type == "success") {                                  alert("success");                         }                         else {                                  alert("fail");                         }                     }                 });                      return false;                       });


add_filter('the_content', '...') stops pagination from working

I have a function (it deals with using `preg_replace_callback`to replace Image URLs with URLs/paths to the uploads directory - lets call it `replaceImgUrls()`) which is then passed into `add_filter('the_content', 'replaceImgUrls')`. This works fine and stuff but on posts where I have added pagination (`<!--nextpage-->`), it stops this from working; it fails to split up the pages, but still shows the correct amount of page numbers at the bottom of the content, which you can still click on but each page shows the same content (i.e all the content which is in the post). Here is my function which replaces the image URLs:               add_filter('the_content', 'replaceImgURLS');     function replaceImgURLS($content) {         global $post;         $content = $post->post_content;         $newContent = preg_replace_callback(             '/<img.*src=[\'"]([^\'"]*)/i',              function ($match) {                 global $post;                 $imgURL = $match[1];                 $filename   = basename($imgURL) . "-" . $post->ID . ".jpg"; // Create image file name                 $upload_dir = wp_upload_dir();                 $postMonth = mysql2date('m', $post->post_date);                 $postYear = mysql2date('Y', $post->post_date);                 $fileURL = $upload_dir['baseurl'] . '/' . $postYear . "/" . $postMonth . "/" . $filename;                      return '<img src="' . $fileURL;             },              $content         );         return $newContent;     }      When I remove this function from my `functions.php` file, the pagination is restored and works as it should (i.e each page is split up separately). I have `wp_link_pages()` in my `content-single.php` template file. Thanks for any help :)


Changing custom taxonomy's slug as required?

I have a section in a plugin i am making where admin can add custom taxonomies and custom post types as required. the admin will create a custom taxonomy by selecting a name(that will be used as slug), then create a custom post type and select the above created taxonomy as it's parent. those are been added to a private DB table. On init `action('init',)`... i have a class that runs through this database and register the custom post type/ taxonomies create previously and `register_taxonomy_for_object_type` to connect things up. now my issue is. when the admin go back to the same screen and edit a taxonomy name(which also changes the slug) i update the DB according to the new changes. although my class see the changes and register them,when i refresh the page it doesn't seem to actually change. My question is: is there anything i need to do to update that taxonomy ? Sorry for the long text thanks.


wordpress is converting ?page=2 into /2

with this code               paginate_links(        array(        'base' => @add_query_arg('page', '%#%'),         'format' => '?page=%#%&a='.$a,         )     )      looks output like this               2      But when I click on it my url goes to `www.example.com/something/2/?a=1` is it possible to change it into `www.example.com/something/?page=2&a=1`? Thanks


Restricting Post Content Visibility with Custom Code - where to put it?

We are using custom code (or will be) to detect user groups from our forums to determine whether or not a post's content will be displayed. So if you are someone who has over 500 posts, you are placed into a certain user group via the forum software and can view certain articles on our front page. So the code we will be putting into Wordpress will be something like this: “If in X forum user group, show this; if not, show this message." My question is, where do we apply the coding for that across Wordpress? For example we have single.php which shows the news story pages, loop.php which shows the stories in the archives and search, etc. But is there a higher level to apply that code to insure that the news story content visibility is restricted in every possible place? For example, would we have to apply that code individually to the RSS feed too, or is there just one go-to place on a higher level to do it? Thank you so much! This place is such an invaluable resource.


Link Posts to External URL

I'm building a site which lets users to submit links using User Submitted Posts plugin. I want every post title to link to its URL something like reddit. Moreover, User Submitted Posts plugin add URL to each post in the posts meta table. How could I do that?


Modifying WP URL handing code?

I am trying to use mod_rewrite and modify WordPress' URL handling to allow for passing variables to PHP from the URL while maintaining "pretty permalink" functionality. (on WP 3.2.1) Something like this: http:/epiclasers.com/hello-world (normal with permalinks set to /%postname%) http:/epiclasers.com/state/hello-world (WP should display the same hello-world post as above, but also would pass the state string to PHP as a variable) http:/epiclasers.com/state/city/hello-world (WP should display the hello-world post, but would pass the state and city strings to PHP as variables) I added the following mod_rewrite directives to my .htaccess file:               RewriteRule ^(\w+)/(\w+)/ /index.php?state=$1&city=$2 [L]     RewriteRule ^(\w+)/ /index.php?state=$1 [L]      which kind of works. The variables are being passed, and PHP can grab them with: > $state = $_GET['state'];   >  $city = $_GET['city']; The problem is that WP is getting confused by the variables in the URL and isn't outputting the correct template file. URL's like these: http://epiclasers.com/arizona/phoenix/   http:/epiclasers.com/arizona/phoenix/hello-world   http://epiclasers.com/arizona/ are bringing up the 404 page not found template. How do I modify the WP URL handling code to ignore the /state and /city parts of the URL without also breaking URLs like: http:/epiclasers.com/category/category1   http:/epiclasers.com/tag/tag1   http:/epiclasers.com/category/category2/subcategory etc. Thanks,   Devin


Remove unwanted part of permalink custom structure from CPT url?

My site currently has regular posts (in a section called "Trend Watch"), as well as a Custom Taxonomy (called "Region"). My permalink settings have this Custom Structure:               /trend-watch/%year%/%monthnum%/%postname%/      which gives me these urls:   * `/trend-watch/regions/` (lists all terms in the Regions taxonomy)   * `/trend-watch/regions/europe/` (lists all posts with the term "europe" in the Regions taxonmy).   * `/trend-watch/2011/03/an-interesting-article/` (a single post). But now i'm adding a new Custom Post Type, called Reports. When registering this CPT, I set `rewrite => array('slug' => 'reports')`. But the urls are including "trend-watch/" first:               /trend-watch/reports/some-report/      How can I remove "trend-watch/" from the Reports CPT urls, but keep it for regular Posts (and the associated Custom Taxonomies).


difference between add_options and register_setting

I am confused. Want to save data for my plugin. There are people who use add_options and there are others who use register_settings. My question is What is difference between `add_options` and `register_setting`?


get_last_updated() not working - multisite loop

I am struggling to get the get_last_updated() function to work on main blog. I have a network site with about about 9 blogs on it. I am simply trying to loop all my blogs and find do some querying from each blog. But I can't seem to get this simple `get_last_updated()` loop to work. Can anyone please explain why this might not work? Thanks in advance.               $events = get_last_updated();     foreach ($events as $event)         {                  echo $event["blog_id"];                  switch_to_blog($event["blog_id"]);                  // do my stuff                  restore_current_blog();          }      * * * Let me confirm. Is the get_last_updated() meant to return the latest added blogs. Or is this function meant to check for latest post in within the blog and return the latest added blogs? The codex does not really say what it does. And it is confusing me very much as to why this is not working or not returning anything. It's like the function does not work - because if I do this...               $events = get_last_updated();          if ($events) {               foreach ($events as $event)         {                  echo $event["blog_id"];                  switch_to_blog($event["blog_id"]);                  // do my stuff                  restore_current_blog();              }          } else {              echo 'help';          }      It just echo's help.


How to make an archive page template using Wordpress 3

I have a suitable page, archives.php, located in the theme's root directory, but I cannot get it to show up as a page template. Is there something else I need to do so that it is recognized?


Limit the menu child levels under "admin > appearance > menus"

in my effort in making the WP backend as user friendly as possible, I'm looking for a way to limit the amount of child (or submenu items) of the menu(s) under "admin > appearance > menus". They idea is: when a theme doesn't support a second menu level, its should also not be possible in the backend to add (drag) items to this level. I guess to achieve this, I would have to dive in the jQuery UI library (and more specifically the jQuery sortable library). Preferably without having to edit WP's core. Does anyone has any idea or experience in this? Looking forward to your ideas.


Wordpress comments - delimiter "/" not found

Im using wordpress comments as a "chat". Not real time chat its more like comments with more flow. But when 4-5 or more members using coments at the same time i get this message: ![enter image description here](http://i.stack.imgur.com/ExDbwm.png) Not sure why this happens or if its because more than one user is using it at the same time. Is there anyone here who had the same problem or could lead me in the right direction ?


List of buyers for each product

I would like to know if it's possible to get the complete name of each buyers for a specific product or the orders list of a specific product ?


How do you remove the buddypress group avatar from the activity stream post?

When a member post to a group it shows up in the activity feed under “username posted an update in the group” then its followed by the group avatar then the group name. So I was wonder how I could remove the group avatar from the activity action. Is their anything I could add to the functions.php or bp- customs.php? I would rather not try hiding it through css.


taxonomy terms array not working

I'm working on a solution to filter a custom post type by multiple terms in multiple taxonomies. Here is my code:               <?php $term = "peoria,adams"; ?>

                  <?php $term = explode(',', $term); ?>                  <?php $term_count = count($term);              $array_term = $term[0];             ?>                  <?php                  $i = 1;                 while ($i < $term_count) {                     $array_term = "'" . $array_term . "', '" . $term[$i] . "'";                     $i++;                 }                 ?>                  <?php echo $term = "array( ". $array_term . " )"; ?>                  <?php //echo $array_term; ?>                  <?php                 $args = array(                     'post_type' => 'property',                     'tax_query' => array(                         'relation' => 'OR',                         array(                             'taxonomy' => 'Status',                             'field' => 'slug',                             'terms' => array( 'Locked' )                         ),                         array(                             'taxonomy' => 'County',                             'field' => 'slug',                             'terms' =>  $term                         )                     )                 );                 $loop = new WP_Query( $args );                 while ( $loop->have_posts() ) : $loop->the_post();                     the_title();                     echo '
';                     echo get_the_post_thumbnail();                     the_content();                     echo '
';                 endwhile;             ?>      I echo `$term` and it display what it should display but it does not work when I call it in `'terms' => $term` it does not work but it will work if I replace it with `array( 'peoria', 'adams' )` it works. I have a suspicion I'm doing something stupid but I'm just missing it. Can someone give me a hand? Thanks in advance!


Store in media library image uploaded from url

Is there a plugin that when upload from url/web, it will also give an option to store the images locally and/or into the media library?


Gel all image from certain post type

I've found similar questions here, however I can't modify the answers to get images only from a certain post type - as the post type in those examples are "attachment" and not the name of a custom post type. Is there a way to declare a custom post type argument as well? Similar question, another similar question


How to use my own custom session value in Wordpress?

How can i use my own (custom) session value in Wordpress?   For example: `$_SESSION['myname']="4lvin"`   I've already inserted `session_start()` at all page i need as following.               <?php     session_start();     $_SESSION['myname'] = "4lvin";     ?>      But not working Global-wise.   Just working on the self page.   It is NOT call-able Globally from another pages (using same logic).


show all the posts thumbnails

I want to display all the posts by the featured image of each post. Is there a shortcode or can you give me some tips on how to achieve this ? Thanks!


Integrate ZOHO Recruit API?

I'm working with a client using ZOHO Recruit to manage his staffing agency. The form for candidates to submit their information is given by ZOHO as a simple embed code. However, for employers to submit their jobs, it must use ZOHO's API - which is beyond what i know how to do so far. I'm all up for learning and have been looking for tutorials, but I can't find a good starting place to learn. Here is what ZOHO sent - anyone around to give me a starting place to know what to do with this? http://www.zoho.com/recruit/api.html http://www.zoho.com/recruit/add- records.html


Sanitatizing when using the posts_where hook

I am altering the WordPress query, using the `posts_where` hook, when a (custom) query variable is set as follows:               add_filter('posts_where', 'my_posts_where' );     function my_posts_where( $where ){         global $wp_query;              if( isset( $wp_query->query_vars['customvar'] )) {             $custom_Var = $wp_query->query_vars['customvar'];             $where .= " AND wp_MyTable.Column ='".$custom_Var."' ";         }         return $where;     }      This works well, but I want to **sanitize** it. In particular, I've tried using `$wpdb->prepare()` method:               $where .= $wpdb->prepare(" AND wp_MyTable.Column = %s", $custom_Var);      But this doesn't work (I just get a blank page). Why is this and is there another / better way of sanitizing the variable?


post->post_content filter

I'm trying to determine if the REGEX I'm using is incorrect -- or if I'm missing something basic here. The following:               add_filter('the_content','wpdu_image_replace');     function wpdu_image_replace($content) {         global $post;         preg_replace( '//', 'Image file', $post->post_content );              return $content;     }      should look for any `<img>` within `post->post_content` (the post's content) and replace the entire tag with an `href` that simply links to the image file. In the end what I'm going to do with this is a bit more complex -- but I figured I'd start with the basics. Any help would be greatly appreciated. Thanks!


Making Media Library "Alternative Text" Field Required

I'm looking to make the "Alternative Text" field required in the Media Library, just like the "Title" field above it. Screenshot: ![enter image description here](http://i.stack.imgur.com/sMO4E.png)


Hiding a Categories content on just the Homepage 'Posts'?

Is there a way I can hide a certain categories content from just the homepage Posts section of my Wordpress Site? So, those posts are still posted and live; just not visible nor accessible from the homepage posts area. I'm calling the category twice on the homepage; once in the header within a plugin I'm using, and the other where the posts are created by default by Wordpress. How can I hide my 'featured' category in the main page content of recent posts on the homepage?


My basic question is **How do I make my wordpress page more friendly for mobile viewers?** I have seen some answers such as wptouch, wordpress mobile pack, and mobilepress http ://wordpress.org/extend/plugins/mobilepress/ . All great, however I enjoy my theme and was wondering if there is a way to not-autoload images, and if there are some more versatile themes which can scale to smaller screens. Thank you in advance for your help.


How I got jQuery Quicksand working with WordPress?

I have been tryin to make this plugin work but I failed badly. I have the code like below: The `portfolio-terms` is filtering buttons:

<?php _e('All', 'framework'); ?>/
                         <?php                          wp_list_categories(array(                                 'title_li' => '',                                  'taxonomy' =>                                  'skill-type',                                  'walker' => new Portfolio_Walker(),                                 'show_option_none' => ''                             )                         ); ?>

            The `portfolio-items` is the images that need to be filtered:                        <ul id="portfolio-items" class="<?php if($magic_door) : ?>enabled<?php endif; ?> clearfix">                         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>                              <li id="portfolio-<?php the_ID(); ?>" class="<?php echo $output; ?>visible">                                  <div <?php post_class() ?> id="post-<?php the_ID(); ?>">                                      <a class="entry-link" href="<?php the_permalink(); ?>">                                      <?php tz_featured_image(get_the_ID(), TRUE); ?>

                         <?php endwhile; endif; ?>
            I was using this jQuery code:                                     But does not work. here my theme test: http://stakk.it/ Can someone help me? Thank you!


Custom post type, permalinks & pagination, going wrong

i have a site (http://fashionlog.com.br) with a custom post type 'fotolog' as you can see on the right side. The posts and pagination of the blog (central column) work fine. But when it comes to the posts and pagination of my CPT it goes wrong. If i dont use **the flush_rewrite_rules( false );** function after my register_post_type() call in functions.php, i can see the posts but the pagination doesnt work. If a use the function it's the oposite, i can't see the posts (404) but i get the pagination! I've been trying lots of times to switch the permalinks structure for tests, i checked my .htaccess file and its permissions, i tryed to "play" with the 'rewrite' parameter of the register_post_type() function, i've read and tryed the solution written here, here and also here... So far no luck, or am i missing something super obvious? I'd really be grateful for some help.


Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?

Ok so i have a custom post type called 'profile' with a custom taxonomy called 'company'. The site has many profiles and companies defined, with profiles being associated with companies as necessary. I have created a taxonomy-company.php template and have the correct profiles being displayed, but i don't know how to get the name of the company being displayed so that i can put it at the top of the template. Is there a quick way, perhaps a variable or function call that gets me that? Thanks.


How can I troubleshoot why TinyMCE won't load custom plugins in the visual editor?

**Edit:** Found that the theme options panel set up (using a class) was causing the problem. Still not sure why - would still love know how to find out what the problem is - e.g. is it a JS or PHP issue. Going to try a different method of creating the theme options panel to see if it fixes the problem. * * * I am able to add extra TinyMCE buttons that are bundled (e.g. HR, anchor), but am unable to add custom plugins of my own. I have also noticed that other plugins (WP-Table Reloaded, cForms, TinyMCE Advanced) are also unable to load custom plugins. Disabling all other plugins does not solve the issue. What could be causing this, and/or how can I find the problem? When viewing source of an edit post screen, mceInit options do not list any plugins besides those defined as WP default. Altering the $initArray does work, but of course does not point to the correct location of added plugins.


Sorting/Filter posts from front-end in Wordpress blog

Here is the design I have mocked up http://enormo.us/clients/ischool/ The question is, how can I create a filtering system where the main blog area acts as the central feed and it combines the result of all three filters. I would know how to do one of those rows, but im having trouble with all three together. For instance clicking on ischool life, students, and comments; would bring up only posts that are in the category iSchool Life, written by students, and sorted by the most comments. Any help would be appreciated, even doing this type of thing not related to WordPress that would be cool too. I know it is used in eCommerce sites all the time. Thanks, Dave


wp_admin edit.php slow with lots of queries

I have about 4,000 posts. Currently when I click on All Posts (edit.php) it's taking about 10 seconds to load and I'm showing approximately 1000 queries! Most of them look like...               SELECT t.*, tt.* FROM wp_terms AS t      INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id      INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id      WHERE tt.taxonomy IN ('post_tag') AND tr.object_id IN (37336)      ORDER BY t.name ASC      If I deactivate Wordpress SEO, I can cut the number of queries in half but the page still takes approximately 7 seconds to load. Just for fun, I deactivated all my plugins to no significant performance improvement. I've tweaked MySQL and PHP in about every way I can think of. The issue is the exorbitant amount of queries. Any way to tweak Wordpress here to use less? I have tried deleting revisions, etc. Nada. Really could use some insight here. Thanks!


drop in qtranslate plugins on fresh install

How would I go about setting up a drop in config for fresh wordpress installs that would 1) install qtranslate (or other plugins for that matter) 2) configure qtranslate to use the languge settings i define? As i find my self setting this up for every site i make now and its just another thing eating time, I have seen a little about drop ins / MU's but unsure how to start .. thanks


Archive page showing wrong month

My site's archive page is echoing wrong Month name. Though the URL is `2012/11/`, it's echoing the month `December 2012`. I found nothing wrong with the code:               <?php     if ( is_day() ) :     printf( __( 'Daywise Posts: %s', 'theme-name' ), '' . "". get_the_date() . "" .  '' );     elseif ( is_month() ) :     printf( __( 'Month-wise Posts: %s', 'theme-name' ), '' . "". get_the_date( _x( 'F Y', 'monthly archives date format', 'theme-name' ) ) . "".  '' );     elseif ( is_year() ) :     printf( __( 'Year-wise Posts: %s', 'theme-name' ), '' . "" . get_the_date( _x( 'Y', 'yearly archives date format', 'theme-name' ) ) . "".  '' );     else :     _e( 'Archives', 'theme-name' );     endif;     ?>      It's WordPress 3.4.2 here.


How to allow visitors to filter posts by multiple taxonomies

I am trying to allow users to filter a custom post type list by multiple taxonomies. For Example lets say my custom post type is **clothing** and it has two custom taxonomies **brand** and **type** associated with it. I would like a visitor to first see all clothing posts, then they could click on a brand link that brings them to a listing of all clothing in that brand(I can do this part). From that list of clothing in the chosen brand, I'd like them to be able to further narrow down the list to a type of clothing such as pants, so that now they are seeing a list of pants made by the brand they previously chose. I've looked around, and I found an older post showing how to do this by creating some rewrite rules: but, I'm really hoping there's an easier way than using rewrite rules out there now. Can anyone point me in the right direction here?


By Default, Turn Comments Off for Pages & Leave Comments On for Posts

By default "Discussion: Allow comments." is checked when a new page or post is created. I know you can make "Discussion: Allow comments." unchecked by default on both pages and posts by going to "Discussion Settings" and unchecking "Allow people to post comments on new articles". I would like the default to be:   * On posts: Discussion: Allow comments. (checked by default)   * On pages: Discussion: Allow comments. (unchecked by default) I do not want to use a plugin and don't want to modify the main WordPress code. I was hoping I could make a function in my functions.php file to do this? Something like:               function disable_comments_on_pages() {          }     add_filter( '', 'disable_comments_on_pages' );


How to change the position of Jetpack sharing icons?

![Jetpack Sharing buttons settins](http://i.stack.imgur.com/Y2Drn.png)   Typically Jetpack sharing buttons target the single page's `the_content()` function and echo the sharing icons just below the content. But for my site, I actually want it to **Disable** for `the_content()`, but to use it in some other `<div>`. I know I can check the "Disable CSS and JS" checkbox to disable the built-in functionality, but I actually don't want to code more and I like the default CSS of Jetpack sharing icons. I simply want a Javascript code to alter the target of Jetpack so that instead of showing under the `the_content()` I can show it under another custom `<div>` of my choice. Is it possible with any filter or hook? P.S.: I just renamed the "Posts" to "Products" for my project. It's nothing to worry about. :)


Redirect & permalink problems after moving multisite to a new server

I just moved my subdomain multisite to a new server and I'm having some trouble with permalinks & redirects. One difference post-move is that I have moved core WP files into it's own directory `/wp` (see roots/bedrock folder structure. Now when I try to access `/wp/wp-admin`, I am redirected to `/wp- login.php?redirect_to=...` which comes up as a 404 of course because that file does not exist. However, if I comment out the multisite constants in the config, I am able to access wp-admin as a non-multisite without issue (which is how I was able to make sure I have the right .htaccess below - from Tools > Network Setup). I have `.htaccess` setup with the rules instructed by WP for multisite:               RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^wp-admin$ wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^(wp-(content|admin|includes).*) wp/$1 [L]     RewriteRule ^(.*\.php)$ wp/$1 [L]     RewriteRule . index.php [L]      The other problem is that even with multisite off, I get a 404 when trying to go to any page other than the homepage. I've read that multisite stores some path info in the DB, so perhaps a search/replace is necessary? * * * # Update 1 I was able to resolve* the problem I had with the redirect to 404 when trying to access wp-admin. This was simply due to changes that needed to be made in the database for the `siteurl`. I was of the understanding that this value was superceeded by the WP_SITEURL constant. This does not seem to be the case with Multisite - probably because it has to be different for each site. Once I corrected the `siteurl` in the options table for each site, that site would work (wp-admin could be reached). ## 2 Problems remain   1. **Permalinks are still not working as they should.** Now that I can access wp-admin, I have gone in, and resaved to update the permalink structure which seems to have no effect. By not working, I mean I get a 404 when navigating to anything away from the front page of that site.   2. **Network admin is inaccessible via the admin bar.** The URL for Network admin it's giving me is missing the `/wp` directory. If I access it directly, `/wp/wp-admin/network/` \-- it works. For some reason, the generated URLs in the admin bar are missing this and are broken. If I change `define('PATH_CURRENT_SITE', '/');` to `define('PATH_CURRENT_SITE', '/wp/');`, those URLs are correct, but trying to access them fails. That does not seem like the right thing to do in this case as one would expect that to be shown under `/wp-admin/network/setup.php`. After some digging, I found that these links are generated by `network_admin_url()`. Essentially the responsible line of code is `set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );` from `network_site_url()`. * * * # Update 2 I was able to resolve the permalink issue. As it turns out it was actually the virtual host configuration in apache! I had `AllowOverride none` set for my site's `<Directory>` directive, which I think was preventing any of the .htaccess rewrite rules from being applied. I should've realized earlier that this was the case as the 404 I was getting was from apache, not wordpress... The only remaining weirdness at this point is the wrong url generated by `network_admin_url()`. Will post an answer if I figure this out.


File permissions for wp-minify plugin

I am worried on installing Wp-Minify plugin. But it needs 777 permission for the cache directory located inside wp-uploads directory. Isn't it a security issue?


Can I use Woocommerce to take orders but not handle payment?

I would like to create an ecommerce website. In this website the customer will browse the product catalog, add the desired products to his cart, maybe create an account, and during the checkout phase, will leave a phone number along with his shipping information and address. I will then manually review every order made (and be notified via email for new orders), call the person and handle it from then on. Is this possible or do I have to let woocommerce handle the payments using a gateway like PayPal? If it is possible, can someone please guide me how to set it up like so?


How to display post permalinks instead of pages?

I am working on a website for comics, and whenever you go to it, it should open the latest POST. I have no pages, I deleted them all. All the website has, is posts. So I want that whenever people start going "Next" to the next posts, it will display the permalinks (fancy URL) of posts, not weird page URL such as:               www.example.com/?p24


Custom content for Custom Post Type parent page?

I'm looking to set a static page as the parent for a custom post type. Right now the parent page is showing all archives for that custom post type. For example `http://mysite.com/cpt` would show content from page ID 20. Is this possible? Edit: I created a new Page with the slug `/cpt`, it did not override the custom post type archive parent.


Does WP search natively return results sorted by type (post, post type, page, category...)?

I found many solutions to sort search results by type, yet in default WP theme twentythirteen (and probably any other), search results seem to be already sorted by type. I would like to get confirmation that native WP search indeed sorts results by type and if so how does it do that?


Wordpress audio link not working

I'm trying to add an audio file to a page. I've added the audio file to my media library, and added it to the page using the "Add Media" button. It added the following text:               [audio mp3="http://mydomain.com/wp-content/uploads/2014/01/6.mp3"][/audio]      The problem is that on the page itself, this generates a link, that leads to that same page, without passing along the file. I've changed the domain name in the above snippet because the domain name the site is currently on is temporary while my domain registrar is updating dns settings.


Remove the first occurrence of a sub-site slug from URL

I have a multisite install with about 30 sub-sites. I want to know if it's possible to remove the sub-site slug if there are more than two occurrences of it in the URL. For instance:   * `http://example.com/subsite1/` \- That URL is okay   * `http://example.com/subsite1/subsite1-about/some-content` \- I would like to remove the first occurrence (from the left). I'm not sure how to do this and not sure if using Regex or `mod_rewrite` is better suited. Any thoughts and suggestions are appreciated.


Registering a stylesheet inside my WordPress widget

I did see the other topic similar to this but I cannot get mine to work. I am using WordPress 3.8 and am creating a custom widget for a site. I need to style it a certain way so I need to load an external stylesheet. I have tried:               function widget($args, $instance)       {         wp_enqueue_style( 'gamestats-style', plugins_url('css/styles.css', __FILE__) );               //Widget content       }      with no luck. I have the css file located in the css directory of my plugin directory "game-stats" so i believe the url is correct. plugins/game-stats/css/styles.css if I embed the styles in the php by way of `<script>....styles...</script>` it works fine but this is really bad practice. What am I doing wrong? Any help would be greatly appreciated.


WordPress/jQuery pagination plugin for multiple lists

I have 3 shortcodes. Each of them will be displaying a list. PS> the lists do NOT contain wordpress posts/pages. Is there any WordPress plugin that can achieve the purpose? OR Please suggest me a jQuery plugin that uses Ajax to fetch subsequent paged data and can work with my scenario.


Remove Sidebars from page

If I wanted to remove 1 or more sidebars when a certain page is called what is the best way to go about doing that?


Custom PHP App with a wordpress site

I have created a new 'page template' and (this is probably not the right way to do this, but this is the way I have got it working), and created a new page using that template. Within the page template (PHP file) I have made, I have put lots of PHP which makes the page function, like it has a simple login an view information from a SQL table. The problem is, I need to be able to send $_GET data to the page. I can send POST fine, but not GET, and I dont know what the URL is. For example, I would like to have clean URLs (that is what I have set wordpress to) i.e.: domain.com/teaching-portal/mygetdata The name of the page template is teaching-portal, and I would like to get `mygetdata` into PHP. But currently anything passed after teaching-portal results in a 404 page. How can i achieve this?


WP e-Commerce Gold Cart with Plugin Built Into Theme

I am using this theme on our site. http://themeforest.net/item/icarus- business-ecommerce-theme/1535471 It has the wp e-commerce theme built into the theme in the /wp- content/themes/icarus/plugins/wp-e-commerce directory. I want to know how to install Gold Cart with this theme. I have tried just installing Gold Cart normally to the wp-content/plugins directory, but if I remember correctly it caused the white screen of death when I tried to activate (I'd have to try it again to confirm that's what happened). Then I tried moving it to the same directory structure as WP e-commerce (/wp- content/themes/icarus/plugins/gold-cart-plugin-2.9.7.2), but it doesn't seem to be recognized. I don't see any new options in wp e-commerce; I am expecting to see additional gateway options. Can anyone tell me how to get gold cart to work with this set up? Also, can you tell me how to update wp e-commerce independently from updating the theme? Do I just copy the new version into the /wp- content/themes/icarus/plugins/wp-e-commerce directory? Thanks so much!!