title: How to make a WP admin button/menu similar to Jetpack Notifications?

text: I would like to add a button to the WP admin toolbar, similar to the Notifications feature released in Jetpack 1.9.1 (I think it was). The notifications icon is displayed beside the account button, to the right. I am only looking to display a form in the dropdown, for clients to contact me if they have questions - using AJAX for sending. This question only concerns the toolbar and getting the button and submenu dropdown in place. **UPDATE** : Here is a screenshot (as requested): I just want to replace this with a form and no additional sublevel menus ![Jetpack notifications](http://i.stack.imgur.com/GvoQe.png)


title: Removing hierarchical pages in the permalink

text: I have several pages set up in a hierarchy on my site. Currently the site's pages and URLs look like this.               Page name        | Current URL           | Preferred URL      -----------------|----------------------------------------     Page AAA         | /pageAAA/             | /pageAAA/     |-- Page BBB     | /pageAAA/pageBBB/     | /pageBBB/     Page CCC         | /pageCCC/             | /pageCCC/     Page DDD         | /pageDDD/             | /pageDDD/     |-- Page EEE     | /pageDDD/pageEEE/     | /pageEEE/      I would like to strip the page hierarchy from the URL and just use the page name instead. Currently this is not a problem for the "POSTS" as I have set the "Permalink" to `/%postname%/` **Edit:** The reason that I want to do this is; I am importing a existing site into wordpress. The Existing site has a hierarchy for the pages (menu) but a flat url structure. I do not know if this has any added benefit for SEO but I want to keep the URL structure the same as the old site


title: Redirect page for a custom post type

text: I have the following custom post type                       register_post_type('cp_clients', array(                 'labels' => array(                     'name' => __('Clients'),                     'singular_name' => __('Client')                 ),                 'public' => true,                 'has_archive' => true,                 'supports' => array('thumbnail', 'title', 'editor')                     )             );      I want to output custom content when the user calls http://blogurl.com/companies. It's a plug-in and not a theme. Any ideas how I can redirect to a custom page/output for this URL?


title: force enqueue script to be first in order of prominence

text: I have a few scripts which are being enqueued, the problem is that I want to force the order of prominece to which these scripts are loaded. There is one in particular which is loaded from a plugin before the theme ones which requires jquery however the plugin does not require jquery (bad dev on the plugin but I'd rather not touch 3rd party code for futureproofing reasons) is there some way to mess with the enqueue order at runtime? Thanks very much


title: Can I load posts via Ajax?

text: I would like to make a portfolio page where each entry (a post) would be fetched using Ajax. This way I would have an image gallery, but in which I not only would have images but also the description of the work, if it's for sale, the url to the shop, and whatever other random fields. A gallery is not good enough because there is no clean way of displaying text belonging to each image's post.


title: how to get the categories for a single post in a hierarchical way

text: The question is simple.   Imagine that I have a post named 'Single Post' which is inside the category 'sub-cat' which is a child of 'parent-cat' which is a child of 'super-cat'. What I need to do is to display all the related categories within the post page in the following order:               super-cat > parent-cat > sub-cat > Single Post


title: Disable All In One SEO Pack for some custom post types

text: I have a Wordpress site using custom post types, and I have also got the All In One SEO pack installed. I wondered if anyone knows a hack or a modification I can make to the code which will allow me to stop the pictured area from showing up on certain custom post types? ![enter image description here](http://i.stack.imgur.com/QW0On.png) Any help much appreciated.


title: Restrict access and display for categories

text: Is it possible to choose specific categories that will only be displayed to logged in members? I tried to find a plugin or a PHP solution that does that but could not find anything that was still relevant.


title: Viewing category pages without the word 'category' in URL

text: 1. When I view a static page its url is like: `http://example.com/mybooks/`   2. When I view a category page its url is like: `http://example.com/category/books-ebooks/` For SEO, I want some modification so that I do not have to use the word `category` to view category pages. e.g. it should be `http://example.com/books-ebooks/` instead of `http://example.com/category/books-ebooks/`   * How can this be done?    * I see a potential problem that WordPress engine may not be able to differentiate between pages and categories. Is it so?   * What are other pros and cons?


title: Enhancin 404 to contain a search from URL

text: I have migrated to WordPress from other (probably unknown to you) free blogging site (bloguje.cz if you are curious) The issue is, that previous system had sometimes URL ending with ".php" and sometimes not. So external links to my page can look both ways:                http://www.tasselhof.com/123456-example-page.php      http://www.tasselhof.com/654321-another-example      I decided that on Wordpress, **all** my pages will have custom URL containing ".php" at the end. And now I am facing the fact, that _some_ users can _sometimes_ receive "404" page when going to my site from the "another example" link. So i would like to "tweak" my 404 page to contain all the words from URL in search result and search for it. So it would contain "another example" as searched item. I am using WordPress installation downloaded from czech community page - (everything translated into Czech) and default theme - Twenty Eleven 1.2


title: Problem with wp_insert_post

text: i'm sorry for my english. I have a problem with the function wp_insert_post in a script. I'm trying to create a new post when i receive a notification from paypal. Everything works fine untill i try to create a new post in the database. This is my code:               <?php include_once($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');                           // Send an email announcing "received IPN"                 $mail_From = "xxxxxx@gmail.com";                 $mail_To = "xxxxxx@gmail.com";                 $mail_Subject = "received IPN";                 $mail_Body = $req;                 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);          ?>     <?php          // STEP 1: read POST data          // Reading POSTed data directly from $_POST causes serialization issues with array data in the POST.     // Instead, read raw POST data from the input stream.      $raw_post_data = file_get_contents('php://input');     $raw_post_array = explode('&', $raw_post_data);     $myPost = array();     foreach ($raw_post_array as $keyval) {       $keyval = explode ('=', $keyval);       if (count($keyval) == 2)          $myPost[$keyval[0]] = urldecode($keyval[1]);     }     // read the IPN message sent from PayPal and prepend 'cmd=_notify-validate'     $req = 'cmd=_notify-validate';     if(function_exists('get_magic_quotes_gpc')) {        $get_magic_quotes_exists = true;     }      foreach ($myPost as $key => $value) {                if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {              $value = urlencode(stripslashes($value));         } else {             $value = urlencode($value);        }        $req .= "&$key=$value";     }               // STEP 2: POST IPN data back to PayPal to validate          $ch = curl_init('https://www.paypal.com/cgi-bin/webscr');     curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);     curl_setopt($ch, CURLOPT_POST, 1);     curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);     curl_setopt($ch, CURLOPT_POSTFIELDS, $req);     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);     curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));          // In wamp-like environments that do not come bundled with root authority certificates,     // please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set      // the directory path of the certificate as shown below:     // curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');     if( !($res = curl_exec($ch)) ) {         // error_log("Got " . curl_error($ch) . " when processing IPN data");         curl_close($ch);         exit;     }     curl_close($ch);          // STEP 3: Inspect IPN validation result and act accordingly          if (strcmp ($res, "VERIFIED") == 0) {                           // Send an email announcing "enter in verified IF"                 $mail_From = "xxxxxxx@gmail.com";                 $mail_To = "xxxxxxx@gmail.com";                 $mail_Subject = "enter in verified IF";                 $mail_Body = $req;                 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);              // You should validate against these values.                 $donCause       = $_POST['item_number'];                 $txnID          = $_POST['txn_id'];                 $firstName      = $_POST['first_name'];                 $lastName       = $_POST['last_name'];                 $addressCountry = $_POST['address_country'];                 $addressCity    = $_POST['address_city'];                 $addressStreet  = $_POST['address_street'];                 $addressZip     = $_POST['address_zip'];                 $payerEmail     = $_POST['payer_email'];                 $payment_gross  = $_POST['mc_gross'];                 $payment_status = $_POST['payment_status'];                      if ($payment_status == 'Completed') {                          // Send an email announcing "enter in payment_status==completed"                     $mail_From = "xxxxxx@gmail.com";                     $mail_To = "xxxxxx@gmail.com";                     $mail_Subject = "enter in payment_status==completed";                     $mail_Body = $req;                     mail($mail_To, $mail_Subject, $mail_Body, $mail_From);                          // Create post object                     $my_post = array(                         'post_title'    => $txnID,                         'post_status'   => 'publish',                         'post_author'   => 1,                         'comment_status' => 'closed',                         'ping_status' => 'closed',                         'post_type'      => 'post_pledges',                     );                     $post_id = wp_insert_post( $my_post, true );                          // Send an email announcing "after post_pledges creation"                     $mail_From = "ragazzin@gmail.com";                     $mail_To = "ragazzin@gmail.com";                     $mail_Subject = "after post_pledges creation";                     $mail_Body = $post_id;                     mail($mail_To, $mail_Subject, $mail_Body, $mail_From);                          add_post_meta($post_id, "wpl_pledge_cause", $donCause);                     add_post_meta($post_id, "wpl_pledge_transaction_id", $txnID);                     add_post_meta($post_id, "wpl_pledge_first_name", $firstName);                     add_post_meta($post_id, "wpl_pledge_last_name", $lastName);                     add_post_meta($post_id, "wpl_pledge_country", $addressCountry);                     add_post_meta($post_id, "wpl_pledge_city", $addressCity);                     add_post_meta($post_id, "wpl_pledge_address", $addressStreet);                     add_post_meta($post_id, "wpl_pledge_postal_code", $addressZip);                     add_post_meta($post_id, "wpl_pledge_email", $payerEmail);                     add_post_meta($post_id, "wpl_pledge_donation_amount", $payment_gross);                     add_post_meta($post_id, "wpl_pledge_payment_source", 'paypal');                     add_post_meta($post_id, "wpl_pledge_payment_Status", $payment_status);                      }                      // Response is VERIFIED                 // Send an email announcing the IPN message is VERIFIED                 $mail_From = "xxxxxx@gmail.com";                 $mail_To = "xxxxxxx@gmail.com";                 $mail_Subject = "VERIFIED IPN";                 $mail_Body = $req;                 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);          } else if (strcmp ($res, "INVALID") == 0) {         // IPN invalid, log for manual investigation                      // Notification protocol is NOT complete, begin error handling                      // Send an email announcing the IPN message is INVALID                  $mail_From = "xxxxxxx@gmail.com";                 $mail_To = "xxxxxxx@gmail.com";                 $mail_Subject = "INVALID IPN";                 $mail_Body = $req;                 mail($mail_To, $mail_Subject, $mail_Body, $mail_From);     }     ?>      I read about a problem with an infinite loop and maybe it's also for me because the script doesn't go on when try to execute the function. Have you any ideas?


title: Can you filter wp_dropdown_categories with terms meta?

text: Hi I have a custom taxonomy with a term meta flag called 'is_live' set up and I want to exclude all the terms where this flag is false when I call **wp_dropdown_categories**. I've checked the codex but cant see anything relating to terms meta. Anyone have any ideas or tried this before?


title: Do i need to keep all the default WP templates files in a theme?

text: I have a general question about the themes development. When I develop a theme for distribution (free or commercial) is it a better practice to keep all the default templates file in my theme even though i do not use all of them ? For exemple if i develop a theme without blog feature, is it a good practice to keep single.php, comments.php ... files in my theme ? I ask this question because when i test my themes with theme-check plugin, all the default templates files seems to be mandatory to pass the test. What do you think ? what is the best practice ? Thanks for your advices.


title: Problem with new Multisite Installation

text: I have installed and converted two wordpress installations to Multisite .It was not first time and I done it before for some of my websites. I was successfully able to use it too.But I could not find sub-site files/folders in **'Blogs.dir'** .Hence some plugins are showing errors as there are no files/folders for sub-sites(like subsite 1, 2, 3 etc) in **blogs.dir** The problem might be this...I firstly placed the **Multisite** conversion code at long place in **wp-config.php** .Later I realise my fault and corrected it.But the problem is still un-resolved.Still there are no files in blogs.dir Could anybody help me to resolve this issue? I don't understand if it is because of the new version **3.0.4** or my fault ? Thanks ! **Update** : I installed a new multisite on other fresh domain .And the same problem there. I think the new version don't need that or some thing wrong with my server configuration Update 2 : I am adding a screenshot of my empty blogs.dir folder ![](http://img534.imageshack.us/img534/768/blogsdir.jpg)http://img534.imageshack.us/img534/768/blogsdir.jpg ## Update 3: * * * ## Actually the problem is caused with a plugin named Zingiri The plugin is installed on Multisite installation and got these messages : Directory /home/..../public_html/wp-content/blogs.dir/2/files/ is not writable, please chmod to 777 Directory /home/......./public_html/wp- content/blogs.dir/2/files/zingiri-web-shop doesn't exist ......... ......... Directory /home/....../public_html/wp-content/blogs.dir/2/files/zingiri-web- shop/digital-a42fzcxaq5ykww4t doesn't exist Turn off magic quotes on your installation. Read more about why you should disable this setting ( ( 1 )This is the warning message on sub-sites.The Numeral ' 2 ' represents a subsite here ) _I am having another error message too (here :/wp- admin/admin.php?page=zingiri-web-shop)...when I click on **Install** button in plugin settings page (However it finishes installing the script)._ **Error** :Table 'wpuser_wpdb1.wp_2_users' doesn't exist * * * 'Magic Quotes ' are already turned off and tried changing the permissions for blogs.dir . Even after doing all these,that problem is unresolved . _After realizing the issue is caused with that particular plugin .I attempted to delete the question because some might thing this question is related to plugin and not with blogs.dir_ ## \-------------


title: Uploading Images to Media Library via wp_handle_sideload() fails

text: My basic scenario is the following: I have a directory on my server that gets filled with images via ftp every once in a while. I would want to move these images to the wp upload directory and then add them to the media library with `wp_insert_attachment()`. I thought `wp_handle_sideload()` to be the correct function for this but if fed with an absolute path to one of the images it returns an error. Heres my code so far:               function oo_attach_images($images, $id){              //$images is an array of anbsolute image paths, $id is the id of a post I want the images to be attached to.              require_once(ABSPATH . '/wp-admin/includes/file.php');         require_once(ABSPATH . '/wp-admin/includes/image.php');              foreach($images as $image){                  $override = array('test_form' => FALSE);                  $file = wp_handle_sideload($image, $override);                  print_r($file); //returns: Array ( [error] => )                  $attachment = array(                 'post_mime_type' => $file['type'],                 'post_title' => basename($image),                 'post_content' => ' ',                 'post_status' => 'inherit'             );                  $attach_id = wp_insert_attachment( $attachment, $file['file'], $id );                  $attach_data = wp_generate_attachment_metadata( $attach_id, $file['file'] );             wp_update_attachment_metadata( $attach_id,  $attach_data );                   }     }      I looked into similar questions, but none of the solutions outlined there seemed to have anything to do with the sideload itself failing. Frankly, I believe that I do not pass the right kind of file path to `wp_handle_sideload()`, but since its undocumented in codex I have no idea what kind of input it might expect. Does anyone know what I need to change to make this work?


title: Efficient way to fetch all archived WPMS blogs

text: is there a good and efficient way to fetch all WPMS blogs with archived set to true? Because there doesn't seem to be a function to get all blogs I have added the admin user to all blogs. Then I do a `get_blogs_of_user(1, false)`. This fetch all blogs that are active, but I'm looking for an efficient way to fetch all blogs that is archived. I guess I can do something complicated e.g. call `get_blogs_of_user(1, true)` then `get_blogs_of_user(1, false)`, then find the difference and check if they have the archived bit set one by one, but is there some better way to do this? Thanks.


title: Need to block user role from accessing bbPress all together

text: I've been looking at some options and I haven't seen a full solution to what I need. I need to block certain `user_roles` from accessing bbPress all together and from seeing the link to the page. Any pointers?


title: Is there any plan for WordPress to handle retina support for the site content?

text: I see from browsing Themeforest that there are many retina ( HD ready ) themes available; and WordPress itself has retina standard icons for the backend too; but what about the content, both future content and archived content? There are a couple of plugins available which will sort it out for us, but does this mean that a typical WordPress site will need to carry a retina plugin going forward to work out the serving of the 2x images; or is there a plan for this to be included in the core ... or is it already included ... or is this in the realm of themes to server 2x images?


title: Custom Post Type Feed displaying all posts

text: I'm having some problems with an RSS feed for a custom post type. If you view this URL http://intentional.wpengine.com/feed/?post_type=30daychallenge you'll see a raw feed. Everything looks to be fine there. The problem is when I burn the feed or try to use it in an RSS feed to post plugin (like wpematico or similar) the post type query disappears or something as all of the posts from the site show up in the burnt feed and the plugin data. Any idea what could be the problem?


title: Page specific values in widgets

text: I have a travel guide website which I have created with WordPress which contains destination guides. On the destination guides pages I have a sidebar which displays destination statistics (currency, time zone etc).   Currently I have to create a new sidebar for each page each time changing these values. Is it possible to create a MySQL database with these values and then insert some PHP code that will identify what country page is loaded and insert the corresponding values so that I can use a single sidebar for all pages. I am fairly proficient with HTML/CSS, but my understanding of PHP is limited. How can I do that?


title: Allow author to choose his featured image size

text: Request from a client. He wants his authors to be able to upload their image and then set it as featured, just like normal. The difference is that when setting it as featured, he wants the author to be able to choose 'small' or 'large' which will then be output appropriately on the front-end. How would you go about this? I'm well aware of how to create new image sizes in the theme, but how can I allow the author to select his image size when making his post?


title: How to integrate get_post_time with date_i18n function?

text: I have date format and would like to translate to another language with `date_i18n` function how can I integrate with get_post_time here is my code :               $time = get_post_time('F j, Y', true,$newspost['ID']);


title: Force Users to Login - loop problem

text: I'm using this code below as a plugin. It seems to work but sometimes it seems to be stuck in a loop. When I have this plugin running my facebook social sharing doesn't grab the correct page and content for a share post. I turn off the plugin and facebook share works great. What am I doing wrong?               add_action ('template_redirect', 'protect_whole_site');          function protect_whole_site() {     if ( !is_user_logged_in() &&  !in_array( $GLOBALS['pagenow'], array( 'wp-    login.php', 'wp-register.php' ) ) ) {             auth_redirect();         exit;         }     }      thanks!!


title: Should I use relative or absolute urls when pointing to internal pages

text: This is a simple question, that's probably been asked before. For internal links between pages, is it better to use a relative link or full permalink? Thank you.


title: Prevent Advanced Excerpt from Being Called

text: I have excerpts enabled for pages. In one of my page templates I want to prevent `<?php the_excerpt(); ?>` from initiating the Advanced Excerpt Function. Basically, I have one page template where I want excerpts to function as they normally would. How do I go about accomplishing this while still being able to take advantage of the Plugin's functionality everywhere else? Or - perhaps there is another plugin similar to Advanced Excerpt that is better suited to what I am trying to do... thx! http://wordpress.org/extend/plugins/advanced-excerpt/


title: Uses for function: wp_update_user

text: my theme currently uses the wp_update_user function to update a set of user metas. I created to some new user meta fields that I would like to include in the existing wp_update_user. The function updates the meta fields based on form elements, like this...               $_POST['form']['ID'] = $userdata->ID;     $_POST['form']['jabber']  = $_POST['address']['country']."**";     $_POST['form']['jabber'] .= $_POST['address']['state']."**";     $_POST['form']['jabber'] .= $_POST['address']['address']."**";     $_POST['form']['jabber'] .= $_POST['address']['city']."**";     $_POST['form']['jabber'] .= $_POST['address']['zip']."**";     $_POST['form']['jabber'] .= $_POST['address']['phone'];          if( ( $_POST['password'] == $_POST['password_r'] ) && $_POST['password'] !=""){                 $_POST['form']['user_pass'] = $_POST['password'] ;             }              wp_update_user( $_POST['form'] );          $ADD = explode("**",$userdata->jabber);      The wp_update_user function is using `$_POST['form']` as the parameter to update the user. Along with this function there is a form with the different form inputs with names, such as this, `address[phone]` which is the `$_POST['form']['jabber'] .= $_POST['address']['phone'];` portion of the above code. The sample form input element is this...               <input type="text" name="address[phone]" value="<?php echo $ADD[5]; ?>" />      I was thinking that to create a new user field and include it into the existing wp_update_user function being used, all I would have to do is create the input element like this...               <input type="text" name="form[new_user_field]" value="<?php echo $_POST['form']['new_user_field']; ?>" />      and then add a line of code to the function values like this...               $_POST['form']['new_user_field'] .= $_POST['form']['new_user_field'];      But...after submitting the form that the function belongs to, my newly inputted value isn't saved in the new user meta field. Is there a way to include my new user meta field into the existing wp_update_user? Can someone tell me what Im doing wrong? Thanks a lot


title: HTML Redirect to WP pages

text: I have some predefined links that I need to redirect to real URLs within my WP install. I have NO CHOICE but to use these URLs provided to me, unfortunately. The format is: http://mysite.com/redirect.html?p=pagename WP is installed at the root of mysite.com. I need to take the pagename query var, which will not be a direct match to a page URL and redirect it (301) to a WP permalink. I have attempted a few things in .htaccess with rewrites but not having luck mostly due to the fact that there are also WP permalinks redirecting. Anyone done this before or know the best approach? UPDATE - Here is the working code that I used based on the accepted answer below:               RewriteCond %{REQUEST_URI} ^/redirect.html(.*)$       RewriteCond %{QUERY_STRING} ^(.*?)&?p=page&?(.*?)$       RewriteRule (.*) /page/?%1&%2 [L,R=301]      I also added these before the base WP rewrites.


title: Get full page HTML for a non-public Wordpress page

text: How can I write a function that will return the full rendered HTML of a non- public URL on my Wordpress site—a URL that you must be logged in to see, such as a draft? Not just the post content, but the full rendered HTML that a browser would receive, from `<!doctype` to `</html>`? I would normally accomplish something like this with cURL, but in this case, a plain cURL would result in a 404—because the desired page is only accessible if you are a logged-in Wordpress user. I have seen examples of WordPress authentication with cURL, but they all seem to require you to hard-code a username and password, which I would like to avoid because a) it seems insecure, and b) Wordpress users can change their password at any time. This is what I want to achieve:               function getFullPageHtml( $url ) { // pass in a url (post ID would be fine too)             // Do something here that does not involve hard-coding a WP username password             return $html; // a string of the full page's HTML--'<!doctype...etc...</html>'     }      Is there a different approach that would get me this result without relying on including username and password in the code? For example, using output buffers instead of making a cURL/HTTP request?


title: Having some trouble properly displaying Custom Post Types in templates

text: I have a child theme of Twenty Thirteen and I've setup Custom Post Types for several items. They are showing up in the Dashboard, I can create the Custom Posts and they show up in various categories because I called the `$query->set()` with the Custom Post Types. I've saved and re-saved Permalinks many times to flush the rewrites. Here is how I registered one in `functions.php`...               $labels_successstories = array(         // my various labels are in here     );       $args_successstories = array(         'labels' => $labels_successstories,         'public' => true,         'menu_position' => 29,         'supports' => array( 'title', 'editor', 'thumbnail' ),         'taxonomies' => array( 'category' ),         'has_archive' => 'success-stories',         'rewrite' => array( 'slug' => 'success-stories' )     );       register_post_type( 'successstories', $args_successstories );      In Settings > Permalinks > Custom Structure >               /%category%/%postname%/      Here is how I call `$query->set()` in `functions.php`               function get_custom_posts( $query ) {         if ( ! is_admin() && empty($query->query_vars['suppress_filters']) ) { // is not in Dashboard (is_admin => Dashboard)                    if ( is_home() ) {  // home page - show only animal posts                 return $query->set( 'post_type', array( 'post', 'successstories', 'another-post-type' ) );             } else if ( is_search() ) {  // search page - show only posts, pages and custom post types                 return $query->set( 'post_type', array( 'post', 'page', 'successstories', 'another-post-type' ) );             } else if ( ! is_single() ) { // everything else, EXCEPT for Singles, show everything                 return $query->set( 'post_type', array( 'post', 'page', 'attachment', 'successstories', 'another-post-type' ) );             }         }      }     add_filter( 'pre_get_posts', 'get_custom_posts' );      My goal is to remove as many Categories as I can since the Custom Post Types will effectively replace most of these Categories. However, one of my Custom Post Types will still need a few Categories. Here are the questions/issues: 1) When I go to `mysite.com/success-stories/`, it's using the default `archive.php` template. However, I have created a template called `archive- successstories.php` and it's being totally ignored. (if it matters, the `single-successstories.php` template is working perfectly fine) 2) When I go to `mysite.com/success-stories/`, I see posts but they're coming from all posts, custom post types, and categories. I just want to see posts from the `successstories` Custom Post Type when I go there. I think I know how to fix this but if the archive template is being ignored, then my fix will not be seen. 3) Right now, Success Stories (Custom Post Types) are also in a Category named `success-stories` which can be accessed at `mysite.com/category/success- stories` and that shows the correct posts. However, my goal is to remove this Category since it's not needed. Once I get these Custom Post Types to show on their proper archive pages, the respective Categories will be superfluous.


title: Deploying Updated or New Plugins That Modify the wp_options Table

text: I have a WordPress site under local version control with Git. I deploy it to the production server using Capistrano. For the initial deployment, I manually import the SQL database to the production server, and change all the local references by hand. Any content changes are made on the production server from then on. This is for the most part okay, but I'm having a problem when it comes to testing/configuring new or updated plugins, since many plugins make changes to the wp_options table. I need a way to add/remove/update/configure plugins locally, do all my testing and then seamlessly deploy the updated site to the production server without breaking anything. How are others dealing with this?


title: Mass remove a number of tags from a number of posts

text: i am having a wallpapers site. I was having lots of posts with no tags and i tried some plugins to auto add tags like simple tags where you need to set some tags and it will auto use those tags for posts, then i used auto tag posts option and it added all the 50-60 tags to a number of individual posts,Means it added 50-60 tags to each of the posts in 500 posts. Its very time consuming now for me to edit each post and removing unwanted tags. Is there any way so that i can remove those 50-60 tags via a MySQL query? Any way either a plugin or a mysql query can do this. Please help.


title: How to display posts list on my plugin page?

text: Currently, I makes a plugin, and I want to display some post in admin submenu, my url looks like wp-admin/admin.php?page=mypluginpage how to display posts list on my plugin page? it's possible or not? Thanks. * * * Please delete this post, I just found solution:               <?php     $query = new WP_Query(         array(             'post_type' => 'post',             'post_status' => 'publish'         )     );          $list = array();     foreach ($query->posts as $post) {         .......     }     ?>


title: Wordpress Limit Title Characters

text: I'm using this code for limit title characters                   (strlen($post->post_title) > 40) {     echo substr(the_title($before = '', $after = '', FALSE), 0, 40) . '...'; } else {     the_title();      http://wordpress.org/support/topic/how-to-limit-character-on-title However when in titles have special character as: ' then the code will be wrong. For example: I have the title: "Infinite Scrolling in Web Design and Mobile Apps : Let’s Get To The Bottom". After I added the code above it will show: > Infinite Scrolling in Web Design and Mobile Apps : Let�...


title: I made new theme directory, why won't it show up in admin GUI?

text: I did this:               cd wp-content/themes     cp -R someTheme newTheme      then:               cd newTheme     vim style.css #changed name of theme in the css comment header      and then logged into `example.com/wp-admin`. But when I looked at the list of themes (under the appearance header in left menu), I did not see it there. What else must I do for wordpress to notice my theme? wp version = 3.0.4


title: How to add class on Widget Title

text:
This is an example of register sidebar function from codex. My focus is on the `before_title` argument. What i want is to add a class to the title(`<h3>`). From my widget code or may be pass the class name from user input on widget area.               <?php $args = array(         'name'          => sprintf(__('Sidebar %d'), $i ),         'id'            => 'sidebar-$i',         'description'   => '',         'before_widget' => '
',         'after_widget'  => '
',         'before_title'  => '
',         'after_title'   => '
' );           register_sidebar( $args );          ?>      So, **How do i add classes dynamically on widget header?**


title: Custom fields to taxonomy

text: Can I add some custom fields to specific taxonomy so when ever I call that taxonomy, custom fields attached to that taxonomy should also appear.


title: Change from all posts to specific categories post on main page?

text:
How do I change my index.php to display only the desired categories posts in the main page ? I tought that changing this would workout but instead it just print nothing:                           query_posts( array(                 'post_type' => array(                             'post',                             $include_reviews,                             $include_screenshots,                             $include_videos                         ),                         'paged' => $paged )                     );      Change from `'post',` to `'cat=10',` not very sure how to do this. This is my index.php file:               <?php get_header(); ?>              <?php         $slider_number = get_option('lp_slides_number');         $args = array( 'post_type' => 'slider', 'showposts' => $slider_number );         $slider_loop = new WP_Query( $args );         if ($slider_loop->have_posts()) : ?>

                  <?php while ( $slider_loop->have_posts() ) : $slider_loop->the_post(); $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), false, '' ); ?>                 <div class="featured-item" style="background:<?php echo get_post_meta($post->ID, 'feature_bg', true); ?> url(<?php echo $src[0]; ?>) no-repeat center; height:280px;">

<a href="<?php echo get_post_meta($post->ID, 'feature_url', true); ?>" rel="bookmark" title="Link Permanente: <?php the_title(); ?>"><?php the_title(); ?>

Por <?php the_author(); ?>, <?php the_time( get_option('date_format') ); ?>

             <?php endwhile;             wp_reset_query(); ?>

                  <?php endif; ?>

Last News
                                               <?php                          if(get_option('lp_include_reviews') == "true") { $include_reviews = "'reviews',"; }                     if(get_option('lp_include_videos') == "true") { $include_videos = "'videos',"; }                     if(get_option('lp_include_screenshots') == "true") { $include_screenshots = "'screenshots',"; }                          query_posts( array(                     'post_type' => array(                                 'post',                                 $include_reviews,                                 $include_screenshots,                                 $include_videos                             ),                             'paged' => $paged )                         );                     ?>                     <?php if (have_posts()) : ?>                     <?php while (have_posts()) : the_post(); ?>                              <?php                              if ( get_post_type() == 'reviews' ) : ?>                                  <?php include( TEMPLATEPATH . '/includes/show-reviews-frontpage.php' ); ?>                              <?php elseif ( get_post_type() == 'videos' ) : ?>                                  <?php include( TEMPLATEPATH . '/includes/show-videos-frontpage.php' ); ?>                              <?php elseif ( get_post_type() == 'screenshots' ) : ?>                                  <?php include( TEMPLATEPATH . '/includes/show-screenshots-frontpage.php' ); ?>                              <?php else: ?>                                  <?php include( TEMPLATEPATH . '/includes/show-posts.php' ); ?>                              <?php endif; ?>                          <?php endwhile; ?>                     <?php kriesi_pagination(); ?>                     <?php wp_reset_query(); ?>                          <?php endif; ?>

                       <?php get_sidebar(); ?>          <?php get_footer(); ?>


title: Best Way to Create Multi Level Categories/Taxonomies

text: I am looking for experience on the best way to create multi level categories. I am building a WordPress site for an organization that sells plant seeds. They have five levels of organizing their seeds. EX:   Seeds (Custom Post Type) > Grains > Rye > Secale Cerale > White Rye It would be the same structure as: Computers > Mac > iMac > 27" Because the organization has 500+ seeds available, we want to organize them by their categories. What is the best way to do this - simply using WordPress built in categories feature? I have heard that it is bad practice to assign one post to more than one category. I prefer to write as much custom code as possible and would like to stay away from widgets (unless they are really good) :)


title: WordPress 3.2 - Problem with WYSIWYG editors in a custom post type?

text: I'm using this class http://www.deluxeblogtips.com/p/meta-box-script-for- wordpress.html to create custom meta-box in which it contains some WYSIWYG editors. It works fine until I upgraded my WP to 3.2. The WYSIWYG editors are now have white text background and all tinyMCE buttons are gone! I guess they've changed quite a lot of things in TinyMCE editor in this 3.2 version to accommodate the "full screen editing" stuff. Bad for me though, it destroys my custom metabox... And there is no documents about this change, at all


title: Taxonomy for costum post type not found

text: I'm trying to use taxonomies to create categories for my costum post type. I registered the necesary components:               add_action( 'init', 'create_post_type' );     function create_post_type() {         register_post_type( 'bkroadkill',             array(                     'labels'        => array(                     'name'          => __( 'Roadkills' ),                     'singular_name' => __( 'Roadkill' )                 ),             'public'      => true,             'has_archive' => true,             'supports'    => array( 'title', 'custom-fields', 'author', 'thumbnail', 'comments' )             )         );     }          function roadkill_categories_init() {         $labels = array(             'name'              => _x( 'Roadkill Categories', 'taxonomy general name' ),             'singular_name'     => _x( 'Roadkill Category', 'taxonomy singular name' ),             'search_items'      => __( 'Search Roadkill Categories' ),             'all_items'         => __( 'All Roadkill Categories' ),             'parent_item'       => __( 'Parent Roadkill Category' ),             'parent_item_colon' => __( 'Parent Roadkill Category:' ),             'edit_item'         => __( 'Edit Roadkill Category' ),              'update_item'       => __( 'Update Roadkill Category' ),             'add_new_item'      => __( 'Add New Roadkill Category' ),             'new_item_name'     => __( 'New Roadkill Category' ),             'menu_name'         => __( 'Roadkill Categories' ),         );         $args = array(             'labels' => $labels,             'hierarchical' => true,             'rewrite' => true,             'name'  => 'roadkill_category',             'id'  => 'roadkill_category',         );         register_taxonomy( 'roadkill_category', 'bkroadkill', $args );     }     add_action( 'init', 'roadkill_categories_init' );      And I was able to create some roadkill categories in the wp-admin backend. But as I click on view I will result in annot found page. Also I am not able to fetch my categories to use them in my dropdown of my form (it will be empty).                       <?php $args = array(                     'name'               => 'roadkill_category',                     'taxonomy'           => 'roadkill_category',                     'hide_if_empty'      => false,                 ); ?>                      <?php wp_dropdown_categories( $args ); ?>       What did I miss here? EDIT: There are two different not foudn pages (the one when permalink is not working (404) and another one when content is not found I guess. The title is set correctly then


title: Add Link Category on Activation?

text: Is it possible to add a link category on plugin activation? What I mean is the Links section, as you know by default it has the Blogroll link category. I want to add a new link category when my plugin is activated, is there a quick and easy way to do this? What is the best method to use? Thanks.


title: twenty eleven single.php

text: I am using twenty-eleven theme for my site, I just saw that in single posts page, .i.e single.php, the sidebar is absent, which means no widgets in single.php page How do I bring it back


title: Different thumbnails for index and article page

text: For my aricles (wp7app.de) I'd like to use two different thumbnails, one which is displayed only on the index page (150x150) and one for the article page (600x400). However, I don't want to use a cropped version of the big image for the index. Is this something that can be done easily without an extra plugin or can you recommend a good / simple one? Cheers


title: $wpdb prepare issue with mysql DATE_FORMAT

text: Today, I have a issue in $wpdb. I used               $result = $wpdb->get_var(        $wpdb->prepare(         "SELECT DATE_FORMAT(report_date, '%d-%m-%Y') FROM table WHERE report_id = %d",          $report_id         )     );      The above code not works because of %d in DATE_FORMAT. How i solved this issue in wordpress


title: Detect Page Template inside Loop possible?

text: I'm a bit stuck with my actual theme development. I'm using different Blog Templates to choose from. Now each of those Blog Page Templates has a custom loop to pull the posts. Inside that loop I use the get_template_part() function to pull the right post format template. `<?php get_template_part( 'framework/inc/post-format/entry', get_post_format() ); ?>` Now one thing: Inside the post format templates (entry.php) I want to check which blog page template is used to set a thumbnail size according to the template. As we are in the loop now, the is_page_template() function doesn't work. Can anybody help me here? Maybe it's just too late, but actually I don't see a solution. And: I don't want to use the include(locate_template()) workaround to pass variables to the entry.php template. Thanks in advance, Phil


title: categories on attachment page

text:
I am using this function to display categories specified to a post having gallery on the image attachment page.
CATEGORY: <?php the_category(', '); ?>
      The problem is that this function doesn't return anything. I have also used this way to display categories but no success:                   <?php $categories = get_the_category();               $separator = ', ';               $output = '';                if($categories){ ?>               CATERGORY:         <?php foreach($categories as $category) {         $output .= 'term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.''.$separator;             }         echo trim($output, $separator);             }             ?>      Can anyone tell where problem lies??? Thanks


title: Retreaving all images attached to current post

text: I am trying to retrieve attachments that are attached to my current post. This is the code that I am trying to use. What I'm attempting to do is query all of my posts that are of custom post type business-manager. From within that loop I am starting another query to retrieve the attachments associated with that post. If I var dump the $attachment variable I get an empty array. If I pass the array for attachment variable into get_posts($args) then do a var dump I can retrieve all of the images. How can I do this using a new WP_Query object?               $my_query = new WP_Query( array(                'post_type'         =>  'business-manager',                'posts_per_page'    =>  1,                'tax_query'         =>  array(                    'taxonomy'      =>  'business-type',                    'field'         =>  'slug',                    'terms'         =>  'featured'                )         ) );               $attachment = new WP_Query( array(         'post_type' => 'attachment',         'numberposts' => -1,         'post_status' => null,         'post_parent' => $my_query->post->ID     ) );


title: Removing parent slug from URL on custom post type

text: As the title states, I'd like to remove parent slugs from URLs for a particular post type: services. Something that would change this:               http://demo.com/parent-service/child-service-1     http://demo.com/grand-parent-service/parent-service/child-service-2     http://demo.com/great-grand-parent-service/grand-parent-service/parent-service/child-service-3     etc      To something like this:               http://demo.com/child-service-1     http://demo.com/child-service-2     http://demo.com/child-service-3     etc      I'd rather not use an additional plugins to accomplish this. I'm currently delivering the CPT via a plugin, which also registers a custom taxonomy.


title: Dynamic menu links after header title

text: I am using Parabola theme of Wordpress, and i would like to display few dynamic menu links for logged in users, just at the right of the header title. As shown in the below image, Menu 1 and Menu 2 links should be placed at the right of header title. ![enter image description here](http://i.stack.imgur.com/QcSUM.png) What would be the best approach for this? I don't prefer a plugin, but instead like to use theme hooks, because when the theme changes, i can just write a hook for achieving the same functionality. Please suggest where should i modify code, or what new functions i have to write. **EDIT:** I would like to keep the main menu as it is. I only want custom menu links after header title.


title: More Fields: Input "Values (if applicable)" is disabled

text: I have create a box and some fields in it. One of them is of type select. In the field `Values (if applicable)` I cannot change the content anymore. The field is disabled. I tried to delete all posts which where using this fields but still the field is disabled. Is the only way to completely delete the field and add a new one?


title: How to Add jQuery Infinite Scroll to My Custom Archive Page

text:
I currently have a custom archive page that displays my current post at the top and then links to all of my older posts below that. However, I need to break up the page so that it displays the current post and then below that just the current months posts. I want to use the jQuery infinite scroll plugin to display older posts month by month as they scroll down the page it automatically loads the next month's posts. Here is my code that I have to display the current post:               <?php get_header(); ?>

                 <?php                 global $post;                 $tmp_post = $post;                 $args = array( 'numberposts' => 1, 'category' => 6 );                 $myposts = get_posts( $args );                 foreach( $myposts as $post ) : setup_postdata($post); ?>                     <a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
                     <?/* <?php the_excerpt(); ?> */?>                     <?php the_content();?>                 <?php endforeach; ?>

                         <?php                          $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID );                          $attachments = get_posts($args);                         if ($attachments) {                             foreach ( $attachments as $attachment ) {                                 echo '
';                                 the_attachment_link( $attachment->ID , 'full' );                                 echo '
';                             }                         }                         ?>
                                 <?php $post = $tmp_post; ?>

      Here is the code I have to display my older posts:

Browse Our Archives

         <?php          global $post;          $tmp_post = $post;          $myposts = get_posts('numberposts=-1&category=6&orderby=date&order=DESC');          foreach($myposts as $post) :         ?>         <?php              setup_postdata($post);                     $size = 'thumb';                     $images = get_children(array(                     'post_type' => 'attachment',                     'numberposts' => 1,                     'post_status' => null,                     'post_parent' => $post->ID));                     foreach($images as $image){                     $attachment = wp_get_attachment_image_src($image->ID, $size);                     ?>                     <div class="rea-con" style="background: url(<?php echo        $attachment[0]; ?>) no-repeat center center;">
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_title(); ?>

                    <?php } ?>             <?php endforeach; ?>         <?php $post = $tmp_post; ?>

        How can I break up the section of older posts code so that by default it only pulls back the current months posts and then as they scroll down it will automatically display the previous months posts and then when they scroll down more it will automatically display the month before that's posts? I want to use the jQuery infinite scroll plugin to do this. Any help is appreciated. Thanks!


title: Remove updates text on plugin or themes list page

text: I seen update messages as like " **There is a new version of BLAH PLUGIN available on BLAH SITE. View version 3.1.3 details or automatically update** " on plugin list page and themes listing page before install the **Disable WordPress Updates** plugin. I thought after installed the plugin these lines will be removed. But it was not. **How can i remove these updates text from plugin list or themes list page?**


title: Using setup_postdata() with multi-dimensional array

text: I feel like this is going to be one of those _slap yourself on the head_ questions, but here it goes anyway: I have a multi-dimensional array of data:               Array     (         [0] => Array             (                 [id] => 1033                 [zip] => 27604                 [distance] => 0             )              [1] => Array             (                 [id] => 1024                 [zip] => 27615                 [distance] => 6             )          )      The `id` field in each is the `post ID` and what I'm really after. What I've tried thusfar is something like:               foreach( $locations as $post ) {         setup_postdata($post['id']);              echo get_the_title();          }     wp_reset_postdata();      with no luck. Am I approaching this all wrong - what's the best way to get that darned ID value to run through `setup_postdata()`? I still need to reference the other data in the multi-dimensional array (`zip` and `distance`).


title: Using locate-template & shortcodes doesn't appear to work

text: For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. Here's the code in the functions.php:-               locate_template( array( 'inc/shortcode-functions.php' ), true, true );      add_shortcode( 'abc-row', 'echo_abc_row' );     add_shortcode( 'abc-span', 'echo_abc_span' );      I have taken the code out of inc/shortcode-functions.php into the functions.php, so does appear to work, and no error is coming up in debug mode, so I'm a bit stumped. Any ideas?


title: Pagination for Pages and Posts

text: I want to use Pagination throughout a new theme but am having trouble getting it to work correctly. I am using some code within my functions.php file and then calling that function. It works on the 'blog' page but not on paginated posts or pages. Here is my code:               // Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin     function canvas_pagination()     {         global $wp_query;         $big = 999999999;         echo paginate_links(array(             'base' => str_replace($big, '%#%', get_pagenum_link($big)),             'format' => '?paged=%#%',             'current' => max(1, get_query_var('paged')),             'total' => $wp_query->max_num_pages,             'type' => 'list'         ));     }          add_action('init', 'canvas_pagination'); // Add our Pagination      And call the funtion: `<?php get_template_part('pagination'); ?>` This code works great within the index.php file. See here: http://website- test-lab.com/sites/blank_canvas/blog/ But not within single.php and page.php:   * SITE URL + /paginated/   * SITE URL + /page-pagination/ ( _Can't add more than 2x links here_ ) Can someone explain why this doesn't work and what needs to be amended to fix it. I have tried using wp_link_pages but it's not giving me the ability to customise the output I require. Thanks in advance


title: Is there a standard for naming plugin versions

text: My business partner and I are developing several plugins and we want to know if there is a standard for the version number of a plugin when there are updates, i.e., version 1.0, version 1.2, version 1.2.3, etc? Thanks for any advise.


title: Saving (Updating) Post / Page Edits With AJAX

text: One of the major frustrations while editing posts/pages is that after saving, two things happen:   * The admin page is reloaded, which takes time   * More importantly, the cursor position is lost If you're working on longer posts — especially when copy-editing, or if working in HTML mode and making small adjustments where frequent previews are needed — losing the current position, then finding the point where you left off is unnecessarily frustrating and time-consuming. An elegant solution to this problem would be if the updates would be done over AJAX. Actually there used to be a plugin for this, but it hasn't been updated in over 5 years and it doesn't work with current WP versions anymore. Is there an (easy) way to either:   * Fix that plugin, or   * Hack `post.php` to add a working "AJAX Save" button? Interestingly, WordPress already has an AJAX update functionality which it uses when Auto-Saving. Perhaps that could be starting point? I truly believe this is an important UX issue and would greatly appreciate your help. Thank you!


title: Show editor widgets only on pages that use a specific template?

text: I am utilizing the following code to add an additional three Featured Images to homepages in a multisite installation:               if (class_exists('MultiPostThumbnails')) {         new MultiPostThumbnails(             array(                 'label' => 'Core Home Image 1',                 'id' => 'core-home-1',                 'post_type' => 'page'             )         );         new MultiPostThumbnails(             array(                 'label' => 'Core Home Image 2',                 'id' => 'core-home-2',                 'post_type' => 'page'             )         );         new MultiPostThumbnails(             array(                 'label' => 'Core Home Image 3',                 'id' => 'core-home-3',                 'post_type' => 'page'             )         );     }      The new edit page widgets are displaying and functioning as they should, however, they are appearing on all edit pages. How do I force WordPress to only display them on the pages that use a specific template, i.e. Core Front Page Template (wp-content/themes/mytheme/templates/core-front-page.php)? Thanks in advance for your help.


title: Displaying Custom Fields on Post with Genesis Child Theme

text: I have tried everything to get Custom Fields to display on my posts using a Child Theme of the Genesis theme framework. I have tried to follow every tutorial I could find relating to it but still I can't get my Custom Fields to show on my posts! The simplest looking solution I have been trying is using Brad Daltons instructions (I have tried many other methods) and adding the following to my functions file:               add_action( 'genesis_after_post_title', 'custom_field_before_content' );     /**     * @author Brad Dalton - WP Sites     * @link http://wp.me/p1lTu0-9WF     */     function custom_field_before_content() {     if(is_page() || is_single() ) {     genesis_custom_field('instrument');     }     }      I have then added the custom field in my posts. I have tried adding the custom field with Advanced Custom Fields which shows perfectly in the admin but not on the post on my site. Does anyone know what I am doing wrong to get this to output or a different method that might work for me. I done this no problem with different themes but using the Genesis theme framework I can't get this to work - have been at it for two days! Thanks, Ciarán


title: Can't preview custom post - Redirected to home page

text: When I click on preview in custom post types I get redirected to home page. But when I visit or view the page that have all the Custom posts in I can see all of them. I cant figure out what or why. **NOTE** I allready tried all the Settings -> Permalinks options. **Update #1 CTP registration**               function register_cpt_cars() {         $labels = array(              'name' => _x( 'Cars', 'cars' ),             'singular_name' => _x( 'Cars', 'cars' ),             'add_new' => _x( 'Add new', 'cars' ),             'add_new_item' => _x( 'Add new Car', 'cars' ),             'edit_item' => _x( 'Edit Cars', 'cars' ),             'new_item' => _x( 'New Car', 'cars' ),             'view_item' => _x( 'Show cars', 'cars' ),             'search_items' => _x( 'Search Car', 'cars' ),             'not_found' => _x( 'No car found', 'cars' ),             'not_found_in_trash' => _x( 'No cars found in the trash', 'cars' ),             'parent_item_colon' => _x( 'Parent cars:', 'cars' ),             'menu_name' => _x( 'Cars', 'cars' ),         );              $args = array(              'labels' => $labels,             'hierarchical' => false,             'description' => 'New Cars',             'supports' => array( 'title', 'editor', 'thumbnail' ),             'taxonomies' => array( 'category'),             'public' => true,             'show_ui' => true,             'show_in_menu' => true,             'menu_position' => 20,             'menu_icon' => get_stylesheet_directory_uri() . '/img/icons/53-house.png',             'show_in_nav_menus' => true,             'publicly_queryable' => true,             'exclude_from_search' => false,             'has_archive' => true,             'query_var' => true,             'can_export' => true,             'rewrite' => true,             'capability_type' => 'post'         );              register_post_type( 'cars', $args );     }      **Update #2** Tried removing **rewrite** and **capability** _type from CTP registrations. Still dont work. I get to my homepage but the URL changes.


title: How to add set featured image button in wp_editor()?

text: I am working in a plugin and in that plugin adding wordpress default editor(wp_editor)and adding functionality to save post with add media features. Add media features is working absolutely fine and adding media to respective post, but i want to add image as a thumbnail but i am not able to add set featured image button to the add media button. This is the code i am writing to add WordPress default editor:               wp_editor( $post_content , 'productinfoeditor', array(     'media_uploads'=>true,     'textarea_name' => 'product_info_content',      'editor_class' => 'requiredField',      'teeny' => true,      'textarea_rows' => 14     ) );      In `function.php` file               add_theme_support( 'post-thumbnails', array('post','page', 'product' ) );      And saving post with:               $post = array();     $post['post_type'] = 'product';     $post['post_content'] = $product_info_content;     $post['post_author'] = $user_ID;     $post['post_status'] = 'publish';     $post['post_title'] = $product_title;     $post_id = wp_insert_post( $post );


title: Bulk Edit Tags in WordPress?

text: I would like to have the ability to bulk edit post tags in WordPress. I found an article here which uses a very old version of WordPress (the article published in 2011) and it appears that back then you could bulk edit tags. However, I have just installed a clean install of WordPress 3.9.1 to ensure no plugins were interfering with Bulk Edit, and when I choose multiple posts with the same or different tags, nothing shows up in the Tags textarea! Is this a bug? I've searched around for plugins which may enable this feature but I have not found anything that works. Screenshots: ![Tags - Quick Edit](http://i.stack.imgur.com/JQLtL.png) Quick Edit - works fine. ![Tags - Bulk Edit](http://i.stack.imgur.com/JIGrU.png) Bulk Edit - nothing here. Screenshot from version of WordPress from 2011 (from above URL): ![Working in old version](http://i.stack.imgur.com/xR54N.png) Shows that tags used to appear in the Bulk Edit screen. Any ideas? Thanks


title: wp_mail very slow

text: I have a question about the wp_mail() function. Right now I'm having the following button to send e-mail with:               echo '<input type="submit" name="send_button" value="verzenden" id="'.$post_id.'" class="send_post">';      which triggers a jQuery request:               jQuery(document).ready(function() {          jQuery(".send_post").click(function() {              var post_id = $(this).attr('id');              jQuery.ajax({             async: false,             type: 'get',             url: nieuwsbrief.sendmail_url,             data: 'postid=' + post_id,                 success: function(data) {                     alert(data);                     return false;                 }         });     });          });      jQuery sends the request to `sendmail.php`. Which includes the following:               <?php      include_once $_SERVER['DOCUMENT_ROOT'] . '/www/wordpress/wp-config.php';      include_once $_SERVER['DOCUMENT_ROOT'] . '/www/wordpress/wp-load.php';      include_once $_SERVER['DOCUMENT_ROOT'] . '/www/wordpress/wp-includes/wp-db.php';           global $wpdb;          $subscribers = $wpdb->get_results(      $wpdb->prepare(          "SELECT * FROM                  wp_nwsbrf_subscribers                      INNER JOIN                          wp_nwsbrf_couple                             INNER JOIN                                  wp_nwsbrf_categories                                     INNER JOIN                                         wp_posts                                         WHERE                                              wp_nwsbrf_subscribers.category_id = wp_nwsbrf_categories.category_id                                             AND                                              wp_nwsbrf_couple.category_id = wp_nwsbrf_categories.category_id                                             AND                                              wp_nwsbrf_subscribers.category_id = wp_nwsbrf_couple.category_id                                             AND                                             wp_posts.ID = wp_nwsbrf_couple.ID                                             AND                                             wp_nwsbrf_couple.ID = %d", $_GET['postid']) );               foreach ($subscribers as $subscriber) {              $to = $subscriber->subscriber_mail.",";         $title = $subscriber->post_title;         $message = $subscriber->post_content;              wp_mail($to, $title, $message);     }          ?>      As you can see, the mail has to be sent in `sendmail.php` (url: `nieuwsbrief.sendmail_url`). But when I click on the send_button it takes minutes (3 or 4) to send the e-mail!? What am I doing wrong here? Thanks for helping me out!


title: How can I make Capital letter ( upper-case ) permalinks?

text: How can I make a link like this? `http://www.lifecellskin.us/Dev/About` the "Using_Permalinks" part, A is Capital letters. But WP automatically convert upper case to lower case. I'm trying to convert an old site that made by only html to a WP platform site. Some links to the site look like this: `http://www.lifecellskin.us/About` The site is already indexed by SEO. so I don't want to lose SE rankings. Thanks for reading this, and hope somebody will be able to shed some light on it...


title: Need correct results from 6 rss (fetch_feed)

text:
I Just need some correct results from 6 rss feed I am fetching 6 feeds and maked a news ticker bar at `http://thehoopdoctors.com/online2/newfeed/` I am getting results from 6 rss feeds like First getting all posts from `http://thehoopdoctors.com/online2/newfeed/",` Then All `"http://thepigskindoctors.com/newfeed/",` Then All `"http://thepuckdoctors.com/newfeed/",` Then All `"http://thecagedoctors.com/newfeed/",` Then All `"http://thedugoutdoctors.com/newfeed/",` Then All `"http://videogoneviral.com/newfeed/"` I just need get one by one. I just need to get post from all urls one bye one like `"http://thepigskindoctors.com/newfeed/",` first post `"http://thepuckdoctors.com/newfeed/",` first post and so on. my code is               <?php          $rsslist=array(     "http://thehoopdoctors.com/online2/newfeed/",     "http://thepigskindoctors.com/newfeed/",     "http://thepuckdoctors.com/newfeed/",     "http://thecagedoctors.com/newfeed/",     "http://thedugoutdoctors.com/newfeed/",     "http://videogoneviral.com/newfeed/"     );     $feed = fetch_feed($rsslist);     ?>
     <?php     foreach($feed->get_items() as $item) {?>
<a style="color:white !important;" href="<?php echo $item->get_permalink();?>"><?php echo $item->get_title();?>
     <?php }?>


title: How to attach images that I "insert from url" into the post?

text: I'm trying to get the list of images in my post, to display them in the front page... the problem is that when I add a new picture from a URL, it doesn't seem to attach it.               $images =& get_children( 'post_type=attachment&post_mime_type=image' );      This returns an empty array... how can I solve this so I can actually use these images and create thumbnails to display them on the front?


title: How to replace post image url before posting using api?

text: I am currently writing phpNuke import Wrdpress plug-in. I have a problem with importing posts with images: \+ I already had written a routine which extracts image tag text and images from source post HTML \- I need to **replace** `img` tags with the ones imported to wordpress media library. Example: phpNuke post content:                ...bla bla...              bla bla...      should be translated to wordpress into something like this:                ...bla bla...              bla bla...      I had found a wordpress function media_sideload_image which according to description imports image from given URL into a library and attaches it to the post with given id... But to **replace** image tag with new I need to:   1. insert post with wp_insert_post and save post id   2. use media_sideload_image to import and receive image tag   3. extract `src` attribute from `img` tag    4. replace `src` in post html    5. update post with wp_update_post This leads to duplicating post data (adding extra revision). **My questions are:**   * Is there any way to add image to Wordpress post in more straightforward way? (without double posting)   * Is the linkage of image to post obligatory?


title: Why my plugins are updating automatically?

text: I have a wordpress site with a few plugins. I had to make some custom changes on a plugin (not a best practice), and of course I don't want to update that plugin. But for some reason all my plugins have been updating themselves automatically without asking. ( Is that even possible ?!!). I have never had this behavior before. I know that some plugins will show a notification whenever a new version is available and then I must click to update it. My question is: **Is it possible that my plugins are updating without asking?** or perhaps this could be a security issue and I might have an unwanted admin updating the plugins ? \-- Edit -- I think I found my problem. I posted the answer. Thanks for all the others answers, they helped me to rule out other possibilities.


title: Inconsistent server code response using HTTP API

text:
I'm using Wordpress http api to get a server response code from youtube api so I check the validity of a video. I do this in a function from my functions.php which processes my post form where I collect the url of the youtube video. The issue is I'm getting inconsistent responses as where videos that are valid are returning 403's occasionally. Now I also check the validity on the front end using jquery .ajax() using the same youtube api request and that works correctly 100% of the time. So a video will validate using youtube api and jquery and then sometimes return a 403 using the php method. So what is the issue here? This is my processing function for the form. You'll notice I'm printing out the $video_id every time to make sure it's correct and it is.               function video_process_form( $query ) {       global $error_output;        if ( $query->is_page( 'submit-video' ) && isset( $_POST['title'] )) {              $output = null;               if ( ! function_exists( 'wp_handle_upload' )) {             require_once(ABSPATH . "wp-admin" . '/includes/image.php');             require_once(ABSPATH . "wp-admin" . '/includes/file.php');             require_once(ABSPATH . "wp-admin" . '/includes/media.php');         }              $file = $_FILES;              // Do some minor form validation to make sure there is content         if ($_POST['title'] != null && $_POST['title'] != 'Video Title') {             $title =  $_POST['title'];         } else {             $error_output .= 'Please enter a video  title
';         }              if ($_POST['description'] != null && $_POST['description'] != 'Video Description') {             $description = $_POST['description'];         }              if ($_POST['video_url'] != null && $_POST['video_url'] != 'Youtube URL') {             $vid_url = $_POST['video_url'];             $video_id = getVideoId($vid_url);             if ($video_id) {               printf($video_id);               $video_response =    wp_remote_retrieve_response_code(wp_remote_get('http://gdata.youtube.com/feeds/api/videos/' .                     $video_id));               printf($video_response);               if ($video_response == 200) {                   $video_url = $vid_url;               } else {                   $error_output .= 'This is not an existing youtube video
';               }             } else {               $error_output .= 'This is not an existing youtube video
';             }         } else {               $error_output .= 'This is not an existing youtube video
';         }         $tags = $_POST['post_tags'];              // Add the content of the form to $post as an array         $new_post = array(             'post_title'    => $title,             'post_content'  => $description,             'tags_input'    => array($tags),             'post_category' => array(12),             'post_status'   => 'publish',           // Choose: publish, preview, future, draft, etc.             'post_type' => fod_videos  // Use a custom post type if you want to         );              // If No Errors, Save Post and Redirect //         if ($error_output == null) {             $pid = wp_insert_post($new_post);             update_post_meta($pid,'video_code',$video_url);             wp_redirect( get_permalink($pid));          // If Errors, Return Errors for Display in Template //         }      }      do_action('wp_insert_post', 'wp_insert_post');     }     add_action( 'pre_get_posts', 'video_process_form' );


title: Approach to creating a site with this structure

text: I'm tasked with making a site that has 'families'. Each family has a gallery, a 'region', and a 'name', both of which are searchable upon. My initial thoughts about this were to create a template for a child page of 'Families' that contains 2 custom fields (name and region), and just use some gallery plugin on each page. My question: Is there a better mechanic in Wordpress to solve the problem I'm presenting? I'm a developer, so I see this readily as several tables in a custom CMS that I'd just whip up over the weekend ("6 hours tops, promise!") that would quickly get out of hand, so I'd love to leverage my knowledge of WP to get this done more efficiently.


title: Wordpress cracked? Posts not found in dashboard

text: I just came back to my site from dinner and was unable to find any posts listed in the dashboard. After snooping around, I found that my .htaccess file was modified, and some new files were added to my home directory. I deleted the .htaccess code, and the files (they all started with PE). I see that in the last hour a few posts regarding this have been posted on the wp.org forum site. Is anyone else having trouble with this? Is there any more code for me to delete? thanks.


title: How to exclude "uncategorized" from custom categories widget?

text: The code below if from my WP plugin which gives a filtered listing of categories excluding the "uncategorized" category from display. However, when the user chooses "Show Hierarchy" from the widget setup options, the resulting display includes "uncategorized". Given that I've placed 'exclude_tree' => 1 into the $cat_args array. What am I missing?               class My_Widget_Categories extends WP_Widget {              function My_Widget_Categories() {             $widget_ops = array( 'classname' => 'widget_categories', 'description' => __( "filters out uncategorized categories" ) );             $this->WP_Widget('my_categories', __('my Categories'), $widget_ops);         }              function widget( $args, $instance ) {             extract( $args );             $title = apply_filters('widget_title', empty( $instance['title'] ) ? __( 'Categories' ) : $instance['title']);             $c = $instance['count'] ? '1' : '0';             $h = $instance['hierarchical'] ? '1' : '0';             $d = $instance['dropdown'] ? '1' : '0';                  echo $before_widget;             if ( $title )                 echo $before_title . $title . $after_title;                 $cat_args = array('orderby' => 'name', 'show_count' => $c, 'hierarchical' => $h, 'exclude_tree' => 1);             if ( $d ) {                 $cat_args['show_option_none'] = __('Select Category');                 wp_dropdown_categories(apply_filters('widget_categories_dropdown_args', $cat_args));


title: Page with posts from category doesn't work

text: I'm working on my wordpress site, and I want to have a page that shows all posts from the category 'portfolio' on a separate site. I'm using the following technique: http://codex.wordpress.org/Pages#A_Page_of_Posts However, on my testblog this works fine ( http://dev.litso.com/portfolio-2/ ) but on my live blog it doesn't seem to load the custom pagetemplate portfolio.php ( http://www.stephanmuller.nl/portfolio-2/ ). Instead, it uses the regular page.php template. Both are pages (not posts), use the exact same theme (not even a copy, the same physical theme in a multisite installation), the same custom field 'category' with a value of 'portfolio' and both blogs have at least one entry with the 'portfolio' category. The only difference between the two is that the dev blog does _not_ have the option to choose the page's template (yet it does use the custom Portfolio template). The live site does have this option and it's set to Portfolio of course but when I view the page it uses Page. I can't find out why this is either. Anyone who can help?


title: Site Live Database Operations issues

text: I have a working site on a staging server. The live site is working perfectly, but none of the database operations is working. It doesn't even fire the select query. I have pages in wp_posts tabel and they display as such, but I'm not able to see any pages in wordpress admin panel under "All Pages..." I can't even fetch the menu that I have created. It still shows me the old menu. Does anyone have a suggestion to which the problem might be??


title: get_adjacent_post() function no longer working

text: I have a theme I'm building using _s (underscores.me). It has several Custom Post Types. _s has a next/prev function built into it that returns links for the next and previous posts if any such posts exist. So far, it's been working great. However, I installed a plugin called 'Post Types Order' to re-order posts. When I installed it, the next/prev links went away in the custom post type and was replaced with only a 'next' post link that links to the most recent blog post, no matter what Post Type you're in. It's really strange. The bit of code that works from this is here, starting at line 40: https://github.com/Automattic/_s/blob/master/inc/template-tags.php \- Doing var dump of hte $previous variable outputs bool(false). That's it. I'm at my wits end and any help is appreciated.


title: Apply Classes to post text inside editor

text: I am using a theme that comes with several different font stylings for headers and text. However there is no simple way to apply these classes inside the editor. How can I enable a drop down similar to TinyMCE that allows me to select text and apply a class/style to it in order to have my marketing and sales department style their posts.


title: Get comment content by comment ID

text: So I've been trying for a hour or so now to list comment by it's ID. I've tried the `get_comment($id, $output)` function but it didn't work well, so I went back to whatever is shown below, but it just shows all comments. I want it to show just one comment by it's ID. I can't figure out a way to do it. What am I doing wrong?               $args = array(         'id' => 1,     );          // The Query     $comments_query = new WP_Comment_Query;     $comments = $comments_query->query( $args );          // Comment Loop     if ( $comments ) {         foreach ( $comments as $comment ) {             echo '<p>'.$comment->comment_content.'</p>';         }     }


title: admin-ajax.php nulls all php variables

text: I have a problem in a custom function. The function which adds to the WHERE clause in Store Locator Pro works correctly on its own, but I only want it to only work on a certain page, not on all my other Store Locator pages. Should be simple, get the ID of the page I want it to work on and wrap the filter in a condition               function slp_country_filter($where){         if( $_COOKIE["location_country"] != NULL ) {           $SLPcountry = $_COOKIE["location_country"];           $SLPcountryQuery = "AND (  sl_country = '" . $SLPcountry . "')";         }         else {           $SLPcountryQuery = "AND (  sl_country = 'canada' or sl_country = 'usa' )";         }            return $where . $SLPcountryQuery;     }          $id=get_the_ID();     if($id==613){         add_filter( 'slp_ajaxsql_where' , 'slp_country_filter', 90 );     }      However this doesn't work, and after much investigation it seems that **the variable $id is now NULL**. Even though I can print it out in the header, the variable is reset to NULL by Store Locator Pro's call to admin-ajax.php. I determined this by changing the condition to `if($id==NULL)` and the conditional works. I tried also to store the variable $id in a $_SESSION['SLP_ID'] variable and still the same thing happens. The moment the ajax call is made the variables are all returned as NULL and so the condition is false. Appreciate any ideas on how to work around this. Thanks.


title: Changing stylesheet depending on custom taxonomy terms

text: > My client would like the background & header colors to switch depending on > terms within the custom taxonomy 'Grades'. These terms are kindergarten, > first grade, second grade, etc... (all through twelfth grade) and are > associated with a custom post type 'projects'. > > I've set up the menu so that each term in 'grades' has it's own page. These > are not actual pages that you'd find in the dashboard. These pages are just > an archive-type pages specific to each grade. > > I found a great blogpost regarding contextually changing the stylesheet > depending on the page name ( > http://justintadlock.com/archives/2009/07/27/contextually-changing-your- > themes-stylesheet ). My php understanding is a bit limited and I can't > figure out how to edit this code so that instead of switching stylesheets > because of a page's name, it is triggered by an array of terms within the > custom taxonomy 'grades.' > > I want to switch stylesheets on archive pages for custom taxonomies. The > switch should be triggered by a custom taxonomy's terms. IE: The > Kindergarten page is actually an archive page for 'kindergarten' in the the > custom taxonomy 'grades' I have 13 terms associated with 'grades' > > kindergarten, first grade, second grade, third grade, etc... > > IE: I would like the background image and heading colors to change. Green > for kindergarten, first grade, second grade, third grade... Orange for sixth > grade, seventh grade, eighth grade... Purple for ninth grade, tenth grade, > etc... I found a solution that works only for archive pages and taxonomies: is_tax function.               add_filter( 'stylesheet_uri', 'my_stylesheet', 10, 2 );      function my_stylesheet( $stylesheet_uri, $stylesheet_dir_uri ) {               if ( is_tax( 'grades', array('term_name' => 'Kindergarten', 'First Grade', 'Second Grade', 'Third Grade', 'Fourth Grade', 'Fifth Grade' ) ))         $stylesheet_uri = $stylesheet_dir_uri . '/style-elemen.css';     elseif ( is_tax( 'grades', array('term_name' => 'Sixth Grade', 'Seventh Grade', 'Eighth Grade' ) ))         $stylesheet_uri = $stylesheet_dir_uri . '/style-elemen.css';          return $stylesheet_uri;      }


title: Create child page within custom post type

text: I want to be able to have a link like this, **site.com/my-custom-type- slug/single-custom-post-name/stats/** , where **/stats** should contain the **/my-custom-type-slug** page content and when I add content to the **/stats** page, it should be added after the parent's content. The **/stats** page should be available for every page created within my CPT, for example **/my-custom-type-slug2** , **/my-custom-type-slug3** , and so on, to have the **/stats**. I'm thinking that a solution can be to create a page named **stats** and assign a custom template, but the problem is how can I create the additional content for every new post which I'm creating? This would be easy if I didn't need the comments to be activated because I was doing it like this: Add a custom WYSIWYG field inside my posts with ACF plugin, then create an endpoint:               function wpa121567_rewrite_endpoints(){         add_rewrite_endpoint( 'stats', EP_PERMALINK );     }     add_action( 'init', 'wpa121567_rewrite_endpoints' );      After this my URL would look like this:   `site.com/your-custom-type-slug/single-custom-post-name/stats/` Then in my `single-{cpt}.php` template I can check if the request is for **stats** , and include or output the desired data:               if( array_key_exists( 'stats', $wp_query->query_vars ) ){         // the request is for the comments page     }      else {         // the request is for the main post     }      This solution is not working for me because I can't activate comments on **/stats** because I'm using an endpoint to create it. As a conclusion, what I need is two separate sets of comments for both the parent and "/stats" page. Any suggestions on how to achieve this?


title: Set a default page template to load for multi-site

text: I'm modifying the `install.php` (coping in from `upgrade.php`) file to load default pages that get created with a new blog is registered. Im trying to find out how i can specify the page template that the new page will be assigned. is there anything like `page_template =>?` Ive searched the codex but dont seem to find anything, or i have the wrong syntax idea. current page code by default is:                 $first_page = sprintf( __( "This is an example page. As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!" ), admin_url() );            if ( is_multisite() )             $first_page = get_site_option( 'first_page', $first_page );            $first_post_guid = get_option('home') . '/?page_id=2';         $wpdb->insert( $wpdb->posts, array(                                     'post_author' => $user_id,                                     'post_date' => $now,                                     'post_date_gmt' => $now_gmt,                                     'post_content' => $first_page,                                     'post_excerpt' => '',                                     'post_title' => __( 'Sample Page' ),                                     /* translators: Default page slug */                                     'post_name' => __( 'sample-page' ),                                     'post_modified' => $now,                                     'post_modified_gmt' => $now_gmt,                                     'guid' => $first_post_guid,                                     'post_type' => 'page',                                     'to_ping' => '',                                     'pinged' => '',                                     'post_content_filtered' => ''                                     ));         $wpdb->insert( $wpdb->postmeta, array( 'post_id' => 2, 'meta_key' => '_wp_page_template', 'meta_value' => 'default' ) );


title: remove WYSIWYG editor but keep media button

text: i need to remove the deafault TinyMCE editor from pages, i used this:               remove_post_type_support( 'page', 'editor' );      But it removes also the media button that i need


title: Static raw HTML page

text: On the server there is a static HTML page `example.html` in my root folder of the WordPress install. Now when a user types `www.example.com/example.html` I want WordPress to be smart and bypass all normal routing behavior and instead just display that static `exmaple.html` page. This looks so easy to me concept-wise but I can't find a solution since hours. What exactly do I need to change in my `.htaccess` file? Is it even that `.httaccess` file or do I need to make such a change in the site available file? Sorry for being a WordPress newbie :(


title: Genesis loading of html5shiv for IE8

text: Genesis Framework 2 has built-in support for loading the html5shiv.js, with the _**genesis_html5_ie_fix**_ function (/lib/js/load-scripts.php).   I post the function below. It supposed to print a conditional comment in the head of the document, targeting IE 8 and lower versions.      Loading the website with any other browser, the comment exist in document's head. When I try to load it with IE8, the whole extra block is disappearing, and as a result, IE8 cannot understand the HTML5 tags. If I remove the conditional comment and just leave the script tag, then it works okay, but the extra script is downloading for all browsers. It looks like there must be something with IE8 having problem to parse the comment, or what? *I have to say however that I am only checking IE8 through IE11 simulator (not sure if this is affecting the situation and how).               add_action( 'wp_head', 'genesis_html5_ie_fix' );          function genesis_html5_ie_fix() {          if ( ! genesis_html5() )         return;          echo '<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->' . "\n";          }


title: How to Display HTML Site Images in Directory Above WordPress Installation

text: I have WP in a subdirectory of its own. I have two .htaccess files. The first is in the domain root:               RewriteEngine on     RewriteCond %{HTTP_HOST} ^automaticallynow\.com$ [OR]     RewriteCond %{HTTP_HOST} ^www\.automaticallynow\.com$     RewriteRule ^/?$ "http\:\/\/www\.automaticallynow\.com\/make\-money\-online\/" [R=301,L]      The Second is in the WP install directory:               # BEGIN WordPress     RewriteEngine On     RewriteBase /make-money-online/     RewriteRule ^index\.php$ - [L]          # add a trailing slash to /wp-admin     RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]          RewriteCond %{REQUEST_FILENAME} -f [OR]     RewriteCond %{REQUEST_FILENAME} -d     RewriteRule ^ - [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]     RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]     RewriteRule . index.php [L]          # END WordPress      Within that WP install directory root/wp/ is a multisite network. So the problem is that when I upload html to the root directory, nothing show up right. The links in the files aren't working. Example: http://automaticallynow.com/Offers/WP-Optins-Plugin/index.htm shows text and image placement, but the image links are all broken. The images file folder is here: http://automaticallynow.com/Offers/WP-Optins-Plugin/images/ If you click that link^ and see the image directory listing it lists them all automatically, but clicking them results in broken images. Permissions for the folders are 755 permissions for the images (files) and .htm file are 644.


title: What is the purpose of storing `siteurl` in database?

text: Why does WordPress store 'siteurl' and 'home' in the database? It's driving me crazy because I develop locally, deploy to a staging site, AND to a production site, so that's two-three times I have to go through the database to replace all those values. It seems kind of backwards to store this value, when you can just get it from the URL the site is running from, so I must be missing some context or something. I'd love some solutions where I don't have to search and replace every single time I deploy changes. I want to be able to just copy files and the database and have it work, like literally every other system I use. (Drupal, Laravel, Rails)


title: Post Image not displaying in category view

text: I tried adding an thumbnail sized image in the very first line of the post so that I want my category list search should display with this thumbnail and some text with "read more" button but this image is not displaying in the category list view but its displaying when I click on the post. Is there any way to fix it? I tried many plugins but none worked for me. `add_theme_support( 'post-thumbnails' );` The above line is already active in my site. Thanks.


title: Remove specific category from a post

text: I have enabled categories on attachments, and I am trying to implement the logic to automatically handle the "Uncategorized" category, like this: 1) If the attachment has no categories, set it to "Uncategorized" 2) If the attachment has some category besides "Uncategorized", remove "Uncategorized" from the post's category list I have tackled most of the logic, except that now I dont know how to remove the category from the Attachment. This is my code:               <?php          // Enable categories with attachments     register_taxonomy_for_object_type( 'category', 'attachment' );          if( is_admin() ) {              add_action('add_attachment', 'emt_set_attachment_category');         add_action('edit_attachment', 'emt_set_attachment_category');         function emt_set_attachment_category( $post_ID ) {                  $attachmentCategories =  wp_get_object_terms( $post_ID, 'category' );                  // if attachment has many categories, remove the default category             if (count($attachmentCategories) > 1) {                 foreach ($attachmentCategories as $key => $category)                     if ($category->name == "Uncategorized")                         // How to delete it??                      return;             }                  // if attachment already have categories, stop here             if (count($attachmentCategories) == 1)                 return;                  // if attachment has no categories, set default category             wp_set_post_categories( $post_ID, array( get_option('default_category') ) );         }     }


title: why quotes shown in Wordpress?

text: I have written a function to register a script in the admin interface.               function custom_admin_js() {         $url = get_bloginfo('template_directory') . '/admin/admin.js';         echo '<script type="text/javascript" src="'. $url . '"></script>';     }     add_action('admin_footer', 'custom_admin_js');      For some - for me unknown reason - this creates additional quotes surrounding the script.               "<script type="text/javascript" src="http://test121.uphero.com/wp-content/themes/news/admin/admin.js"></script>"      How do I remove the surrounding quotes?


title: Subdomain Wp-Admin Not Found

text: I enabled the MultiSite option using the instructions on the WordPress site (``mandeltech.com), and now I am trying to create a subsdomain for WooCommerce (`shop.mandeltech.com`). I created the subdomain with cPanel, and then added it to my site through My Sites --> Network Admin --> Sites --> Add Site menu. All of the settings worked, except I can't access the dashboard. Using the dashboard link from the My Sites menu, I go to `http://shop.mandeltech.com/wp-admin/`. This gives me a 404 Error, because that page does not exist. Through the cPanel file manager, the `shop` directory under `public_html` only has a `cgi-bin` folder. This makes sense, as I haven't specifically added anything. However, I'm not sure where to go from here. I want both `shop.mandeltech.com` and `mandeltech.com` to share the same WP installation and database, but I can't access the WP-Admin page yet. Do I have to install WordPress for this subdirectory? This would create another installation, so it doesn't seem like the correct way to go. So, how can I allow this subdomain to have the same WP installation but also access its dashboard? Thanks!


title: How to arrange different post categories in template

text:
I'm playing with WordPress for sometime. In my website, there will be 3 possible categories for posts, like: 'offer', 'news' and 'about' (each category with individual content). My attempt is to create header navigation, providing liks for each category, and within category some custom sidebars. Currently, I'm working on news category, where sidebar should contain months and year, and content itself. I based my template pages on slug, therefore I have `category-news.php` and `sidebar-news.php`. Everything looks great, navigation menu has link to `/category/news-page`, where my sidebar works: **sidebar-news.php**

<?php _e( "AktualnościNews" );?>
                  <?php wp_get_archives( array(             "type" => "monthly",             "echo" => 1,             "order" => "DESC"         ) ); ?>

      **category-news.php**               <?php get_header(); ?>

<?php _e( "AktualnościNews" );?>

         <?php get_sidebar("news"); ?>

                 <?php while ( have_posts() ) : the_post() ?>                 <?php endwhile; ?>

     <?php get_footer(); ?>      My problem is that links generated by code above `wp_get_archives` points to pages like `/2013/12` etc., while I'd like then to have `/category/news- prefix`, so that they'd be under one template. How can I achieved that? How can I then highlight currently selected month?


title: Display tags & categories seperatly

text:
When I called `the_taxonomies()` function it shows me both tags and categories. I need tags to show from `the_tags()` function. At the moment I haven't included `the_tags()` but shows me the tags through `the_taxonomies()`. Because of this I'm unable to style them separately. ![image showing my problem in detail](http://i.stack.imgur.com/dRWnS.jpg)               <?php query_posts( 'post_type=blog'); ?>      <?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
         <?php the_content("Read more"); ?>
Date: <?php the_date();?> <?php the_taxonomies(); ?>
         ...     <?php endwhile; ?>