Why is the CSS horizontal alignment for divs inside div container not displayed in my WP Theme?

WP 3.0.4 multisite network enabled, local installation with MAMP, PHP 5.3.2, WP THEME: Twentyten Child (Wordpress Theme) Having trouble with not displaying my CSS styling for horizontal alignment of 4 div-boxes inside a div-container. NOTE: The same css styling works fine with HTML 4.01 Transitional//EN on my hand-coded html/php website. But on my WordPress site, the four boxes stepped down from each other, like a staircase. Same behavior in Firefox v3.6.13 and Safari v5.0.3. **My CSS:** > div .box-container { display: inline; margin: 0.63em 0pt; padding:10px; > width: 640px; background-color:rgb(229, 231, 225); position:relative; float: > left; overflow:hidden; } > > div .small-box { border: 1px solid rgb(153, 51, 102); margin: 10px 5px; > padding: 0.325em; float: left; background-color: rgb(255, 244, 227); width: > 128px; line-height: 0.85em; max-height: 8em; min-height: 8em; position: > relative; } **My HTML:** >
 > >
SOME TEXT & IMAGE
 > >
SOME TEXT & IMAGE
 > >
SOME TEXT & IMAGE
 > >
SOME TEXT & IMAGE

 The box-container div width is specified as 640px, but I notice the padding extends it beyond this. In any case, it is plenty large to accommodate the four small boxes, which total 512px plus their total 40px margin, plus the 20px padding on the box- container div. **My Problem:** I don't understand why the padding pushes the size of the box-container div. When I tried to use max-width: 640px, I observed that the boxes all lined up vertically, and the box-container div was no wider than 170px. EDIT: The padding has since been removed from the box-container div, and margins adjusted on the small-box divs. REAL PROBLEM IS AS STATED IN THE FIRST 2 PARAGRAPHS: The four small boxes are stepped down from each other, like a staircase. I want them to align horizontally. The small-box divs are actually all the same size, their contents consist of text & image. Help? **Edit:** Screenshot of my hand-coded website, behaving as expected: ![screenshot of my hand-coded website, behaving as expected](http://i.stack.imgur.com/VZ2Nc.png) Staircase effect I'm seeing in WordPress my WordPress Theme: ![Staircase effect I'm seeing in WordPress my WordPress Theme](http://i.stack.imgur.com/ufw2i.png)


Different header for each category

I'm working on a project where each category should have a custom header page. Any suggestions? I'm just looking for some direction on how to accomplish this.


Cron Job to Delete over 30 days old post from post type

This is my first time creating a WP cron job and I would like to have someone else review it for mistakes. I wrote this cron job to delete temporary wishlists that are over 30 days old. The wishlists are saved as custom post types with post_type value as "wishlist". Also I'm using post_author value as 1 to only remove wishlist created by users that were not logged in (This way the wishlists in the query are only the temporary ones). I would like the cron job to run once a day and adding this to functions.php. Here is the code below, please let me know if this is done correctly. Thank you               // Cron Job to Delete Wishlists over 30 Days     if(!wp_next_scheduled( 'remove_old_wishlists_schedule')){         wp_schedule_event(time(), 'daily', 'remove_old_wishlists_schedule');     }          add_action('remove_old_wishlists_schedule', 'cr_remove_old_wishlists');          function cr_remove_old_wishlists(){     global $wpdb;     # Set max post date and post_type name          $date = date("Y-m-d H:i:s", strtotime('-30 days'));     $post_type = 'wishlist';          // Query post type     $query = "         SELECT ID FROM $wpdb->posts          WHERE post_type = '$post_type'          AND post_status = 'publish'          AND post_author = '1'         AND post_date < '$date'         ORDER BY post_modified DESC     ";     $results = $wpdb->get_results($query);                      foreach($results as $post){                          // Let the WordPress API do the heavy lifting for cleaning up entire post trails                     wp_delete_post( $post->ID, true);               }     }


How to structure a site with product variations pages?

I'm doing a website for a friend for his trailer business (riveting I know!), and was looking for some advice on how to build it out. Basically there are a few major types of trailers, then each main type has a few variations in size. So it's something like: Single Axels:   * 6x4    * 8x4    * 9x5 Tandems:   * 6x4    * 8x4    * 9x5 So each variations would have its own product page. This would consist of a description, some headings and a few image galleries. All of the pages would have a very similar structure, as they're basically the same thing, just with different heading and pictures. I've made a quick and ugly wireframe to illustrate more clearly what I mean: ![enter image description here](http://i.stack.imgur.com/iW6eQm.png) I'm just unsure of the best way to build this out. My first instinct (Which I think may be wrong), was to create a custom post type, say for Single Axels, and attach all the various custom fields needed. Then there would be a post for each variation (6x4, 8x4 etc). Now I'm just a bit confused as to how I display these posts as their own separate page?


Auto-deleting comments that trigger the blacklist

By default, the WP 'blacklist' feature finds comments containing the blacklisted string and moves them to the spam folder. What I am trying to do is change it so that instead of going to spam, the comment goes directly to the trash (or even better isn't stored at all). In /wp-includes/comment.php around line 700:               if ( wp_blacklist_check($comment_author, $comment_author_email, $comment_author_url, $comment_content, $comment_author_IP, $comment_agent) )         $approved = 'spam';     }      I tried modifying the line to `$approved = 'trash';` but I am still getting comments containing blacklisted words being moved to my spam folder. The only comment related plugin I am running in Akismet, is it possible that Akismet is moving the comment to spam before comment.php processes it?


Utilize TinyMCE hyperlink chooser outside of TinyMCE

Is it possible to use the "Insert/edit link" dialog box outside of TinyMCE? For example, if I wanted to add that dialog box to a generic button within a plugin settings form, is it possible to include just the portion of the TinyMCE that is required to make it work?


Why doesn't the WYSIWYG support H1-H6 tags?

I'm just wondering how i can have a client write normal paragraph text separated by headers if there is no header capability in the WYSIWYG editor, at least not that i've been able to locate?


Using admin-ajax prevents regular php form submission

I have a page with a table of posts and groups of checkbox filters in the sidebar. Looks something like this: `www.example.com/toylist`               |___________|    |_______________________|     | [ ] Red   |    |  1. Big Red Box       |     | [ ] Blue  |    |  2. Big Blue Box      |     | [ ] Green |    |  3. Big Green Box     |     |           |    |  4. Small Red Box     |     | [ ] Box   |    |  5. Small Blue Box    |     | [ ] Ball  |    |  6. Small Green Box   |     |           |    |  7. Big Red Ball      |     |           |    |  8. Big Blue Ball     |     | [Filter]  |    |  9. Small Green Ball  |      The sidebar is a form which posts data to the same url and appends parameters based on the chosen options. (`www.example.com/toylist?color=red&type=ball`) The page is set to show all posts by default and read the URL filters and return the appropriately filtered posts. This worked successfully with just PHP. I then added ajax for a better user experience so when you click on the checkboxes, the table with repopulate with the filtered posts, instead of having to click on the filter button. I found that in order to use ajax with wordpress, you should route it through admin-ajax.php using the `wp_ajax_` hook. I added the hooks and changed the form's submission action to admin-ajax.php. Now, when javascript is disabled, the form obviously does not work anymore. I get a 404 because the browser is attempting to display admin-ajax.php. Is there a way to have a form work with and without javascript turned on using the wordpress ajax hooks? **Update** : Ok, so I fixed the 404 error. My url in the form action was incorrect. Functionally it works now without javascript, however the page it displays, `www.example.com/wp-admin/admin- ajax.php?action=my_function&color=red&type=ball` obviously is not picking up the styles in my theme. How do I route it back to 'www.example.com/toylist` with the return data from my function?


Wordpress Staging and Testing of Plugins Best Practices

I'm just being testing a lot around for pagespeed. Doing this on a live system is a pain since you only can work between 2am to 7am. I do have employees creating content on the live system also comments are stored in the live db. Wordpress seems to recommend to use one db (see: http://codex.wordpress.org/Running_a_Development_Copy_of_WordPress) Does this work with testing plugins and themes? Where do they store their settings? Kind of think this won't work since the plugins store their information in the database. Probably I need a local dev/staging installation or? What are the best practices for staging wordpress? Is there any smart way to only move the settings and updated files (theme, wordpress, ..) From dev to staging and from staging to live? ~~Is there any smart plugin allowing an staging environment?~~ Because that would be off-topic.


Using $seed on a custom post type for randomly displayed posts

I saw this link to display posts randomly without duplicating them. However how do you apply this to a custom post type? Below is what I'm using in functions to make it randomly display.                   session_start();          add_filter('posts_orderby', 'edit_posts_orderby');          function edit_posts_orderby($orderby_statement) {              $seed = $_SESSION['seed'];         if (empty($seed)) {           $seed = rand();           $_SESSION['seed'] = $seed;         }              $orderby_statement = 'RAND('.$seed.')';         return $orderby_statement;     }


add_image_size() and uploading the exact size leaves 1x1 image in uploads

I've added an image size of `370x150` which works, but if I upload an image to those exact dimensions `get_post_thumbnail()` no longer works as expected. If I look into my uploads folder I'll have a `thumbnail`, `medium`, and `full` along with a `1x1`. I add the image size like so:               add_image_size('homepage_featured', array(370, 150));      and call that image like so:               the_post_thumbnail('homepage_featured');      which then pulls up the 1x1 image size. I could probably circumvent this by adding a conditional before my thumbnail call which tests if that size exists:               $thumb = get_the_post_thumbnail($post->ID, 'homepage_featured');     $thumbArr = explode('width="', $thumb);     if(!empty($thumbArr) && is_numeric($thumbArr[1][0]) && $thumbArr[1][0] >= 370)         the_post_thumbnail('homepage_featured');     else         the_post_thumbnail('full');      but that seems silly. Is this a normal thing or is it a problem with my custom theme? Is there a better way to test if a certain thumbnail size exists than the above method?


Output posts attached images as thumbnails linked to full-size with lightbox class

I'm trying to create a function to be placed in a template page to output the post's attached images. I would like to have the images display as the theme's specified thumbnail size and be linked to the full-size image so that I can give them a lightbox-triggering class (in this case thickbox). I currently can only get an image to output using `the_attachment_link` which links and displays the image but doesn't let me customize it like I need to in order to add the class. Here is my current code, including what works, what I think should work, and another solution I've tried:               function product_images() {     global $post;         $attachments = get_posts( array(             'post_type' => 'attachment',             'posts_per_page' => 0,             'post_parent' => $post->ID,             'exclude' => get_post_thumbnail_id()         ) );              if ( $attachments ) {             $content .= '
';             foreach ( $attachments as $attachment ) {                 // What works to display image but doesn't allow customizing output                 $imgthumb = the_attachment_link($attachment->ID, false);                 $content .= $imgthumb;                      /*What I WANT to work!                 $imgthumb = wp_get_attachment_url($attachment->ID);                 $content .= '';                 */                      /* Also tried                 $imgthumb = wp_get_attachment_image_src( $attachment->ID, 'thumbnail' );                 $imgfull = wp_get_attachment_image_src( $attachment->ID, 'full' );                 $content .= '';                 */             }             $content .= '
';         }     return $content;      } Thanks in advance for any help! I've been trying to get it going for several hours. I've looked at several other articles on this site but none were the same problem. I've also poured over the Digging into Wordpress article about image tags.


Will I see a performance hit if I use native API calls like get_the_title() instead of $post->post_title?

Let's say I've already got the $post object through some earlier process of looping through an array of IDs and using get_post() on each one of them, storing the resulting object in some array. Later on, I want to loop through that array and do something with each post. I already have a $my_post object, so I could `echo $my_post->post_title`, or I could get fancy and `echo apply_filters('the_title', $my_post->post_title, $my_post->ID)` or I could just use the native `get_the_title($my_post->ID)`. Here's where my performance question comes in. How reliable is the native cache (I'm not talking about some crazy plugin, just the built-in `wp_cache_get($post_id, 'posts')` etc..)? I guess what I'm asking is: what is the likelihood that get_the_title() will dip back into the DB and re-grab the post, as opposed to using the cache, and would I be better off from a performance perspective just using the object data that I already have? Clearly you get more sugar if you use the built-in stuff. But does it risk going back to the DB?


Questions regarding add_meta_box()

Registered a custom post type (`xyz`) and after that added a meta box using this excellent Tuts+ tutorial, so then I can reduce the usage of 'Advanced Custom Fields' where I can (but I love ACF most). But doing so, I came up with some questions:   1. What is the difference between `'high'` and `'core'` in the `$priority` parameter?   2. How the `'normal'` and the `'advanced'` are different from each other in the `$context` parameter?   3. However I added a meta box it showed a Standard meta box with sortable field-group. How can I achieve an Embedded-like meta box (as how ACF provides with `'Seamless'`) so then the field-group embeds on the body and user can't sort 'em as their wish? Is that only a CSS issue?   4. If I think to provide boolean `false` to `'supports'` parameter when registering custom post type (CPT) and make meta box with meta fields to the post type to get the data - is that good for all causes - whether a data hierarchy, SEO, and so on? ## EDIT I'm well aware about the Codex, and already tried the codex things here. On #1 & #2, I can't figure out how they are modifying my meta box due to their value changes. #3 is custom demand, seeking, but till couldn't find it. #4 is a general query, need your advice on experience.


Getting started with e-commerce sites on WordPress

Are there any good resources for building an e-commerce storefront? I am aware of the e-commerce plugins available but I am mainly interested in learning practices and techniques for the design and development of an e-commerce site for someone who has never built one before. Obviously, nothing is stopping me from just trying, but figured I would ask if there are good resources out there to learn from.


Editing 375 posts simultaneously? Maybe from the database?

I have a question regarding my site, tablified.com. I need to change a line of code on ALL of my posts. Within each post, there is a certain line of code that needs to be altered. This code is this: > [a href="https://market.android.com/details?id=COM.NAMEOFAPP.EXAMPLE>< > src="http://tablified.com/wp-content/uploads/2011/07/androidicon.png" alt="" > title="Click to Download from Android Market" width="300" height="48" > class="alignnone size-full wp-image-4507" /] This is found at the bottom of every post. As you know, this simply displays a clickable picture that takes the user to another page. For all 376 posts, 95% of this code is the same. The only thing that differs between posts is:               COM.NAMEOFAPP.EXAMPLE      that line is specific for every app on the official Android Market. I have found a new plugin that will allow me to display a widget at the bottom of the post with a nice picture and link to the official Android Market. To make a long story short, that entire line of code needs to be edit to look like this:               [app]COM.NAMEOFAPP.EXAMPLE[/app]      All I did was remove the first part of the code:               < src="http://tablified.com/wp-content/uploads/2011/07/androidicon.png" alt="" title="Click to Download from Android Market" width="300" height="48" class="alignnone size-full wp-image-4507" />      with `[/app]` so now you are left with               [app]COM.NAMEOFAPP.EXAMPLE[/app]       of course with the proper name of that particular app in between the `[app][/app]`. My question is, what is the quickest way to accomplish this? If I export all the posts to a XML file, I can use a text editor to make the changes. But what will happen once I import this file back into Wordpress? Will it overwrite the previous posts? Will it create new ones? What will happen to the screenshots with each of those posts? I am using a theme that doesn't actually attach the image to post, meaning if I export it, the pictures wont be there. Will they be lost? Please let me know if you can help me with this. Thank you so much for your time. I hope everything made sense. The fix seems simple, but I am not sure of the outcome. Ayman


Hide admin login without plugin

I'd like to hide my admin login, since it was disabled some time ago because of attacks. (I do not remember what they were exactly, my site was down for another reasons long time) I know there are several plugins to do this, but I would like to use my own code. Has anyone done this before, and is it possible to add this to theme functions.php? I have already searched but found no tutorial on the internet, but could this example be a starting point? Changing wp login url without .htaccess I have written my own template with functions already, but this is far more complex, so hope to get some hints from fellow more experienced wordpress coders. Sorry if this is a dumb question


Prevent comments from being rendered as HTML

I would like users to be able to enter XML structured text in the comments, but wordpress consumes the tags and they are not rendered. How can I disable this functionality? HTML is not important to me.


Why doesn't 'continue' work in page?

OK, so I'm working with a template (I have contacted the developer and they were of no help, so I'm modifying the template page as needed). The template displays portfolio items, using the following code:

                     <?php                              $type = 'portfolio';                             $args=array( 'post_type' => $type, 'posts_per_page' => -1 );                             query_posts( $args );                                     if (have_posts()) : while (have_posts()) : the_post();                                               $terms = get_the_terms( $post->ID, 'portfolio_categories' ); ?>                                  if (has_post_thumbnail()) {                                                  $thumb = get_post_thumbnail_id();                                 $thumb_w = '460';                                 $thumb_h = '272';                                 $image_src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');                                 $image_url = $image_src [0];                                 $attachment_url = wp_get_attachment_url($thumb, 'full');                                 $image = aq_resize($attachment_url, $thumb_w, $thumb_h, true);                                                       }                                                  $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'grid-thumb');                                      foreach ( $terms as $term ) {                                         $cats[0] = $term->name;                                         $catname = join($cats);                                              $catname = preg_replace('/\s/', '', $catname);                                                                   }                             $title= get_the_title();                             $title= explode(' ',$title);                             $title[0]= ''.$title[0].'';                             $title= implode(' ',$title);                         ?>                                             <li data-id="id-<?php echo $post->ID; ?>" data-type="<?php                                  $terms = get_the_term_list( $post->ID, 'portfolio_categories','',' , ','' );                                  $terms = preg_replace('/\s/','', $terms);                                 $terms = strip_tags( $terms );                                 $terms = preg_replace('/[\s,\-!]/',' ', $terms);                                 echo $terms;                                 ?>" class="four columns m-bot-25">

                                         <img src="<?php echo $image; ?>" alt="<?php the_title(); ?>" />

<?php echo $title; ?>
                                             <a href="<?php echo $attachment_url; ?>" class="lightbox zoom info">                                             <a href="<?php the_permalink(); ?>" class="link info">

                                         <a class="a-invert" href="<?php the_permalink(); ?>" ><?php echo $title; ?>

                <?php endwhile; ?>

      Basically, I need to only display posts that match a certain slug, which can be retrieved off $terms. However, when I try the following code modification:               if( $terms->slug != 'product-gallery' ) continue;      placed after the $terms = get_the_terms(...) line, it would seem that The Loop is broken, and no posts are displayed at all on the page. It's important that I can filter the posts, and by slug, as I can't modify the theme very much, and the client needs to be able to add/remove posts by categories for which there are slugs. Disclaimer: I am new to the WP environment, php, and mysql. However, I am a quick learned and I have plenty of coding experience in C++, Java, Perl, etc. I'm just new to web development. What am I missing or doing wrong for my goal? Thanks


Rewrite Rule for Post "Subpage", with pagination

I would like to know if is possible to add a "subpage" to a post and in this "subpage" have paginated content, for example: I Have a Post **Lorem Ipsum**   This post has **Videos** , **Photos** and **Audios** as attachments   When you access the post **www.website.com/lorem-ipsum/** you access basically just the text, and some other infos and you could access:   * www.website.com/lorem-ipsum/videos/    * www.website.com/lorem-ipsum/videos/page/2   * www.website.com/lorem-ipsum/audios/   * www.website.com/lorem-ipsum/audios/page/2   * www.website.com/lorem-ipsum/photos/   * www.website.com/lorem-ipsum/photos/page/2 I have this on my functions.php               <?php           add_action( 'after_setup_theme', 'rm_setup_theme' );          function rm_setup_theme() {              add_filter( 'rewrite_rules_array', 'rm_custom_rules' );         add_filter( 'query_vars',          'rm_custom_vars' );         add_filter( 'template_redirect',   'rm_custom_redirect' );     }          function rm_custom_rules( $rules ) {              $r = array(              '([^/]+)(/[0-9]+)?/photos/page/?([0-9]{1,})/?$' => 'index.php?name=$matches[1]&paged=$matches[2]&photos=1',             '([^/]+)(/[0-9]+)?/photos/?$'                   => 'index.php?name=$matches[1]&photos=1'         );              return array_merge( $r, $rules );     }          function rm_custom_vars( $qv ) {         array_push( $qv, 'photos' );         return $qv;     }          function rm_custom_redirect( ) {         global $wp_query;         $f = $wp_query->get( 'photos' );              if ( $f ) {             require TEMPLATEPATH . '/content-photos.php';             exit;         }     }          ?>      With this I have the following urls "working":   * www.website.com/lorem-ipsum/photos/   * www.website.com/lorem-ipsum/photos/page/2 But the pagination it's not working, it looks like the paged var it's not passed, it always show the content of the first page, no matter what page do you type in the address bar **/photos Request**   The request on photos page (www.website.com/lorem-ipsum/photos/): **Request:**   lorem-ipsum-dolor-sit-amet/photos **Query String:**   name=lorem-ipsum-dolor-sit-amet&photos=1 **Matched Rewrite Rule:**   ([^/]+)(/[0-9]+)?/photos/?$ **Matched Rewrite Query:**   name=lorem-ipsum-dolor-sit-amet&photos=1 **/photos/page/2 Request**   The request on photos page (www.website.com/lorem-ipsum/photos/page/2): **Request:**   lorem-ipsum-dolor-sit-amet/photos/page/2 **Query String:**   name=lorem-ipsum-dolor-sit-amet&photos=1 **Matched Rewrite Rule:**   ([^/]+)(/[0-9]+)?/photos/page/?([0-9]{1,})/?$ **Matched Rewrite Query:**   name=lorem-ipsum-dolor-sit-amet&paged=&photos=1 Thanks


Publishing Remotely To Wordpress?

Hey i know that there are options to post to a wordpress blog remotely by email or by another source. My blog is self hosted. What other ways is there to publish besides via email.


Display posts in random post types

I am currently working in a project in wordpress. Here i have to get all posts from two custom post types namely pt1, pt2. But here i want to display posts with random post type(pt1, pt2). Example) I want to display first post from pt1, next from pt2 and again pt1 and next pt2 and so on... How can i do this. Any help? This is the code:                $args = array(          'posts_per_page'   => 5,              'orderby'          => 'post_date',          'order'            => 'DESC',             'post_type'        => array('pt1', 'pt2'),            'post_status'      => 'publish'           );           $posts = get_posts( $args );          $num=1;          foreach($posts as $post) {              if( $num % 2 == 0 )                               echo $post->post_title.$post->post_type;              else                      echo $post->post_title.$post->post_type;              $num++;          }


deleting terms programmatically

I already checked out this page; http://codex.wordpress.org/Function_Reference/wp_delete_term It does not say what happens to the posts that may have been associated with this action. Hence my question; So, what happens to them?


How to use the bbPress import tool

I have used example.php to create a custom importer for Social Engine 3 to bbPress Forums but I don't seem to be having any success using it. What am I doing wrong? I enter server ip, name, port, username, and password but the import never gets past "Starting Conversion". When I select another platform's importer, I get errors saying there is no forum to import (which would be right because the table names/fields don't exist). What should I try? My attempt at the custom importer is here: http://pastebin.com/Z0Zj7n0q Edit: Firebug shows that starting conversion caused 500 Error.


Convenient way to use wp_filesystem

I'd like to use **$wp_filesystem** which seems to be the recommended way to manipulate file system objects in WordPress but compare this: **plain PHP code** :               mkdir('abc');      **WP Filesystem API code**:               $url = wp_nonce_url('plugins.php');     if (false === ($creds = request_filesystem_credentials($url, '', false, false, null) ) ) {         echo "Could not create filesystem credentials";         return;     }          if ( ! WP_Filesystem($creds) ) {         request_filesystem_credentials($url, '', true, false, null);         echo "Filesystem credentials were not available";         return;     }          $wp_filesystem->mkdir('abc', true);      This is a bit unwieldy and maybe I'm getting something wrong but isn't there a more convenient way to execute methods on `$wp_filesystem`? I tried to leave the credentials code out but in that case, the filesystem command didn't work.


Change Wordpress Gallery Markup in functions.php

I'm looking to change the markup of the Wordpress Gallery, so that it outputs a new set of code. Ideally, this is what I want (a Bootstrap-based markup).

      Is there a way to do that in the functions.php file of my theme. The standard column, dt, etc.. markup is kind of annoying.


Create input select image URL?

My code in functions is:               <input type="text" name="Cat_meta[img]" id="Cat_meta[img]" size="3" style="width:60%;" value=" <?php echo $cat_meta['img'] ? $cat_meta['img'] : ''; ?>">      How to get select url as post add media ![enter image description here](http://i.stack.imgur.com/eUQZB.jpg)


Blank page beyond dashboard

![enter image description here](http://i.stack.imgur.com/GjH7X.png) Our page is not showing anything past the dashboard. All that is showing is on the Jetpack section and the Portfolio section. Has anyone got any ideas why this is happening? Is it because we haven't been updating the site? We're a bunch of computer illiterate people here.. so any non-technical or low-technical advice would be appreciated! Thanks so much in advance for your help!


WP Create User - Preventing repeated information

I am using the               <?php wp_create_user( $username, $password, $email ); ?>      function in a contact form to create a subscriber when the user enters infomation on the contact form, thus in the background adding their email address to the database and giving them an account for site access. Does this way of doing it though not mean that if a user sends 3 messages from the contact form they end up with 3 accounts with the same email address, or will it check to see if the email address or user name already exists. Any ideas?


Why doesn't my page know it's a page (won't return true for is_page())?

I have a page with the slug `blog`. Mysite.com/blog correctly renders from the template file page-blog.php. However, it does not execute footer code from my theme that's conditioned on `is_page('blog')`, nor does it have an "Edit Page" link in the Admin bar. I also have a custom post type called `blog`, but this page doesn't execute code for `is_post_type_archive('blog')` either. In the admin bar, there is no "Edit Category" link or "Edit [Anything else]". This is the info the WP Debug plugin gives me when I load the page:               Request:     blog          Query String:     pagename=blog          Matched Rewrite Rule:     (blog)(/[0-9]+)?/?$          Matched Rewrite Query:     pagename=blog&page=      What could be the problem?


Isn't the way posts are displayed very unefficient?

I'm pretty much a WP newbie, and I've noticed that in a lot of themes, there is the exact same code for displaying posts in three different places (single.php, archive.php, index.php etc) This just bugs me. It doesn't seem right to me, a programmer always trying to code as efficiently as possible. What is the best way to generalize the layout for posts, preferably as a WordPress integrated/native function?


Help with adding conditional title tags to header.php

From an SEO perspective, i'm trying to add conditional title tags to my WP theme such that it echos a piece of text based on various categories. Assuming that my category id's are 1, 2, 3, 4 Then i'd like to add Title 1 if category id = 1, title 2 if category id = 2 and so on. Could someone assist in the correct php syntax to implement this. Thanks.


How To Determine If A Filter Is Called In A Sidebar/Widget Context?

So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type. It does this by hooking to either `the_content` or `the_excerpt` and appending/prepending content according to the plugin's configuration. I've started getting support queries where the author biography is appearing in the sidebar of a site via a widget, for example via the Category Posts widget. The widget is using `the_excerpt()` within a custom query Loop, to pull posts according to a configured category and show the post excerpt within the context of the sidebar. As a direct effect of this, my plugin's `the_excerpt` filter hook is being called. What I'd like to do is be able to detect whether my filter hook is being invoked within the context of the sidebar or a widget and conditionally decide whether to append my plugin's content to the post content passed to the filter hook. The pseudo-code would look something like this ...               add_filter ('the_excerpt', array ($this, 'insert_biography_box'));     function insert_biography_box ($content) {         if (in_sidebar ()) {             return $content;         }              // do code stuff to append/prepend biography content         return $content;     }      ... but after a lot of searching through the WordPress core source, forums and here it doesn't look like a function along the lines of `is_sidebar` or `is_widget` (or some other variation on the name) exists. Is it even possible to determine whether a filter hook function is being called within the context of the sidebar or within a widget? **EDIT** : Based on @toscho's suggestion to use `is_main_query`, I modified my filter hook for `the_content` and `the_excerpt` to look like this ...               add_filter ('the_excerpt', array ($this, 'insert_biography_box'));     add_filter ('the_content', array ($this, 'insert_biography_box'));          function insert_biography_box ($content) {         error_log ('insert_biography_box: current filter=' . current_filter ());         if (!is_main_query ()) {             error_log ('Not main query, baling');             return $content;         }              // do code stuff to append/prepend biography content         $biography = 'some-magic-function-return-value';         return $content . $biography;     }      Based on this, I was expecting to see the message `Not main query, baling` in my PHP error log when the Category Posts widget is calling `the_excerpt()` in the context of the sidebar. But I don't. For context, the Category Posts widget is querying for posts within the widget's `widget` method like this (severely paraphrased for clarity) ...               $cat_posts = new WP_Query (...);     while ($cat_posts->have_posts ()) {         $cat_posts->the_post ();         the_excerpt ();     }      ... am I missing something (very likely) or am I just not getting the context within which I'm using `is_main_query()` (just as very likely) ... ?


Can I define multiple paginations on a single page?

I have a category page, which shows this category's subcategories. I want in each subcategory to show its first five articles. And then provide pagination for each subcategory in order to allow user to see next/previous articles of this subcategory. How can I do this?


Use theme constants in plugin?

I'm creating a plugin version of the Roots Theme function additions - to make it a bit more portable, but have run into a snag. Part of what Roots does is add `htaccess` rules based on the current theme information -- like so:               // only use clean urls if the theme isn't a child or an MU (Network) install     if (!is_multisite() && !is_child_theme() && get_option('permalink_structure')) {       add_action('generate_rewrite_rules', 'roots_add_rewrites');       add_action('generate_rewrite_rules', 'roots_add_h5bp_htaccess');       if (!is_admin()) {         $tags = array(           'plugins_url',           'bloginfo',           'stylesheet_directory_uri',           'template_directory_uri',           'script_loader_src',           'style_loader_src'         );              add_filters($tags, 'roots_clean_urls');       }     }      So, it's basically checking to make sure that the current setup is not a multisite environment, not a child theme and that the permalink structure has been updated from the defaults. It seems like the `is_child_theme()` is not being called correctly, mainly because I get the following error on the frontend:               Notice: Use of undefined constant TEMPLATEPATH - assumed 'TEMPLATEPATH' in /Users/studio/Sites/base_wp/wp-includes/theme.php on line 17          Notice: Use of undefined constant STYLESHEETPATH - assumed 'STYLESHEETPATH' in /Users/studio/Sites/base_wp/wp-includes/theme.php on line 17      So, from what I can gather, it's the `wp-includes/theme.php` file that is not included in plugin files (which makes senses). I've been banging my head against the wall with this one, but am trying to figure out the cleanest way possible to add in those constants to the plugin itself -> should I just include that `theme.php` file? Thanks. **UPDATE:** Looks like I can use functions that are in `wp-includes/theme.php` (like `get_themes()`) so I know that's not the issue. hm...


the_post_thumbnail() Custom sizes not display correctly

I'm trying to display wide image icons from the_post_thumbnail() function. I'm using 'true' value for cropping, but they are not cropped well... I get some strange results with different sizes (I'm trying to use 200width x 150height). If image cannot be display with good proportions (I don't know why whem I'm cropping it? ) then I want it to have exact 150px height always! How can I achieve it? I've been trying with set_post_thumbnail_size() but its even worst...


Conditional Tag Custom Querys?

I think thats what its called... Basically a conditional statement if there are any posts in a specific custom post type/custom taxonomy, show posts, it not show an img or include whatever…? But cycle through a few custom post types? Checking in each if there is a post in the featured custom tax and if not skip on to the next one, ending up if a temp image or something... So a conditional tag with query i suppose…               if     <?php $loop = new WP_Query( array( 'post_type' => 'profile','profile-type' => 'featured','posts_per_page' => '-1' ) ); ?>     show post details          else if     <?php $loop = new WP_Query( array( 'post_type' => 'films','film-type' => 'featured','posts_per_page' => '-1' ) ); ?>     show post details          etc etc          else     show include or temp image      Can it be done, or asking a bit too much of the technology? Many thanks for any help :)


Putting a space between the buttons

<?php echo do_shortcode('[su_button url="http://google.com/checkout/" target="self" background="#2D89EF" color="#FFFFFF" size="3" wide="no" center="no" radius="auto" icon="icon: shopping-cart" icon_color="#FFFFFF" text_shadow="none" desc="" onclick="" class=""]Buy now            $149[/su_button]'); ?>      so right now the button says Buy Now $149 but I want to put 2 more spaces between the text. Manually inserting spaces doesn't seem to work.


How to handle a hierarchy with custom post types

I have moved into WordPress for a few days and was quite impressed by all the available features, plugins and polished themes. I have spent quite some times reading documentation about themes and custom types. So far so good... Now that I'm trying to do real things, it seems (but I maybe missing something) that WP has some sever limitations. I want to come up with a classical ISV site. A typical hierarchy would be:   * Products   * -- Product A   * ---- Overview   * ---- Release History   * ------- Release 1.5    * ------- Release 1.4   * ------- Release 1.3   * ------- etc.   * ---- Features   * ---- etc.   * -- Product B   * ---- Overview   * List item    * etc... Focusing on Release History, I came up with:   * a custom content type: "releases".   * a custom taxonomy to specify the product associated with a specific "release".   * I created a template to display the list of "releases".   * Created a single-release.php to display the detail of a release.   * Created a page based on my template. The page URL that display the list of "releases" will basically fit into the hierarchy (/products/product-a/release-history/). However the URL of the custom post type will be something like: /%post_type%/%post_slug%/ (ie: /releases/version 1.2/ I'm struggling for 2 days trying to find a solution for coming with a coherent URL scheme. I have tried to use to use Custom post permalinks plugin to come up with an URL that would include my custom taxonomy representing the product (better than nothing even if it's not perfect) but for some reason the plugin doesn't work on my side. Overall, unless I'm missing something, Custom Post Types sound great but are quite a nightmare if you don't have a flat structure. I would certainly have preferred a concept of custom content type that is not URL dependant or an easy way to plug a custom post type at any level in the page hierarchy. That said, I may be completely missing the point. Does anybody have any idea, experience when setting up a site with this kind of hierarchy? Any help appreciated... ## [Update] Not completely sure what are the conventions when updating here but I will leave the initial text for clarity purposes. The purpose of this update is to clarify and add further details. _Products_   Created a WP page 'Products' - no parent - URL: http:///products/ _Product A (specific product)_   Created a WP page 'Product A' - parent: 'Products' - URL: http:///products/product-a/ _Overview_   Created a WP page 'Overview' - parent: 'Product A' - URL: http:///products/product-a/overview/ _Releases (list of release for the specific product )_   Created a WP page 'What's New' - applied a template that displays a list of all available releases (each release has a link to display the detail of that specific release) - parent: 'Product A' - URL: http:///products/product-a/product-releases/.   Releases are implemented using a custom type (see below). It was therefore quite easy to implement the template and link to release permalink. Though I haven't implemented it yet, my idea was that the template would display the release list for any product based on a taxonomy (product-id) defined at the page level. I could therefore have another page using the same template that would display the releases for another product by having the proper 'product- id' taxonomy attached to this other page. _Release (detail of a release)_   Releases are implemented using a Custom Post Type (let's call it 'product- release'). In addition, I'm using a custom Taxonomy (product-id) to attach each release to a specific product (obviously, I don't want to create another Custom Post Type for the releases related to another product).   Created a 'single-product-release.php' file to display a specific release. The problem with this approach is that a specific release will be displayed with the following URL: `http://<root>/product-releases/release-xx`   * It's not really descriptive, the least we can say (I should at least get some product identifier in the url)   * it somewhat breaks the hierarchy (though one could certainly argue regarding if it's wrong or not) ### My Options (as far as I can see as a WordPress newbie) _Get rid of the permalink stuff_   Maybe I could display the detail of a release using some template and passing some argument in the URL. I could use this template with a page that would go exactly where I want in the hierarchy.   Obviously not an approach I would follow ... for many reasons I won't detail here (that's already a long post/question). _Find a way to append (or rather prefix) my 'product-id' value to the Custom Post Type permalink_   We could have something like http:///product-a/product-releases/release-x. I would have to accept that releases live somewhat outside of the 'natural' hierarchy which would be http:///products/product-a/product- releases/release-x.   I could go even further by prefixing with 'products' - something like /products/%product-id%/%product-release%/. However, I'm wondering if this Rewrite Rule would not clash with the 'pages' created under the 'products' page... Any input appreciated. ## [Update] I implemented the approach proposed by bobdiaes. This works fine for my content type however this will clash with the WP pages that are mixed in the hierarchy. Using bobdiaes piece of code, I came up with the following Permaling for my product-release custom post type:   `/products/%product-id%/product-releases/%product-release%`   I will therefore have the proper product URL for displaying the detail of a release for a specific product. ie: `/products/my-great-product/product- releases/release-1-5/` However, I want to have some WP pages in the mix:   * `/products/my-great-product/`should provide an overview of the product.   * `/products/my-great-product/product-releases/`should display the list of releases + the details of the latest release. At first, it sounds quite natural to create WP pages to do what I need. I will organize my page hierarchy so that the pages fit in the exact URL scheme. However, this approach will clash with the URL rewriting used for the "product-release" Custom Content Type and I won't be able to browse the pages (404). Well, well, well... ### So what are my options now _Give up the idea of using WP_   Well, I think I'm going to insist some more. Beside this problem, there are many things to like with WP. _Use Pod CMS_   Though I haven't tested it yet. It sounds like a nice framework/tool. However, I would loose the ability to easily translate my content using WPML.   The fact that they will be able to use custom post types rather than their own table in version 2.0 will certainly let them rely on current plugins for translation purposes. What they are preparing for version 2.0 sounds interesting. They will be able to use Custom Post Type instead of their own tables.   Pod CMS 2.0 could be **THE SOLUTION**. _Using WP pages instead of a 'product-release" Custom Post Type_   The idea here would be to create a page for each product release (with product-releases page as the parent). I suppose it must be easy to loop through child pages for displaying the list of releases.   Obviously, it has quite some drawbacks:   * The current admin page interface may not be very practical to handle hundreds of pages...   * Because the page is already a specialized Custom Post Type (as far as I understand), I would have to remember the specific custom fields I need each time I use a page like a pseudo-content type unless I want to create all fields that may be needed all over the web site. Quite an horrible solution if you ask me. _Replace WP pages by some Custom Post Type_   Not sure about the possible rewrite rules clash but here is the idea. Instead of having an overview page, I could come up with a 'product-overview' Custom Post Type and use a permalink rewriting rule the same way I did for 'product- release' Custom Post Type. Will update with my findings. I'm sure I'm not the only facing this WordPress URL hell. Though I have to admit that the Generalisation of a "post" into a custom post type is quite clever, the permalink stuff comes with its own constraints. > A word of caution - being new with WP, I may have overlooked something > completely obvious ## [Update] Well, as frustrating as it may be, it seems that this is just impossible. Well there is certainly a solution that involves some tricky URL rewriting but certainly nothing trivial for an approach that is however quite common.   Basically, I believe at this stage, that one should tie to a rather simple URL scheme. Will try the wordpress forum, but I don't have much hope.


How to fix strange 500 Error after Editing Menu?

I have strange situation which just started which I seem to be unable to resolved. I am not sure what this might be related to but I think I remember reading somewhere that this has happened to someone else. Upon logging into WordPress then going into the menu management area, then clicking on "screen options" and enabling the view of a menu metabox for a custom post type that was created and then adding a page from that post type to the menu the menu management area started showing a Internal Server Error 500 message. Every other area of the website and admin area works perfectly except for the menu management link. I have attempted everything I can think of in an effort to resolve the problem including removing every plugin and customization made to my `functions.php` file however I can't get the issue resolved. I was hoping someone here might able to help me resolve this issue or suggest anything to diagnose this issue. Any help is greatly appreciated!


Survey plugin recommendations

What is a good plugin to do surveys for wordpress. I can think of creating a custom contact form 7 - but i was having problem in the formatting and separating it from the body of the post visually. and it doesn't store survey result in some document or spreadsheet, so eventually i'll have to track everything manually. so - i am on the hunt for a survey specific plugin. the questions are simple, i need option buttons, check boxes, text boxes - and like 10 questions max - nothing fancy. Thanks in advance for the help Suggestions other than poll-daddy are welcomed :)


HTML link within my plugin settings page

My plugin has a settings page. It's working fine. Now, i want to put a html link within this page. This link will go to another settings page. How could I do that? Thanks.


Post Thumbnail help

I'm using the post thumbnail feature to show portfolio work, so for example `<?php the_post_thumnail(); ?>` the problem is I want to show a particular width of image only, which is 640 but because my pieces are website they have varying heights. I'm using this code to create the images: `add_image_size( '640', 480 ,true ); // 640x480 image size` but it's specifying the height how can I ONLY specify the width?? Thanks Ps. I know I could use CSS, but I want to actually create images at 640 wide and not use any timthumb stuff etc. Thanks


Use Facebook PHP SDK from WPBook

I'm using the plugin WPBook, I'm wanting to use the Facebook PHP SDK. How can i get access to the facebook Object that WPBook is ising. Do anyone of you know how to access it from WPBook, I know it is a global variable somewhere, how do i load it??


What are the things that will be affected in case there is some wordpress updates or theme updates?

I amm getting into my head what this child theme is. I have just read it on the internet, and wondering if I do really need to study it or no need. I don't know any coding and stuffs. I don't have this child theme, its new to me. Can someone specify what are the things that will be affected in case there are some wordpress updates or theme updates in future? On my websites, I only change certain things like:   * font color   * font sizes   * font faces   * resizing images    * changing texts   * chaging fonts using theme options that comes with the theme   * wordings, images, contents   * sizes of certain stuff 1) Will my sites be affected when time comes that I need to update? 2) What are the things that will be affected in case there is some wordpress update or theme update? 3) Does that mean, if I make changes to the above listed things, the contents inside style.css will also change?


How to change language?

Sorry for this complete newbie question, but I googled it and cannot find this simple information. I just installed Wordpress today. Right now all text on my Wordpress Blog is in English: "Home", "About", "Comments", etc. How can I change the language? * * * Update: I am actually not out of the woods yet with this one. I have:   1. located the fr_FR.mo file and copied it into a new directory '/wp-content/languages/'   2. Modified the wp-config.php file to have the following line into it: > define ('WPLANG', 'fr_FR'); Unfortunately I still get the interface in English. Any help would be much appreciated. * * * Ok, I found the problem: I was adding the line: > define ('WPLANG', 'fr_FR'); when in fact there was _already_ another line of code: > define ('WPLANG', ); which was probably overriding my bit of code. Thank you for your help.


Category names on CPT archive pages

I purchased a theme and I'm trying to customize the "blog archive" pages for the Portfolio CPT that's included with the theme. The theme is: http://www.templatemonster.com/wordpress-themes/38602.html I've created some Portfolio categories and linked to them in the menu. Here's an example: http://billy.slushman.com/portfolio_category/kitchens I want it to say "Kitchens" instead of "Blog Archives". How would I do that?


How to control SSL in Wordpress for automatically changing http to https?

I have a domain and one subdomain. The domain has a installed SSL with valid certificate but the subdoamin doesn't have it. I have a link from domain's wordpress header.php file that pointing main page in subdomain. The link supposed to be as HTTP but it was changed to HTTPS. I edit header.php file but after update the file it changed to HTTPS again. I installed Wordpress HTTPS plugin in domain wordpress. What I have done: The domain wordpress is located in Domain/app which I copy the files and folders to root directory (Public_Html) a by Godaddy technician's suggestion (my domain is from Godaddy). The subdomain wordpress is a clone from the main wordpress. Please let me know how to change this link to HTTP. I appreciate it in advance for your help.


Sticky navigation and the wpadminbar

I have got a site with a sticky header navigation. The problem is that when I am logged in, the `wpadminbar` falls over the navigation. The code of my navigation is:

     ....      As you can see I use Bootstrap. Is there a way to get the `wpadminbar` not to lay over my navigaion?


Programmatically choose a background-color to go with an image?

Is there a function, either in PHP or Wordpress itself, or in a plugin, that will choose a good css background-color to go with a given background-image? For example, if someone chose a very large dark-brown design for a background, it should have background-color of brown so before the image loaded, or if the image failed to load, it would still look ok.


Get next post in category with AJAX?

I need a simple solution to load the next post in the category of the current post (in a custom single.php) with AJAX once the reader scrolls to the bottom of the page. I'm using a custom theme. What's the easiest solution for this (I'm not experienced with wordpress)?


Remove rows in the manage post/page view

I'm looking for a way to remove the rows with the title, date and other stuff that's shown on the manage posts/pages screen (highlighted with red in the image below). I know that I could easily hide it with css, but I'm wondering if it's possible to do it without css and hacking core files. ![Visual description on what I want to remove](http://i.imgur.com/EA18A.jpg)


WordPress & W3C CSS Validation

I've played around with WordPress here and there for a few years and am wondering about problems with CSS validation with WordPress themes. This may seems like a stupid question, but: Is there a reason, relating to WordPress, why it appears no themes I've run across come up error-free in WC3 CSS Validation? I thought of a number of reason this may be happening:   * Those designing many themes not caring whether or not it pass validation   * I'm getting my themes from not so great sources   * There are quirks with WordPress that force designers to "hack" at their CSS Just wondering.


Can't upload images due to permissions error

For some reason when I try to upload an image to my blog I get an error message saying that WP can't create a folder under the relevant directory (wp- content/uploads/2010/09) and it's asking if the folder above it has write permissions. The parent folder indeed has write permissions. I tried creating the folder manually and it still shows the same error message.


Platform/Website that Supports Crowd-Funded WordPress Projects?

There are a couple of plugins that I'd like to have developed however I am poor so I'd love it if there was a platform that allowed me to easily group with others that have the same need and pool our resources to pay a developer. I have seen a lot of freelance developer job boards and bidding platforms but I was wondering if there were any platforms out there that would specifically empower a group of users/designers to pool their money behind a project they like, and allow for developers to bid out the project? The way I would envision it working would be a hybrid between Freelancer.com (or elance.com) and Kickstarter.com. Actually, it would be similar to Area51 on the StackExchange. In case this doesn't exist, I'll elaborate on my idea for anyone that wants to make such a platform... Basically, someone could post a project, take bids, then open it up for crowd funding or before any project is even bid on it could be open to a vote in the sense that people have to commit to at least $5 and once it reaches a certain commitment level it goes out for bids.


List Category Posts - thumbnails

I'm trying to use the List Category Posts Plugin so that I can have different categories of posts show up at the bottom of different pages. I can't seem to get the thumbnails=yes option to work. It does display an image, but not thumbnail size. Does anyone use this and know the answer to this problem? Thanks Betsy S. Franz www.hbca-brevard.org


wp_editor on custom meta textarea field - images and html fails

So I have made some custom textareas on my frontpage template. This works fine and I can safe content and so on... But I am experiencing some issues. When I click "Upload/Insert" I can work with the dialogue - but when I type insert the dialogue closes but no image is inserted into the textarea... The other issue is with the to tabs "visuel" and "HTML". I cant click on the "HTML" tab... nothing happens... I get the following javascript error:               vta is null     anonymous()     anonymous()     onclick()     event = click clientX=1523, clientY=145     qtrans_save(vta.value);      I call the wp_editor with:               wp_editor( $meta, $field['id']);      The field ID's are unique and currently using _ like 'custom_frontpage_textarea3'. I have tried without the _ but that had no effect. Any ideas?


I have a page using a pretty url and a mod_rewrite rule matching it. I expected it to give an error but it's working. Why?

this may seem like a weird question but I have something working and I don't understand how. I have moved my wordpress install to a subdirectory and am using the .htaccess file to redirect anything that is not in another folder A to the blog folder B.               RewriteCond %{REQUEST_URI} !^/A/.*$     RewriteRule .* B/$0  [L]      I am also using the Webphysiology Portfolio plugin and am calling the shortcode for it in a page called Portfolio. The images displayed by the plugin have their path set in the form /portfolio/wp-content/rest-of-url-etc (which is not the actual physical path) and this was causing problems with displaying them in the lightbox which could not find the images. To fix this I added a rule before the other one:               RewriteCond %{REQUEST_URI} ^/portfolio/(.*)$     RewriteRule .* B/%1  [L]      This fixed the lightbox problem as expected but after fixing it I thought it will mess up my portfolio page display which has the path /portfolio/ and hence matches this rule. But it is working. Can anybody please explain why? AS


Add field registration form on Woocommerce

i use Woocommerce with Dokan to create a multivendor shop online. In Dokan, i have this field (add as defoult registration form)               function dokan_seller_reg_form_fields() {         $role = isset( $_POST['role'] ) ? $_POST['role'] : 'customer';         $role_style = ( $role == 'customer' ) ? ' style="display:none"' : '';         ?>         <div class="show_if_seller"<?php echo $role_style; ?>>

                     <?php _e( 'Primo Nome', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="fname" id="first-name" value="<?php if ( ! empty( $_POST['fname'] ) ) echo esc_attr($_POST['fname']); ?>" required="required" />

                     <?php _e( 'Last Name', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="lname" id="last-name" value="<?php if ( ! empty( $_POST['lname'] ) ) echo esc_attr($_POST['lname']); ?>" required="required" />

                     <?php _e( 'Company Name', 'dokan' ); ?> *                     <input type="text" class="input-text form-control" name="cname" id="company-name" value="<?php if ( ! empty( $_POST['cname'] ) ) echo esc_attr($_POST['cname']); ?>" required="required" />

                 <?php _e( 'Shop Name', 'dokan' ); ?> *                 <input type="text" class="input-text form-control" name="shopname" id="company-name" value="<?php if ( ! empty( $_POST['shopname'] ) ) echo esc_attr($_POST['shopname']); ?>" required="required" />

                 <?php _e( 'Shop URL', 'dokan' ); ?> *                                  <input type="text" class="input-text form-control" name="shopurl" id="seller-url" value="<?php if ( ! empty( $_POST['shopurl'] ) ) echo esc_attr($_POST['shopurl']); ?>" required="required" />                 <?php echo home_url(); ?>/store/

                 <?php _e( 'Address', 'dokan' ); ?>*                 <textarea type="text" id="seller-address" name="address" class="form-control input" required="required"><?php if ( ! empty( $_POST['address'] ) ) echo esc_textarea($_POST['address']); ?></textarea>

                 <?php _e( 'Business Phone', 'dokan' ); ?>*                 <input type="text" class="input-text form-control" name="phone" id="shop-phone" value="<?php if ( ! empty( $_POST['phone'] ) ) echo esc_attr($_POST['phone']); ?>" required="required" />

                 <?php _e( 'Phone', 'dokan' ); ?>*                 <input type="text" class="input-text form-control" name="phone" id="shop-phone" value="<?php if ( ! empty( $_POST['phone'] ) ) echo esc_attr($_POST['phone']); ?>" required="required" />

                              <input type="radio" name="role" value="customer"<?php checked( $role, 'customer' ); ?>>                 <?php _e( 'I am a customer', 'dokan' ); ?>                                                <input type="radio" name="role" value="seller"<?php checked( $role, 'seller' ); ?>>                 <?php _e( 'I am a seller', 'dokan' ); ?>
         <?php     }          add_action( 'register_form', 'dokan_seller_reg_form_fields' );          function dokan_seller_not_enabled_notice() {         ?>
                 <?php _e( 'Error!', 'dokan' ); ?>                 <?php _e( 'Your account is not enabled for selling, please contact the admin', 'dokan' ); ?>
       I like to add more field. I have not problem to create a field and show on front-end but how can i save on database and show on user area on backend? I try to add this at the end but not function                 add_action('user_register', 'dokan_seller_reg_form_fields');         function myplugin_user_register ($user_id) {             if ( isset( $_POST['cname'] ) )                 update_user_meta($user_id, 'cname', $_POST['cname']);         }          add_action('show_user_profile','show_the_new_meta_values'); // hook utilizzato quando un utente sta visualizzando il suo profilo     add_action('edit_user_profile','show_the_new_meta_values'); // hook utilizzato quando un utente sta visualizzando il profilo di un altro utente           function show_the_new_meta_values($user)      {              $hobby= get_user_meta($user->ID,'cname', true);         ?>
<?php _e('Informazioni aggiuntive','registrazione-utenti')?>

             <?php _e('Hobby principale','registrazione-utenti') ?>	             <input type="text" name="cname" id="company-name" value="<?php echo esc_attr($cname); ?>" class="regular-text" />

         <?php      }


Wordpress and Windows Live Writer

I've just been trying windows live writer with my WordPress blog. When I upload my posts from WLW to WordPress and then check them in the WordPress editor, they are a hideous mess of tags etc that describe the formatting (e.g. `<P>` and no line spacing etc), but aren't visible when I create and edit in the WordPress editor. Is there a way to avoid this as it makes the WordPress editor very hard to use if I need to make edits outside of WLW. Or do people using WLW just give up on using the WordPress editor. I have to say I find the mess very offputting!


Show selected value in a drop down menu

I have a multisite setup and I am adding some additional information fields in the profile edit screen in my theme's dashboard. I am primarily using text fields however I have a drop down selection menu for the author's country               <select name="country" class="mid2" id="country"  value="<?php echo $userdata->country ?>" style="width:150px;">      My problem is that if a user selects "Togo" for example it registers the change (I know this because it echoes it in the author's bio page) but the default value in the drop down menu (In this case the United States) always stays the same. Any ideas on how I can have it display whichever country the author has selected?


Adding a jQuery modal dialog to the admin area

I am writing a plugin for a customer and I need to use lightbox/thickbox/fancybox/etc in my admin piece. No matter what jquery plugin I use, and I'm using wp_enqueue_style and wp_enqueue_script, nothing seems to work. No errors or anything. I click a link to open a hidden DIV, and nothing happens. Anyone have an alternative or a solution? Thanks.


How to output the taxonomy term name in a widget

I have a taxonomy for example "country" and I want to simply display the term in the side bar eg. New Zealand. There is only one possible taxonomy per post so I don't need to create a list or anything. Any ideas?


Integrate Mailchimp to a Contact Form 7 contact form

Is there an elegant way (without hacking the plugin's code) to integrate a Contact Form 7 contact form to Mailchimp, so I can have a checkbox that when selected would register the email to a Mailchimp list? Thank you


301 Redirects for Changed Permalink Structure & Category Base

I'm redeveloping a site on a fresh WP install. The old site had the following permalink structure: domain.com/CATEGORY/POSTNAME/ The new site has the following permalink structure: domain.com/YEAR/MONTH/POSTNAME/ I need to set up a 301 redirect in htaccess that correctly redirects the old posts. I've found a lot of rewrite rules for the opposite way (YEAR/MONTH/POSTNAME/ to CATEGORY/POSTNAME/) but none for the way I need. I prefer not to use a plugin. It appears that all the redirection plugins don't work. But, if Dean's Permalink Migration is recommended I'll use it.


Customise particular RSS permalink

From my old static website, I want to preserve some URLs like the RSS Feed one. My feed URL is http://traduction.bainslesbains.com/actualite-russe.xml and I want to redirect it to the category feed URL **WITHOUT** 301 redirect. So I tried it via .htaccess file first, what is not working. Then I tried via internal Wordpress URL rewrite system. So first I did this:               // Rewrite actulaite-russe.xml     function feed_dir_rewrite( $wp_rewrite ) {         $feed_rules = array(             'actualite-russe.xml' => 'index.php?cat=8&feed=rss2',             'actualite-russe.rdf' => 'index.php?cat=8&feed=rdf' . $wp_rewrite->preg_index(1)         );              $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;         return $wp_rewrite->rules;     }          // Hook in.     add_filter( 'generate_rewrite_rules', 'feed_dir_rewrite' );      That give me a 301 redirect from               mysite.com/actualite-russe.xml to mysite.com/actualite-russe.xml/feed/ I don't want any 301 redirect I want just been delivered my feed without redirect. So I tried this:               add_action('init','feed_dir_rewrite');     function feed_dir_rewrite(){             add_rewrite_rule('actualite-russe.xml','index.php?cat=8&feed=rss2','top');     }      That gives me exactly the same result as the previous code. So how can I disable the 301 redirect for these functions?


Wordpress redirecting connections on port 8080 to 80

I have a wordpress blog which is served by apache2(on port 80) and nginx(on port 8080) on Ubuntu 12.04. Now whenever a client connects via port 80 all is hunky dory, but when a client connects to 8080 to view the same blog, the connection is redirected to apache. Why is this happening? I searched around and found that this is a Wordpress limitation that it redirects all connections to the Site URL set in the dashboard(which is port 80 by default). Is there a way around this? that the connections to port 8080 would be served by nginx rather than apache Contents of /etc/nginx/sites-enabled/wordpress               server {     listen   8080;          root /var/www;     index index.php index.html index.htm;          server_name abc.com;          location / {             try_files $uri $uri/ /index.php?q=$uri&$args;     }          location /doc/ {             alias /usr/share/doc/;             autoindex on;             allow 127.0.0.1;             deny all;     }          error_page 404 /404.html;          error_page 500 502 503 504 /50x.html;     location = /50x.html {             root /usr/share/nginx/www;     }          location ~ \.php$ {                  try_files $uri =404;             fastcgi_pass unix:/var/run/php5-fpm.sock;             fastcgi_index index.php;             include fastcgi_params;             fastcgi_param   SERVER_PORT 8080;             port_in_redirect off;     }      Any help is appreciated.


Trying to set a cookie based on $_POST parameter

I'm doing a bit of language detection that first checks the `$_SERVER['HTTP_ACCEPT_LANGUAGE']`. If the user wants to override the choice of language, there's a select list, where they can choose whatever language they prefer. SO: I need to check first if the `$_POST` superglobal contains a value from the select list. If it does I want to set a cookie. If there's no `$_POST` value set then I check for a cookie and if there's no cookie I'll go ahead and use the `$_SERVER['HTTP_ACCEPT_LANGUAGE']` as the default language. The code looks like this:               function rps_set_language_preferences() {            global $language;            if( isset( $_POST['sprak'] ) ) {              $possible_langs = array( 'en', 'de', 'ko' );              $my_cookie = $_POST['sprak'];              if( in_array( $my_cookie, $possible_langs ) ) {                setcookie( 'sprak', $my_cookie, time() + 60*60*24*365, COOKIEPATH, COOKIE_DOMAIN );                $language = $my_cookie;              }            } else {              if( isset( $_COOKIE['sprak'] ) ) {                $language = $_COOKIE['sprak'];              } else {                /* This function checks the $_SERVER['HTTP_ACCEPT_LANGUAGE'] */           $language = rps_detectlanguage();              }            }          }     add_action( 'wp', 'rps_set_language_preferences' );      But... It doesn't work! If I try to set a cookie by hooking into `'wp'` I need to refresh my screen twice before the cookie appears. I guess it's not being set in time, but I don't know how to make sure that it will be! Any advice?


How to display some of images from media library?

i try to create a simple theme. I want display several images from media library(same concept of gallery), but i don't want use POST or PAGE, just directly from media library. (of course not use wordpress gallery function too) is that possible or it's wrong way to do it? the reason is there are several hundreds of images in library, if every image need put in a POST or a page, it's a big job. but it looks hard to manage all these images without POST or PAGE. Thanks


Plugin Development/ Stop CSS clashes.

I have searched all over and I am a little confused about my first plugin that I am developing. I created a shortcode that the user can use on any page they create. The issue is that on a lot of themes the plugin gets pushed out of container width. I think that most templates are 960px wide, and my plugin is 800px wide (I am not looking for advise on developing with em, percentages, etc. this is a fixed sized plugin). How can I stop css clashes? I want the container width to be 960px wide. There must be some default id's and classes that I can overwrite in my css. I would imagine themes use standard naming conventions in order to allow users to switch at anytime. EDIT: I would also like to remove any sidebar() that is showing on the page...help!? Anyway, does anyone have advice on this? thanks!


display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however I'm wondering how I can arrange them to appear in two columns - 10 on the left, and 10 on the right in alphabetical order. Here's what I'm using: functions.php               <?php     function top_tags() {             $tags = get_tags();             if (empty($tags))                     return;             $counts = $tag_links = array();             foreach ( (array) $tags as $tag ) {                     $counts[$tag->name] = $tag->count;                     $tag_links[$tag->name] = get_tag_link( $tag->term_id );             }             asort($counts);             $counts = array_reverse( $counts, true );             $i = 0;             foreach ( $counts as $tag => $count ) {                     $i++;                     $tag_link = clean_url($tag_links[$tag]);                     $tag = str_replace(' ', ' ', wp_specialchars( $tag ));                     if($i < 11){                             print "
$tag ($count)
";                     }             }     }     ?>      sidebar-r.php
#HASHTAG
             <? $tags = top_tags();             $tags_count = count($tags);             $number = ceil($tags_count / 2);             $args = array('number' => $number);             $tagsleft = get_tags($args);             $args = array('number' => $number, 'offset' => $number);             $tagsright = get_tags($args);                  $html = '
';                 foreach ($tagsleft as $tag){                     $tag_link = get_tag_link($tag->term_id);                          $html .= "
name} Tag' class='{$tag->slug}'>";                     $html .= "{$tag->name}
";                 }                 $html .= '
';                      $html .= '
';                 foreach ($tagsright as $tag){                     $tag_link = get_tag_link($tag->term_id);                          $html .= "
name} Tag' class='{$tag->slug}'>";                     $html .= "{$tag->name}
";                 }                 $html .= '
';                 echo $html;             ?>


Site Title and Tagline in Theme Options Page

I'm using the _Options Framework Theme_ to put together an options page. The user(s) I'm building this for would like to be able to edit a few settings directly from this page, including of which - the _Site Title_ and _Tagline_. **Concept:** ![enter image description here](http://i.stack.imgur.com/Eq5i9.png) **Options.php:**               $options[] = array(         'name' => __('Site Title', 'options_framework_theme'),         'desc' => __('The name of your site.', 'options_framework_theme'),         'id' => 'title',         'std' => 'PHP CODE FOR SITE TITLE HERE ...',         'class' => 'medium',         'type' => 'text');      Is there a way to do this (add their own _Site Title_ and _Taglines_ ) within a text-field for example, click the Save Options button to output it to the front-end of the site and display an updated version in the WP API Settings > General Settings sub-menu page?


WordPress Internal @ Mentions

I'm looking for a way to link to author pages within one WordPress install simply by putting the @ symbol in front of a person's username in a post.... just like on twitter. Example: If the username is "Bill256" and I write "@Bill256" it will be linked to his author page.


Using Facebook Og Meta Tags in loop

On my index page, I have added a facebook share link to the individual posts. I want the sharer to uses the data from the post with the og meta tags. Can I add the OG Meta Tag into the post loop, within a php maybe, to get them to work? Any help would be greatly appreciated! Facebook OG Meta Tag:               <!-- for Facebook -->               <meta property="og:title" content="<?php the_title(); ?>" />     <meta property="og:type" content="article" />     <meta property="og:image" content="img/default.jpg" />     <meta property="og:url" content="<?php the_permalink(); ?>" />     <meta property="og:description" content="<?php $bloginfo = get_bloginfo( $description, $filter ); ?>" />


more tag in the $post->content when get_pages were used

I used get_pages() to get the content of the child pages of a page. Although the excerpt can also be an answer but is there any other way to display the contents of the page before the more tag when I use the get_pages()?


Sorting Custom Posts on Archive page with pagination

I've got custom taxonomy archive pages with a drop down list that allows users to re-order/sort the posts. It basically waits for the user to select from the drop down then uses `array_merge( $wp_query->query.....` to create a new query and re-sort the posts. This works fine. I also use wp-pagination to display numbered pagination. This also works fine. The problem is, when a user re-sorts the list, and then clicks on the pagination to go to page 2 the new sort is lost and reverts back to the original. I can't work this out. Any ideas?


How to build new WP_Query using url

How to build a WP_Query using a url in **wp_ajax_nopriv** action. I have a following url for example: "http://example.com?paged=2 so I need to build a WP_Query which will retrieve a second page of posts. I was able to do it if I were using regular URLs like the one before, but when I switch to Pretty Permalink (http://example.com/page/2) - it does not see the page argument and always returns first page.


Send email from Wordpress

What's the best way to send a email from Wordpress after a certain action. I'm working on a site where users can submit ideas and then other users can comment on them. I would like to send emails to a number of different addresses (moderators) when a post is made and when a comment is made. I have this code to add the posts with an attempt to send an email that doesn't work.

Submit idea
              <?php              if(isset($_POST['new_post']) == '1'){                  $post_title = $_POST['post_title'];             $post_content = $_POST['content'];                  $new_post = array(                 'ID' => '',                 'post-author' => $user->ID,                 'post_title' => $post_title,                 'post_content' => $post_content,                 'post_status' => 'publish'                 );                  $post_id = wp_insert_post($new_post);             $post = get_post($post_id);             wp_redirect($post->guid);             exit;                  // send email notifications                       wp_mail( 'test@ttmt.org.uk', 'New Idea', $post_content);         }              echo '<form method="post" action="" >';         echo 'Idea Title';         echo '<input type="text" name="post_title" class="title">';              $settings = array(             'quicktags' => false,             'textarea_name' => 'content',             'media_buttons' => true,             'textarea_rows' => 12,             'tinymce' => array(                 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .                 'bullist,blockquote,|,justifyleft,justifycenter' .                 ',justifyright,justifyfull,|,link,unlink,|' .                 ',spellchecker'                 )             );         wp_editor( '', 'content', $settings );              echo '<input type="hidden" name="new_post" value="1">';         echo '<input type="submit" class="submit" value="Submit Idea">';         ?>


local wordpress blog issues

i have recently started a local blog, installed wordpress 3.5 correctly, even posted on it, when i view it on my machine using the IP or localhost, i see the entire pages correctly, but when i view it on any other machine, the view is plain HTML, no CSS, no JS, just plain old HTML i have tried setting up the permissions, also i am using xubuntu 12.04 and have installed LAMP stack properly, there are no issues with it, as it is obvious because the site works properly on my localhost


set_post_thumbnail_size not cropping featured images

I'm developing a theme and while working on the featured images area I've noticed they aren't cropping even though I've set them to crop through set_post_thumbnail_size function.               /* Featured Image Thumbnails */     add_theme_support( 'post-thumbnails' );     set_post_thumbnail_size( 460, 250, true);      Using xampp, phpinfo says GD is supported. I've cleared the thumbnails and regenerated them to no avail. The div that the featured image is in is also set to 460, 250. The image just scales down to 460 wide by whatever heigh and constrains its proportions. An imag showing the output: http://i.imgur.com/cDXkS49.png


Getting rewrite correct

I had the permalinks settings as `/%postname%/%post_id%/` but recently change it to `/%postname%/` and added the following to htaccess               RedirectMatch 301 ^/([^/]+)/(\d+)/$ http://www.site.com/$1/      It works for posts and tags/cat/cpts but I have problem with home page navigation where it forwards the urls like: > http://www.site.com/page/2/ /3/ ... etc to a custom page that I have with slug page if I remove it... it takes to another post which has page in slug and finally removing all I am getting 404 error. So how do I just use the above 301 redirect with posts and not navigation.


Auto Stock Update after Order cancel from Admin of Woocommerce?

I recently implemented Woocommerce and in trial session I found following issue: **1.** Initially, I provide 10qty for Product1. **2.** place a Dummy Order from front-end of 10qty of that Product1. **3.** Then After that I see Product1 is Out of Stock. **4.** From Admin of woocommerce, If I cancelled that dummy order or reduce the product qty on that order, It Doesn't Update the Stock Qty of that product1. And I still see the Out of stock label on that product even after that order has been cancelled which reserved this qty. Hence is their any way to Auto-Manage this Stock Updates between orders and Inventory.


wp_insert_post() or similar for custom post type

Need to insert custom post type objects from code. Haven't been able to add using the default method               $id = wp_insert_post(array('post_title'=>'random', 'post_type'=>'custom_post'));      creates a regular post instead.


Uploading flash flipbook to mu wordpress site

I have to upload a flash flipbook (swf file) on my wordpress site. The problem is that the flipbook generated has two subfolders along with the book.swf.. So what I need to uplaod to media is   * book.swf    * framework.swf   * js      * some files   * img      * page00     * page01     * page...     * page205 I tried the AddFromServer plugin but nothing works for subfolders. Any ideas ?


Title and post URL based on custom fields?

I have custom fields in my custom post type. They should serve as a title and post slug for URL. Basically, whenever I change the content of the custom fields, the title field should react accordingly. E.g. if the field NAME contains 'John' and the SURNAME 'Smith', the title should transform to 'John Smith'. The users of the site will be unexperienced so they won't understand the need of putting NAME and SURNAME and a separate title for that - that's why I need it. I know I can display custom field content instead of a title in my template, but that's not the same. I also need the permalink to be amended accordingly. So, to recap My input: custom field NAME = John custom field SURNAME = Smith What should happen: post title = John Smith permalink = john-smith (I presume it will process the title extracted from the custom fields as it would normally do) I hope it's clear now. Thanks indeed for any suggestions.


Use created page as search results page and custom template

I want my client to have control over the look of the Search Results page by being able to select one of the templates I have created for them (page-two- column.php or page-three-column.php) so they can change elements like banner images etc. So I have created a new page in the WP Dashboard called Search-Results which returns the following mysite.com/search-results/ By default WordPress creates a URL like this mysite.com/?s=product Having looked through a number of examples and in the codex, I have come across this snippet of code I thought would do what I need it to do.               // Use the two column template as the search result.     add_action('template_include', 'new_search_tmpl');     function new_search_tmpl( $template ) {       if ( is_search() ) {          $t = locate_template('page-two-column.php', false);          if ( ! empty($t) ) $template = $t;       }       return $template;     }      Then, in the page-two-column.php I am checking to see if we're requesting search results like this...                    <?php if (is_search()): ?>         <a href="<?php echo get_permalink(); ?>"><?php the_title();  ?>     <?php else: ?>

<?php _e( "It looks like we couldn't find what you were looking for!", 'bonestheme' ); ?>

<?php _e( 'Try a different search.', 'bonestheme' ); ?>

<?php // _e( 'This is the error message in the page.php template.', 'bonestheme' ); ?>

     <?php endif ?>      Which comes from the original search.php page I am wanting to override. * * * **EDIT** Further testing shows that is does actually use the two-col template which is great, however, I still need it to pull the banner image from the search-results page I am creating. I have now been able to pull the search-results Featured Image into the search page with the following code:               <?php if (is_search()) {        echo get_the_post_thumbnail( '1711', '1920' );     }?>


Is it possible to install multi different versions of Wordpress on one domain and its addon domain?

Here's the story. I designed a wordpress site for a client that is running on Wordpress 3.9. It is for an event that his company is organizing and it it will be hosted on www.hisdomain/addon. However, his staff has informed me that it cannot be installed because his comapny's website (www.hisdomain.com) is also running wordpress but an older version Wordpress 3.4. Hence I'm told that it is impossible to install two different versions (one of main domain and one on subdomain) of wordpress on one server and will have to retest my site on 3.4.1 instead? So, is there any way to install two different versions of wordpress on one domain? Will it cause any conflicts? Many thanks for any advice that you guys might have.


Get email address of type Administrator

I am new wordpress, please help me. How can I get all the details of type Administrator. I have created 2 users with Role as Administrator, like `get_option( 'admin_email' );`. I want the Email address of users of type Administrator.


Duplicate WP3.0 menu php files?

He's my problem: I want to have a single page that a WP-admin can build by including different parts of the site by choosing posts. (I know the admin could add these posts to a category and then display the the category page but there are some issue around user roles etc - I am exploring this option too though) One idea is that the WP3.0 menu actually contains much of the functionality I need; elegant interface for selecting any post/page from the site and the ability to reorder these items. Is there anyway of replicating the core WP menu php files, warping it up in a plug in, and making some layout and label changes, and running this plugin along side the standard menu system? Any advice, suggestions or problems I might encounter? many thanks, Paul.


Display post category in foreach loop

I am trying to display post category in a foreach loop. I have all the elements displaying properly except for the category. Here is my function:               function my_get_display_author_posts() {     global $authordata, $post;          $authors_posts = get_posts( array( 'author' => $authordata->ID,'posts_per_page' => 6, 'post__not_in' => array( $post->ID ) ) );          $output = '
';     foreach ( $authors_posts as $authors_post ) {         $image = wp_get_attachment_image_src( get_post_thumbnail_id( $authors_post->ID ), 'related-author' );         $output .= '
         ID ) . '">         ' . apply_filters( 'the_title', $authors_post->post_title, $authors_post->ID ) . '                            '.get_the_time('m.d.y').''.the_category('', '', $authors_post->ID).'
';     }     $output .= '
';          return $output;}      Follow the following link to see the current output. https://www.evernote.com/shard/s250/sh/0e3c6bf9-5676-4d56-acdf- ee6f53285acf/fa43094ca54f018c0e517b4e678d4231 How can I wrap the_category function under html output?


How to get user id which is done by buddypress

I have integrated buddypress in my wordpress theme. i need to get user id when buddypress completes user registration successfully like what we usually do wp_insert_user( $userdata ) which returns user id when user information is successfully inserted..so how do i get user id? its urgent..pleas help. Thanks in advance.


Shortcodes that are created based on user input information

I am creating a plugin that users can create forms with. Then the user will be able to input a shortcode to display this form. The shortcode will be the form name, which is stored as a `meta_value` in the `wp_postmeta` table. When the user uses a shortcode, how do I refer back to the form name & display the form? When the user creates a form, should I automatically create a shortcode in the same script? How would you approach it?


Order get_users() by last login date. Is it possible?

I want to create a page that displays all the blog users ordered by the last login date. I've tried with the get_users() function and I can succesfully get the users' list, but not in the order I want:               $query = get_users('&offset='.$offset.'&orderby=login&order=DESC&number='.$number);       I think that the orderby=login is not what I'm looking for... Is there any other way to accomplish this?


Problem after upgrade to 3.6.1

Really wishing there was a role-back feature installed. I upgraded last night, now when I open the dashboard one of the javascript modules is causing an infinite loop by including the 'Welcome to Wordpress' screen into the 'Wordpress Blog' widget. Is there an easy way to role-back without data loss? Update: The problem stems from one of the plugins. None of the deactivate links worked so renamed each directory then re-enabled them one by one. The problem has gone but I can't risk this happening again on the live site. Currently I don't know which plugin caused the problem, but I have an inkling. What could cause the problem I experienced and what should I be looking for in the source? Also, Can't find a relevant tag for this question.


How to update billing_email when user_email is updated

I'm trying to achieve two way synchronization between `user_email` and `billing_email` (the key for woocommerce emails). So far, I have it working that when a customer edits/updates their billing email address their `user_email` gets updated with the following code:               add_action( 'woocommerce_customer_save_address','isa_customer_save_address', 10, 1);          function isa_customer_save_address() {          global $woocommerce;     $user_id = get_current_user_id();                  wp_update_user( array ( 'ID' => $user_id, 'user_email' =>    $_POST['billing_email'] ) ) ;          }      Now how do I update a customer's `billing_email` when they edit/updates their `user_email`?


How to align bold,italic and underline in wp-admin?

When Im in wp-admin and editing a page and whant to make underline, bold and italic it dont appear on the site. I understand therese something i have to define in the css or thru wp-admin ? NOTE: I want the user to easly edit and i know how to do it thru css. But what I want is to edit thru the edit-page.


Send email to user that his post has been rejected

I am searching for a solution for the following problem: I am using WP User Frontend, so that users can create posts in the frontend. After saving, the admin needs to review the post, and the publish (if approved), or reject (if not approved). If the post is approved, an email is automatically sent to the user, that his post has been approved (this I already found out how to do). But if the admin does not approve, how to send the user an email, with a possible custom text (why he did not approve) from the backend, per click on a button?


wp_unique_post_slug is not unique

I understand that the `post` post_type is not the same as `page` but when editing the permalink for a new post to be the same as the slug for an existing page, it's accepted. I now have a post and a page both with `wordpress/sample-page` set as the permalink. The link opens that of the page, I guess pages are looked for first. Surely this can't be normal behaviour. This is on 6.3.1 and 6.3 if anybody cares to test. Is this a bug in the core?


How to add .html to the end of the permalink

How do I add .html to the end of the permalink? I tried changing the permalink structure to `/%postname%.html` but this did not work.


How to update plugins with database updates if I use svn

I have my own SVN repository that has everything checked in from root of the htdocs directory. The repository includes (I do have some ignores set):   * Wordpress Core   * Plugins   * Themes My process is:   * update my repository on a development site first to test   * commit the changes   * svn up the production site My question is:   * If a plugin installed has database updates attached to the newer version how are those updates applied in my production instance? I do know that Wordpress core has checks in place to see if the db is updated to the newest version, but I'm unable to find the same information out regarding plugins.


How we make the filter for fornt end user

I develope a filter for posts so that when any user come to my site they can filter the posts on the base of `cities/state`. So when i store the posts i just store the cities name as a `post-meta` tag in the site. The code i am using for adding the `post-meta` tag is               add_post_meta($post_id, 'post_state' , $state, true);      The html which generating the names of the cities in the form of checkbox is here               for(x in state_arr){         jQuery('#state_div').append('<label><input type="checkbox" name="stateName['+ state_arr[x] +']" id="" value="'+ state_arr[x] +'" >' + state_arr[x] + '</label');     }      So i pass the name as `array`. And the code i am using for filter is here               <?php     if ( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'sortbydestination' ) :     $stateName = $_POST['stateName'];     foreach($stateName as $key => $stN)      {        $citynames = $stN . ",";      }     unset($_POST);     endif;          ?>      And the argument which i pass to the query is look like this               $args = array(                 'posts_per_page' => 30,                 'paged' => $paged,                  'post_type' => 'post',                  'post_status' => 'publish',                 'meta_query' => array(                                 'key' => 'post_state',                                 'value' => array($citynames )                                      )                  );      I want to know one thing. Here i in query the `value` need one value but i have to pass multiple valuse to compare and find the result so how can i do that.


Photos do not show on SEO platform built into a wordpress plugin

I’m building an SEO application. I built a plugin from the folder with the application. So, the folder is called `body_call` and inside has the `body.php`, the `index.php` (in which I placed the plugin “header copyright”) and other functions like forms and so on. In this folder (`body_call`) I also have the image folder that has the images, the css folder that has the `style.css` and the js folder. So, I made the function to be called from the new plugin `platform ()` and I called it from a template that I made called keywords (since the platform is about SEO keywords). The images do not show! And the `style.css` is not accessible, but the content from the body is more or less there (its scramble). I used the path for the images like this: `images/image.jpg` and the style sheet is called the same way: `css/style.css`. All this inside the `body_call` folder (parent folder / plugin folder). Another problem is the plugin shows on `localhost/keywords` but when I click on a link it goes to `localhost/keywords/index.php` and gives a page not found