title: Fatal error: Allowed memory size of bytes exhausted (tried to allocate 36 bytes)

text: I' fetching some information from my website e.g `category_name`, `category_id` etc. with wordpress codex and encode them with json. I'm using them in my android application, but today, suddenly, it gave Fatal error, I can't get any data now. Error : > Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to > allocate 45 bytes) in C:\WT-NMP\WWW\wp-includes\wp-db.php on line 1565 Here are the codes (it is giving error) :               if(isset($_GET['ana_kategori'])){              $rules=array(             'parent'=>0,         );              $categories = get_categories($rules);              if($categories){                  foreach($categories as $category) {                 if((($category->term_id)!=1)) {                     $postsrules = array(                         'posts_per_page' => -1,                         'category' => $category->cat_ID,                         'post_status'=> 'publish'                         );                          foreach ( $myposts as $post ) {                              $videoimg=get_post_meta( $post->ID);                         if($videoimg['small_icon']!=null) {                             $videoimg=$videoimg["small_icon"];                             break;                         }                     }                          $output[]=array(                         'Category_Name'=>$category->name,                         'Term_ID' => $category->term_id,                         'Image' => $videoimg[0],                         );                      $videoimg[0]=null;                 } // if             } // foreach                  echo json_encode($output);              } // first if     }      I changed the `memory_limit` in php.ini to `512M` but it didn't work. So I've changed again, `8096M`, still the same. I'm using the same algorithms as it. They are working great, but this is not working. Any suggestions to what my problem might be?


title: Can't get permalinks working!

text: I can't get WordPress pretty permalinks to work on my Fedora LAMP server. If I set them and click a page/post link I'll get a ""Oops! This link appears to be broken."   * The .htaccess file is writable and being updated,    * mod_rewrite module seems to be loaded in my httpd.conf (See below)   * The errors in my apache log say simply "Document not found". I'm at the end of my rope! Here's the **httpd.conf** :               ### Section 1: Global Environment          # start the rewrite engine (I ADDED THIS)     RewriteEngine on           ServerTokens OS          ServerRoot "/etc/httpd"          PidFile run/httpd.pid          Timeout 120          KeepAlive Off          MaxKeepAliveRequests 100          KeepAliveTimeout 15          <IfModule prefork.c>     StartServers       8     MinSpareServers    5     MaxSpareServers   20     ServerLimit      256     MaxClients       256     MaxRequestsPerChild  4000     </IfModule>               <IfModule worker.c>     StartServers         2     MaxClients         150     MinSpareThreads     25     MaxSpareThreads     75      ThreadsPerChild     25     MaxRequestsPerChild  0     </IfModule>          #     # Listen: Allows you to bind Apache to specific IP addresses and/or     # ports, in addition to the default. See also the <VirtualHost>     # directive.     #     # Change this to Listen on specific IP addresses as shown below to      # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)     #     #Listen 12.34.56.78:80     Listen 80          LoadModule auth_basic_module modules/mod_auth_basic.so     LoadModule auth_digest_module modules/mod_auth_digest.so     LoadModule authn_file_module modules/mod_authn_file.so     LoadModule authn_alias_module modules/mod_authn_alias.so     LoadModule authn_anon_module modules/mod_authn_anon.so     LoadModule authn_dbm_module modules/mod_authn_dbm.so     LoadModule authn_default_module modules/mod_authn_default.so     LoadModule authz_host_module modules/mod_authz_host.so     LoadModule authz_user_module modules/mod_authz_user.so     LoadModule authz_owner_module modules/mod_authz_owner.so     LoadModule authz_groupfile_module modules/mod_authz_groupfile.so     LoadModule authz_dbm_module modules/mod_authz_dbm.so     LoadModule authz_default_module modules/mod_authz_default.so     LoadModule ldap_module modules/mod_ldap.so     LoadModule authnz_ldap_module modules/mod_authnz_ldap.so     LoadModule include_module modules/mod_include.so     LoadModule log_config_module modules/mod_log_config.so     LoadModule logio_module modules/mod_logio.so     LoadModule env_module modules/mod_env.so     LoadModule ext_filter_module modules/mod_ext_filter.so     LoadModule mime_magic_module modules/mod_mime_magic.so     LoadModule expires_module modules/mod_expires.so     LoadModule deflate_module modules/mod_deflate.so     LoadModule headers_module modules/mod_headers.so     LoadModule usertrack_module modules/mod_usertrack.so     LoadModule setenvif_module modules/mod_setenvif.so     LoadModule mime_module modules/mod_mime.so     LoadModule dav_module modules/mod_dav.so     LoadModule status_module modules/mod_status.so     LoadModule autoindex_module modules/mod_autoindex.so     LoadModule info_module modules/mod_info.so     LoadModule dav_fs_module modules/mod_dav_fs.so     LoadModule vhost_alias_module modules/mod_vhost_alias.so     LoadModule negotiation_module modules/mod_negotiation.so     LoadModule dir_module modules/mod_dir.so     LoadModule actions_module modules/mod_actions.so     LoadModule speling_module modules/mod_speling.so     LoadModule userdir_module modules/mod_userdir.so     LoadModule alias_module modules/mod_alias.so     LoadModule rewrite_module modules/mod_rewrite.so     LoadModule proxy_module modules/mod_proxy.so     LoadModule proxy_balancer_module modules/mod_proxy_balancer.so     LoadModule proxy_ftp_module modules/mod_proxy_ftp.so     LoadModule proxy_http_module modules/mod_proxy_http.so     LoadModule proxy_connect_module modules/mod_proxy_connect.so     LoadModule cache_module modules/mod_cache.so     LoadModule suexec_module modules/mod_suexec.so     LoadModule disk_cache_module modules/mod_disk_cache.so     LoadModule cgi_module modules/mod_cgi.so          #     # The following modules are not loaded by default:     #     #LoadModule cern_meta_module modules/mod_cern_meta.so     #LoadModule asis_module modules/mod_asis.so          Include conf.d/*.conf          User apache     Group apache          ### Section 2: 'Main' server configuration               ServerAdmin root@localhost          UseCanonicalName Off          DocumentRoot "/var/www/html"          <Directory />         Options FollowSymLinks         AllowOverride None     </Directory>          <Directory "/var/www/html">                   Options Indexes FollowSymLinks                   AllowOverride None                   Order allow,deny         Allow from all          </Directory>               <IfModule mod_userdir.c>              UserDir disabled          </IfModule>               DirectoryIndex index.html index.html.var          #     # AccessFileName: The name of the file to look for in each directory     # for additional configuration directives.  See also the AllowOverride     # directive.     #     AccessFileName .htaccess          <Files ~ "^\.ht">         Order allow,deny         Deny from all     </Files>          TypesConfig /etc/mime.types          DefaultType text/plain          <IfModule mod_mime_magic.c>     #   MIMEMagicFile /usr/share/magic.mime         MIMEMagicFile conf/magic     </IfModule>          HostnameLookups Off          ErrorLog logs/error_log          CustomLog logs/access_log combined          ServerSignature On          Alias /icons/ "/var/www/icons/"          <Directory "/var/www/icons">         Options Indexes MultiViews FollowSymLinks         AllowOverride None         Order allow,deny         Allow from all     </Directory>          <IfModule mod_dav_fs.c>         # Location of the WebDAV lock database.         DAVLockDB /var/lib/dav/lockdb     </IfModule>          ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"          <Directory "/var/www/cgi-bin">         AllowOverride None         Options None         Order allow,deny         Allow from all     </Directory>               IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8          ReadmeName README.html     HeaderName HEADER.html          IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t          AddDefaultCharset UTF-8          AddType application/x-compress .Z     AddType application/x-gzip .gz .tgz          AddType application/x-x509-ca-cert .crt     AddType application/x-pkcs7-crl    .crl          AddHandler type-map var          AddType text/html .shtml     AddOutputFilter INCLUDES .shtml               Alias /error/ "/var/www/error/"          <IfModule mod_negotiation.c>     <IfModule mod_include.c>         <Directory "/var/www/error">             AllowOverride None             Options IncludesNoExec             AddOutputFilter Includes html             AddHandler type-map var             Order allow,deny             Allow from all             LanguagePriority en es de fr             ForceLanguagePriority Prefer Fallback         </Directory>               </IfModule>     </IfModule>               #     # Proxy Server directives. Uncomment the following lines to     # enable the proxy server:     #     #<IfModule mod_proxy.c>     #ProxyRequests On     #     #<Proxy *>     #    Order deny,allow     #    Deny from all     #    Allow from .example.com     #</Proxy>          #     # Enable/disable the handling of HTTP/1.1 "Via:" headers.     # ("Full" adds the server version; "Block" removes all outgoing Via: headers)     # Set to one of: Off | On | Full | Block     #     #ProxyVia On               NameVirtualHost *:80               <VirtualHost *:80>      # start the rewrite engine      RewriteEngine on      ServerName www.example.com      DocumentRoot /var/www/html/com_example_www     </VirtualHost>


title: SyntaxHighlighter Evolved not showing vertical and horizontal scrollbars

text: When I use SyntaxHighlighter Evolved I cannot see the horizontal and vertical code scroll bars (I use Google Chrome browser). Do you know how to fix this? Any other code snippets to suggest for WordPress? Thanks!


title: Make separate text boxes for separate WordPress Custom Fields

text: I am trying to make usability of WordPress custom fields admin easier in my theme. I saw it in ElegantThemes' eStore theme. Only I couldn't figure out how to do it in my custom theme because I couldn't find the code in eStore theme files. I use custom fields for my featured images and it's small thumbnail version. I have to upload both those pictures and from up above on the page, right below the title, copy the link and then choose the right custom key in custom fields below and paste it and the add it. Then repeat the process for another image. ![enter image description here](http://i.stack.imgur.com/VDDjN.png) I wanna make it simple. Make two text boxes and place the upload image button in front of them. As in the image below. ![enter image description here](http://i.stack.imgur.com/4PH9t.png) If possible I even wanna automate the copy and paste process. i.e.: The image link for the full size image automatically shows up in the text box on upload. Even elegant themes doesn't do that, but I would love to. Any ideas on how I can do this. This will make the posting just a bit faster and more importantly make explaining the process to writers much much easier. I am still looking into the code if I can find it. Any help would be greatly appreciated. Thanks in advance.


title: Is there any way to ftp into wordpress if I paid for my own domain? I want to set up google analytics

text: I am quite confused. I have my own host for wordpress that I paid for, and I want to be able to ftp into my files to manually edit them. I know wordpress does not support or allow ftp, but I see a lot of people doing it on privately hosted domains: Here is an example that assumes you can ftp in I am trying to use FireFTP to do this, but I have been unsuccessful. Please let me know if this is possible, I really want google analytics :) Thanks, tylerthemiler


title: How to order custom posts type by number of facebook likes

text: I have a custom post type called "quotes" and I want to order these posts by facebook likes in the category page. How can I do this? Thanks.


title: WP_Error not displaying errors

text: I am trying to utilize WP_Error for my plugin, but nothing happens. Is this too late for WP_Error? Too early? Or am I doing something else wrong?               function cpt_pre_post_publish(){         return new WP_Error('error', __('Error!' ));     }          add_action('pre_get_posts', 'cpt_pre_post_publish');


title: Improved WordPress search functionality and search form plugin

text: I want to make the default WordPress behave better. For instance, if I add categories such as: "best products", "good products" and more then the search should be able to account for those and return them higher in the results. I know there are some plugins which can improve the search query like to be able to search through tags, custom taxonomies like "Search everything". In short what I need is to be able to get tags from custom post types or blog posts to act like categories for the search form, perhaps an advanced search with a drop down list with some tags. Do you know a plugin which can help me do this?


title: How to query for posts (in hierarchical custom post type) that have children?

text: I'm trying to figure out how to query for posts in my hierarchical custom post type, presumably using WP_Query that have child posts. I can get all pages that don't have children by setting `'post_parent' => 0` in my WP_Query args, but that returns all posts that are not children. I need only posts that have child posts.


title: Setting Variable Path to Template Directory inside Script

text: I have **HTML5 Template** with 5 pages. I am converting it to a **WordPress Theme**. I have a contact page. This page includes 'forms.js' script to send contact form data to 'MailHandler.php' file. Inside the 'forms.js' script there is a variable I want to change,               mailHandlerURL:'bat/MailHandler.php'      How do I change this to something like the following?               mailHandlerURL:<?php echo get_template_directory_uri(); ?>'/bat/MailHandler.php'      The PHP is not working inside this script. Please help.


title: Related posts by searching post tags of single post as terms

text: I want to have a related loop of posts on single post pages and to do this I want to search the tags of the post. My first question is can you use the search in query posts for multiple terms and what is correct way to do this. This is what I've been trying that is not working.               global $post;     $tags = wp_get_post_tags($post->ID);     $tag_ids = array();     foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;     $args = array('cat' => '8', 'posts_per_page' => 8, 's' => $tag_ids,);     $my_search = new WP_Query($args);     if ($my_search->have_posts()) : while ($my_search->have_posts()) : $my_search-  >the_post(); ?>


title: Checking for published posts in a certain post type

text: I run a website for a company with a careers section, with each vacancy posted as a custom post type. When vacancies are available, ie a post type of "vacancy" is published, we want to display a ribbon in the top corner, directing people to the careers page. To check for published posts obviously I could get_posts for that post type, but that seems a bit inefficient as I'll be battering the database on every page load to check. Is there any more DB efficient way of doing this, kind of like a have_posts( 'post_type=vacancy' ) ?


title: Search not working. Appending a "<?" to the search

text: I entered this code in my footer widget, and the search box finally showed up:               <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">     <div>     <input type=”text” value="<?php the_search_query(); ?>" name="s" id="s" />     <input type="submit" id="searchsubmit" value="Search" />     </div>     </form>      But when I run a search, a `<?` gets appended to the query, resulting in a page not found error. Even removing the `<?` doesn't bring me to a results page. To me, the php code appears ok. I doublechecked and have searchform.php in the same folder as the rest of my page templates. This is on http://dsiinfo.webfactional.com I've done several searches and have spent a couple of hours and this but can't figure out what's causing the problem. Thanks!


title: How to put enctype="multipart/form-data" in categories form?

text: I had success putting the code below to include enctype (for images) in custom post type forms, but I'm not able to use it in categories form... is this possible? Thanks.               add_action( 'post_edit_form_tag' , 'post_edit_form_tag' );          function post_edit_form_tag( ) {         echo ' enctype="multipart/form-data"';     }


title: How to Make a Custom Dashboard Widget to Display Custom Notification from Admin?

text: I am looking for a way to achieve the following:   1. A group of users 'students'    2. They login to the site   3. Each student can see a 'Custom Dashboard Widget(s)'   4. Each widget will carry a personal message wrote by Admin for that logged-in student. Such as A] Total Days in the course B] Total attendance C] paid & due fees. Is it possible with WP or should we look for another CMS to achieve these?


title: Show specific page on main index instead of latest

text:
There are 3 latest pages displaying on my WP. Here's the code.
     <?php         $temp = $wp_query;         $wp_query= null;         $wp_query = new WP_Query();         $wp_query->query('showposts=3'.'&paged='.$paged . '&post_type=page' );     ?>     <?php //query_posts('showposts=3'); ?>     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
         <?php $image = get_post_meta($post->ID, 'Image', true); ?>             <a href="<?php the_permalink(); ?>">                 <img class="post_image" width="251" height="292" src="<?php echo $image; ?>" alt="" />
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>

      I want to put 3 specific pages that I want on the main index page. How do I make it so?


title: Set featured image size for a custom post type

text: I have a custom post type, and I'm adding support for thumbnails (featured image)                       register_post_type('cp_companies', array(                 'labels' => array(                     'name' => __('Companies'),                     'singular_name' => __('Company')                 ),                 'public' => true,                 'has_archive' => true,                 'supports' => array('thumbnail', 'title', 'editor')                     )             );      This is not a theme. This is a plug-in. What I want to do is simply limit (120x120) the size of the featured image.


title: HTTP Error when uploading images

text: I am getting an 'HTTP Error' when uploading images to posts. What could be the reason for this? It doesn't happen all the time, sometimes I get the error, try again, and the file uploads. Actually the file always seems to upload, however it doesn't generate the different sized images or anything.


title: How do you create a custom template to display a category with an image and related posts below?

text: I am trying to create a custom template that can give the following effect...   * Category Name A (with image)     * post with category name A     * post 2 with category name A     * post 3 with category name A   * Category Name B (with image)     * post with category name B     * post 2 with category name B     * post 3 with category name B Should I do this with custom post types? If so, do I have create two, or can I manage this with one custom post type?


title: Rewrite rules for using the same base slug for multiple content types

text: I'm not sure if this is possible or not, but here is what I'm trying to achieve. I'm using WooCommerce, and I have it setup to prepend a base slug and the product category to my product permalinks. So, my product permalinks look like this: `example.com/shop/%product_category%/%product_slug%` Now, I want to create another post type called "gemstone" that uses the `shop` base page in its permalinks, so they would look like this: `example.com/shop/gemstone/%gemstone_slug%` The problem is that all of the gemstone pages 404. This is because their URLs are rewritten so that "gemstone" is assumed to be the `%product_category%` and the `%gemstone_slug%` is assumed to be the `%product_slug%`. I'm having trouble thinking of a way around this, but URL rewriting is pretty new to me. Anyone have any thoughts? As a bonus, another problem with the product permalinks is that their attachment pages (e.g. `example.com/shop/%product_category%/%product_slug%/%attachment%`) all 404 as well. For reference, I have opened a bug ticket for the attachment page issue on the WooCommerce github.


title: How can I modify wp_nav_menu with walker?

text:
I would like my wp_nav_menu to output in the format for jquery ui:
Section 1

     Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer     ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit     amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut     odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Section 2

     Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet     purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor     velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In     suscipit faucibus urna.

      The list has two levels. I've successfully changed the top level, but I'm having trouble with the second level. How can I do this? Is there an easier way than extending the walker class?


title: After activating a Plugin, /wp-admin is no longer accessible

text: After installing/activating AWPCP (Another Wordpress Classified Plugin), when I type wp-admin/ I get a blank page but with /wp-login.php the login appears. I this there's a problem with redirection or .htaccess with that plugin but I can't find out what it is.


title: Force image rename based on post title for the following script

text:
I am looking to have this upload rename image titles to match the post title. So instead of 0182012018228_sometitle.jpg it would be like daves-and- busters.jpg and the next file call daves-and-busters-1.jpg. Possible?                   <?php /*     Template Name: Uploading Page          */?>          <?php get_header();     ?>

         <form id="file-form" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
         upload         <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload">

         <input type="hidden" name="post_id" id="post_id" value="<?php echo '212';?>" />         <?php wp_nonce_field('client-file-upload'); ?>         <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />

         <input type="submit" value="Save all changes" name="save" style="display: none;">
         </form>          <?php     if ( isset( $_POST['html-upload'] ) && !empty( $_FILES ) ) {         require_once(ABSPATH . 'wp-admin/includes/admin.php');         $id = media_handle_upload('async-upload', 1199); //post id of Client Files page         unset($_FILES);         if ( is_wp_error($id) ) {             $errors['upload_error'] = $id;             $id = false;         }              if ($errors) {             echo "
There was an error uploading your file.
";         } else {             echo "
Your file has been uploaded.
";         }     }          get_sidebar();     get_footer();?>


title: Author url rewrite

text: The default author permalink is:               http://domain.com/author/{username}      How can I do something like this ?               http://domain.com/author/{username}/songs      http://domain.com/author/{username}/books     http://domain.com/author/{username}/movies      If someone visit songs permalink, wp should display songs of the respective author. If someone visit books permalink, wp should display books of the respective author, and so on! Any idea about how can I do this !? **Later edit** mySQL table: favs   * id   * post_id   * author_id   * fav_type (song, book, movie)


title: Wordpress as template engine

text: i would like to use Wordpress as template engine in my custom bootstrap/zurb foundation sites. I found there's lot of custom styles included in wordpress articles by default. Are there any ways how to get 'pure'(not formatted) content from wordpress ? Would be cool to use lightweight customized,mobile friednly website powered by wordpress in 'backend'.


title: Admin plugin, how can I output a different content-type?

text: I'm creating a plugin with an admin page that needs to:   * stream a file for download (set content-type & other headers)   * display HTML without the admin menu etc In both of these cases the 'pages' **must** be accessible only to logged in administrators. So far I've found one way to accomplish both of these, by including wp-blog-header.php in a php file, checking the user is an admin and doing things myself from then on, as below.               require('../../../wp-blog-header.php');          if (!current_user_can('administrator'))     {         wp_die( __('You do not have sufficient permissions to access this page.') );     }           ...set headers & stream file      Is there a better way of doing this? Is there any reason I shouldn't do it this way? Thanks :)


title: See which user installed a plugin?

text: Are there any DB entries made when a plugin is installed, and if so does this indicate which user did so?


title: WordPress on WP7

text: Is there an app for the Windows Phone (7) that allows submission to WordPress? Having used the WordPress app on the Blackberry, I'm looking for one that is similar to that, but for the WP7. I've had a look and not found anything, though there are rumours (potentially unsubstantiated) that one is being created..


title: is there import_id parameter for wp_insert_term to create custom id for category

text: is there option to create category with custom id like custom post id is created using parameter import_id ? `$post = array( 'post_title'=>'whatever', 'post_content'=>'whatever', 'import_id'=>123 ); wp_insert_post($post); ` what i want to do is create custom post type ( will import data from table which have category id attached ) using wp_insert_post so i want to create categories with custom id that are attached to products table right now i'm using custom field added to categories as OLD_CATEGORY_ID and get posts against this custom field id categories are also imported to wordpress or is there another better way ? or this is the ONLY way ? :)


title: wpdb->insert adds too many rows

text: I have the following code in my `functions.php`               $ar = array(         'price_content' => 'hello'         );          $result = $wpdb->insert('hs_prices', $ar); // insert 'hello' into 'price_content'      This should just create one row, but it creates 12 in the database. I am on the homepage of the website when I run this (by refreshing the page). Could this be because the code is in `functions.php`, and it's being included 12 or so times throughout the site? **edit:** It shouldn't be because it's in `functions.php`, as it also does it when on `index.php`. Must be the query. What could be the cause of this?


title: Custom menu breaks down

text: This code : http://icodesnip.com/snippet/php/wordpress-show-custom-types-in- categories .. achieves its purpose which is to make category page work with a custom post type, but in my case it also destroys my custom menu, that is, my custom menu is empty. I want my custom menu AND my category page to work.


title: Adding elements to wp_list_pages (within <li>, but before <a>)

text:
I'm working on my first wordpress theme and I'm running into some trouble. I'd like to add an extra div (which I'll style in css) within each `<li>`, but _before_ the actual `<a ... >` element In my theme, I'm using `wp_list_pages('&sort_column=menu_order&link_before=<div></div>&title_li=');`, which results in _almost_ what I want, but not quite. The out put I get from the method call above results in this:

Page Name A

Page Name B
      as you can see, this places the `<div>` within the `<a>` and not before it. I've tried using the CSS :before selector to do what I want, but it won't work in this instance because I am adding some styles to the `<li>`and `<a>` elements (some light skews) that I don't want to actually affect the new area that this makeshift div will use. (I've already tried reversing the skews and it didn't work for the :before selector) I've also tried using a hacky regex to get this done: `echo preg_replace("/>\s*<a/i", "><div></div><a", (string)wp_list_pages('&sort_column=menu_order&title_li='));` but that still didn't work (which really puzzled me). I know this is kind'of odd, so any help is greatly appreciated!


title: Dynamic filtering of posts with custom taxonomies

text: I am currently trying to make a business directory where the users can filter the results by:   1. Type of service   2. County I am using a custom post type for the business directory, and I have created 2 custom taxonomies:   1. Type of service - works like a category   2. County - works like tags I need a dynamic query that will let my users first choose a type of service, then choose a county and then get a list of results - or the other way around; they choose a county first and then a type of service. Is this possible? Or do I have to do this with categories and sub-categories?


title: Loop through widgets in sidebar

text: I have a sidebar called footer, I know I can use dynamic_sidebar() but I need to be able to split that into individual widgets. I have the following so far which gives me the widget name e.g. text-1, category-2 etc but I am after the content for each of those.               $widget_list= get_option('sidebars_widgets');     if($widget_list)      foreach($widget_list["footer"] as $widget){       var_dump($widget);      }      Is this possible to get the widget content from the widget name?


title: How to force a query conditional?

text:
There is a long-standing WordPress core bug (#16373) in which, if custom query variables are registered and present in the query string, the query will not set `is_front_page()` true, even if `'page' == get_option( 'show_on_front' )`. Full details are in the trac ticket, but the end result is that the front page returns an invalid page instead of `get_option( 'page_on_front' )`. I have a certain use case in which I need to pass custom query variables to the query string on the front page (using a form to pass registered query variables, which are in turn used to filter Theme options - a front-end Theme options demo). The above-mentioned trac ticket was closed as invalid, so I need a work-around. I can force the front page template easily enough, like so:               function themeslug_force_front_page_template( $template ) {         if ( '' != get_query_var( 'foobar' ) ) { // Registered custom query var             return get_front_page_template();         }         return $template;     }     add_filter( 'template_include', 'themeslug_force_front_page_template' );      However, the underlying query conditionals are not impacted. So any code dependent on `is_front_page()` being `true` (such as, say, a slider that only displays on the site front page) will still not render properly. I have attempted to modify `$query` at `pre_get_posts`, but this does not appear to be working:               function themeslug_force_static_front_page( $query ) {         if ( $query->is_main_query() ) {             if ( 'page' == get_option( 'show_on_front' ) ) {                 if ( '' != get_query_var( 'foobar' ) ) { // Registered custom query var                     $query->set( 'page_id', get_option( 'page_on_front' ) );                     $query->set( 'is_home', false );                     $query->set( 'is_page', true );                     $query->set( 'is_front_page', true );                 }             }         }     }     add_action( 'pre_get_posts', 'themeslug_force_static_front_page' );      The query conditionals are not modified. Am I attempting incorrectly inside my callback? Is there a different/better way to force the query conditionals, in particular `is_front_page()`? ## Edit Note that setting the `page_id` **does** work in the `pre_get_posts` callback:               $query->set( 'page_id', get_option( 'page_on_front' ) );      If I omit the `template_include` filter, the displayed page is, indeed, the page assigned to the front page; however, `get_page_template()` is used, rather than `get_front_page_template()`. So, setting `page_id` at `pre_get_posts` does cause `is_page()` to be true. But the aforementioned bug prevents `is_front_page()` from being set to `true`. ## Edit 2 Per @toscho's request, here's some query var code, for context. Register query variables:               /**      * Add options-related query variables      */     function themslug_add_theme_demo_query_vars( $qvars ) {         $qvars[] = 'demo_foo';         $qvars[] = 'demo_bar';         $qvars[] = 'demo_baz';         return $qvars;     }     add_filter( 'query_vars', 'themeslug_add_theme_demo_query_vars' );      (Where `foo`, `bar`, and `baz` are Theme options - background, various colors, etc.) How they are used is simply to add a filter to a Theme option - that part is out of the scope of the question, so I'll omit it here. They are output on the front end via custom Widget. The Widget output is just a form. Here's an example of one of the form fields:
Foo
     <input name="demo_foo" id="demo_foo" class="pickcolor"  type="text" value="<?php echo $foo_setting; ?>" data-default-color="<?php echo $foo_setting; ?>" />      Generated query string on-submit:               www.example.com/?foo=some_value


title: Get posts from taxonomy URL

text: How can I get the posts from a custom taxonomy using the URL to determine which taxonomy term id is being shown? I tried to get posts via a category using `get_category_by_path` which returned false when passing the URL because the custom taxonomy isn't the same. Is there an equivalent function which will do this for taxonomies? I've google and scanned the Wordpress codex and found nothing. Many Thanks


title: Combining Post Thumbnails With Nivo Slider

text: I am wanting to use the post thumbnail with the nivo slider and for it to generate the image from a custom image size (already declared in my functions file) I wrote this (for generating the images)               <img src="<?php the_post_thumbnail(); ?>" data-thumb=""<?php the_post_thumbnail('sliderimage')> title="" />      It doesnt seem to load the images, however if i take away the image tags etc it works. Can the above be achieved this way so that it auto generates the thumbnails and loads the images?


title: Minimalistic schedular

text: I've been looking at schedulers and appointment maker plugins the last few days, but so far haven't found anything suitable. So thought I'd ask, Basically I just want to be able to list a loads of dates for scheduling games and practices in the admin section and then to display say the next 5 - 10 games and practices on the home page in their own little discreet section/sidebar/widget. Something like this is what I'm after at this site hcusoccer.ca/ at the bottom on the right. Does anyone know of anything that may be good? Everything i've come across so far is probably a bit to big and advanced. Does anybody have any good ideas? Thank you


title: Successful or Error Message after running mysql code in functions.php

text: Just for this article, suppose there is a code that I want to run on my WordPress' functions.php file. It's a code to delete mysql table on my database. For example, here's the code:               $wpdb->query( "     DELETE FROM $wpdb->posts     WHERE anything = 'whocares'     " );      The code works, but I want to show a Successful or Failed message after running the code. I also have a code which shows the success message after running, which is here:               function remove_contributors() {         global $wpdb;         $args = array( 'role' => 'Contributor' );         $contributors = get_users( $args );         if( !empty($contributors) ) {             require_once( ABSPATH.'wp-admin/includes/user.php' );             $i = 0;             foreach( $contributors as $contributor ) {                 if( wp_delete_user( $contributor->ID ) ) {                     $i++;                 }             }             echo $i.' Contributors deleted';         } else {             echo 'No Contributors deleted';         }     }     remove_contributors();      Tell me how I can do it in my simple code. Thanks for the time!


title: Advanced Custom Fields Plugin - not displaying images

text: I installed the plugin and assigned it to the relevant page but the problem is that the custom fields display 'no image selected' after I have uploaded them and do not appear on the relevant page. Any ideas? For reference, I have set 'Page Template' as equal to 'Home' (the relevant page) on the custom fields rules. This is the code I am using to call the image on the template:               <img src="<? the_field ('image_2'); ?>" class="middle" alt="image2"/>


title: Advanced Search by minimum/maximum values

text: I'm building an advanced search form which allows me to search by different parameters. Currently, searching by taxonomies work fine. My issue occurs with trying to set a minimum price to search by. Here's the code in my functions.php file:               function advanced_search_query($query) {         if ($query->is_search) {             $query->set('post_type', array( 'properties' ));                  if (isset($_GET['propertyfor'])) {                 $query->set('taxonomy', 'propertyfor');                 $query->set('terms', $_GET['propertyfor']);             }                  if (isset($_GET['propertytype'])) {                 $query->set('taxonomy', 'propertytype');                 $query->set('terms', $_GET['propertytype']);             }                  if (isset($_GET['minPrice'])) {                 $query->set('meta_query', array(                     'key' => 'shru_price',                     'value' => $_GET['minPrice'],                     'compare' => '>=',                     'type' => 'NUMERIC'                 ));             }         };         return $query;     };     add_filter('pre_get_posts', 'advanced_search_query', 1000);      As you can see, I'm trying to use a meta query to handle it but nothing is happening. The minimum price is completely ignored when displaying results. Anyone know how to fix? Edit: FYI, the numeric values are stored in the database without any special characters. UPDATE: It works for the following, where i set a min and max value and use BETWEEN:                   if (isset($_GET['minPrice']) && isset($_GET['maxPrice'])) {             $query->set('meta_query', array(                 array(                     'key' => 'shru_price',                     'value' => array($_GET['minPrice'], $_GET['maxPrice']),                     'compare' => 'BETWEEN',                     'type' => 'NUMERIC'                 )             ));         }      but not for what I originally posted where only one is set and i use `>=` or `<=`. I used elseif statements between each but still no results were being produced.


title: Private replies for comments

text: Currently in the Comments section, if you (the admin) wants to reply to a pending comment, perhaps to warn them or whatever, the only way to send the reply is by clicking 'Approve and Reply'. Is there a way to send a private message to the submitted email address (besides manually writing an email) before approving the comment?


title: Problem with custom function from jQuery slider tutorial

text: I found the perfect slider for my needs, the only issue now that is that I cannot get it to work correctly. Problem that occur is that the function created doesn't work like it should. It ought to display three posts from a specific category but it ends up pushing more posts, presumedly via the loop in the function. And the slider effect won't work at all - probably because of this. Check the url below. It's step 2, at the bottom. The code for slideshow_featured_posts. I have a feeling something is missing in the code, because I already see that we're missing php-tags in it. But I can't see what. Can anyone who knows this better than me help out? http://www.paddsolutions.com/how-to-integrate-jquery-cycle-plugin-to- wordpress-theme/


title: Passing JSON-encoded HTML from Wordpress to JavaScript

text: I'm trying to pass a post's content (which may contain HTML) to JavaScript via wp_localize_script(). wp_localize_script() can't handle multi-dimensional arrays, so I'm encoding it in JSON and then decoding it with jQuery. That works fine as long as you it's only text and you replace the `"` entity with a regular `"` before you call `$.parseJSON()`. If you try to parse a post with HTML in it, though, you get errors like, > JSON.parse: expected property name or '}' http://redacted.local/wp/wp- > includes/js/jquery/jquery.js?ver=1.6.1 Line 16 So, I'm guessing I need to do some more string manipulation before trying to parse it, to convert more entities back to the regular characters, but I don't want to just pick the few characters I'm having errors with because I'm sure there are dozens more that I might miss. Is there a comprehensive or standard way of doing this? I've done a lot of searching and having found any answers, so it makes me think I'm missing something obvious. Here's the PHP side:               public function loadResources()     {         // ...               wp_register_script(             'bgmp',             plugins_url( 'functions.js', __FILE__ ),             array( 'googleMapsAPI', 'jquery' ),             self::BGMP_VERSION,             true         );              // ...              if( !is_admin() && $this->mapShortcodeCalled )         {             // ...                  wp_enqueue_script('bgmp');                  $bgmpData = array(                 'options'   => $this->getMapOptions(),                 'markers'   => $this->getPlacemarks()             );             wp_localize_script( 'bgmp', 'bgmpData', $bgmpData );         }              // ...     }          public function getPlacemarks()     {         // ...                  foreach( $publishedPlacemarks as $pp )             {                 // ...                      $placemarks[] = array(                     // ...                     'details'   => $pp->post_content,                     // ...                 );             }              return json_encode( $placemarks );     }      And here's the JavaScript side               // ...          init : function()     {         // ...              bgmpData.markers        = $.parseJSON( bgmpData.markers.replace(/"/g, '"') );              // ...     },          // ...


title: Get wp-load.php PATH with wp_localize_script and JavaScript for plugin

text: I just learned about wp_localize_script() and it's very cool. I read Otto's post and Gary Cao's post, but I'm learning Ajax so I'm trying to wrap my head around getting the path to wp-load.php this way. I have array like this in my test env:               $data = array(     'test' => 'test2',     'wp_get_site_url' => get_site_url(),     'wp_abspath' => ABSPATH,     'wp_load' => get_site_url() . '/wp-load.php',       'foo' => 'bar',     'setting' => 123 );      Inside my plugin, how to declare data.wp_load (dynamic) path?               <script>How_Do_I_Declare data.wpload; alert('thanks'); </script>      If I'm doing things wrong, I'd love your help. I'm currently reading Ajax_In_Plugins as I type this. Thanks.


title: Mystery URL http://#/ Listed in XML Sitemap Created by WordPress SEO by Yoast Plugin

text: I'm using the Wordpress SEO by Yoast plugin. I'm having problems getting the Sitemaps XML section to work properly. Google gives me the dreaded red X for the status of the sitemap. The error message Google gives is: 208 "Invalid URL This is not a valid URL. Please correct it and resubmit." The incorrect Google XML lists is: http://#/ . In the XML sitempap created by the plugin, I can see that that URL is listed. I'm not sure where the XML Sitemap generator came up with this URL. In order to get my dropdown menus to work, I set the URL to # on some blank pages that only have a title. For example, the first child in my navigation is a blank page with a URL set to # and a title of "A-C". The "A-C" page's children are the pages of all of the areas starting with A thru C. I set the "A-C" page's robot meta to noindex, nofollow. Does that have something to do with the problem? I don't have a page named http://#/. As I don't have a page with this URL listed in my WordPress Pages section, I can't set it to noindex, nofollow. Any suggestions on how to solve this problem? Thank you.


title: Standard API for rendering a date form

text: I'm hoping to enhance an existing plugin's setting page by adding an 'end date' form. I know how to add text and other form fields but was wondering if there is standard function that will render a year/data/time form. No sense in re-inventing the wheel. Thanks for all tips.


title: Overriding the default WP Multisite notification e-mail

text: Is it possible to hook in and override the default notification message for WP MS? I know the message being sent out is in /wp-admin/user-new.php               if ( is_multisite() ) {         function admin_created_user_email( $text ) {             /* translators: 1: Site name, 2: site URL, 3: role */             return sprintf( __( 'Hi,     You\'ve been invited to join \'%1$s\' at     %2$s as a %3$s.     If you do not want to join this site please ignore     this email. This invitation will expire in a few days.          Please click the following link to activate your user account:     %%s' ), get_bloginfo('name'), site_url(), esc_html( $_REQUEST[ 'role' ] ) );         }         add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );              function admin_created_user_subject( $text ) {             return "[" . get_bloginfo('name') . "] Your site invite";         }     }      I believe I can do it if I can find the right hook in so that I can remove_filter() and then add my own in. I had been toying with the following (admin_created_user_email2 is my new function):               function reset_admin_email(){         remove_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' );         add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email2', 1 );     }      I was reading this page that lists the actions/hooks I can tie into, but I can't figure out which one to use (if any of them will even work) Does anyone have experience with this to point me in the right direction? Thanks   Levi


title: How to append to menu items selectively

text: I'm making this wordpress theme, and I need to create a menu that is vertical but its submenus are horizontal, like this:               MenuItem      SubmenuItem | SubmenuItem      AnotherMenuItem      SubmenuItem | SubmenuItem      Now using wp_nav_menu() and CSS I can get this effect, but I don't have any idea on how to add the pipe symbol to separate the submenu items.               wp_nav_menu(array(                 'container'=>false,                 'after'=> ' | ',                 'theme_location'=>'home-menu',                 'menu_id'=>'main_nav_left',                 'menu_class'=>'main_link',             ));      is no good as it will turn out as               MenuItem |      SubmenuItem | SubmenuItem |      (adding a | after every item, which is the documented behavior) I was wondering if there was a way to selectively add the pipe symbol so that it is added only between the submenuitems and not after anything else. According to WP documentation, there doesn't seem to be a built-in method to support this. So what is the best way to accomplish this effect (without editing wp core code)?


title: Timed post and tweet?

text: I'm new to wordpress. Is it possible to say i would like to make this article public on this day and time AND have wordpress tweet it? Possibly tweeting the subject+link or a twitter msg i add in + link on that said time/date?


title: How can I change the title of the Home link in the navigation bar?

text: I use Bones theme with a static front page. The header.php calls the `bones_main_nav()` function without parameters, while `bones_main_nav()` only calls the `wp_nav_menu()` function.


title: How to get an array of post data from wp_query result?

text: When run a query with WP_Query method, I got an object. I understand that I can then do the loop to display stuffs. But, my goal is not to display anything, instead, I want to get some post data by doing something like "foreach...". How can I get an array of post data that I can loop through and get data?


title: how to store wordpress loop in array?

text: I am working on a site. This site has a built in layout organize that uses a switch statement to organize data on a page. I want to use that to organize the homepage posts. Right now, there are 4 posts that I have a loop set up to return. Here is the loop I am running               query_posts( array ( 'category_name' => 'homepage', 'posts_per_page' => -1 ) );     global $more;     $more = 0;     while ( have_posts() ) : the_post();     the_excerpt();     endwhile;     wp_reset_query();      I need to be able to get the 4 posts returned into this switch               $layout = $data['homepage_layout']['enabled'];              if ( $layout ) :             foreach ( $layout as $key => $value ) {                 switch ( $key ) {                     case 'block_one' :                                          //post one would go here                         break;                     case 'block_two':                                          //post two would go here and so on....                         break;                     case 'block_three':                         break;                     case 'block_four':                         break;                   }                                 }         endif;      For the life of me, I cannot figure it out.


title: unsual theme / interface

text: Hello I’m currently developing a wordpress site for a company i’m working for. The site is basically going to be used for internal purposes and to be used as a manual for new workers. They want something with a interface on the front page to get from 1 page to the next so it flows. I’ve not came across any theme that can seem to do this that suits there needs. To describe it better, imagine the user is goes onto the website, and begins the training, they link the first link and read that first article, they can then go to to the next section. but if they want they can come out into a hub like layout where they can see the following steps. I’ve no idea if this exists but if anyone can give any suggestions I would be most grateful. Thank you for taking the time to read this.


title: cross-site custom menu

text: i have a multisite whice i want to separate because its unneccery as two of my sites are on the same DATABASE and all i need is actually the dynamic custom menus which i have built in the main site(to let them be on the other site...) i have this code from here(wordpress answers): How to duplicate custom menu settings to export to another site               $wpdb->get_results(sprintf("         select tr.object_id from wp_terms t          left join wp_term_taxonomy tt on t.term_id = tt.term_id         left join wp_term_relationships tr on tt.term_taxonomy_id =              tr.term_taxonomy_id         left join wp_posts p on p.ID=tr.object_id         left join wp_postmeta m on m.post_id=tr.object_id         where t.slug ='%s' and tt.taxonomy='nav_menu' group by(ID)         order by p.menu_order asc LIMIT 200;         ",$menus));      and it suppose to do the job, but it doesnt.... what it needs to do is to get all the menu items... im stuck at the moment... my goal is to use the main site custom menu on the other site through the database.


title: Wordpress Multiple Category Search

text: From few months I am digging into wordpress for multiple category search options, and finally came up with this. I just found that wordpress allows multiple tags, which means that if in your URL you type this               http://yourblog.com/tag/tag1+tag2      then it will return all your posts with having tags, tag1 **AND** tag2 but if you type `http://yourblog.com/tag/tag1,tag2` then it will return all the posts having tag1 **OR** tag2 Same thing now works for categories also `http://yourblog.com/category/cat1+cat2` and `http://yourblog.com/category/cat1,cat2` But this only works for category and tags, I am trying it for search option. Till now I coded where this URL is working(which means it will search HTML only in the category id 114), `http://yourblog.com/?s=html&cat=114` In this URL, the **comma separator** works very well, but not the **+** I mean to say `http://yourblog.com/?s=html&cat=114,115` works very well but `http://yourblog.com/?s=html&cat=114+115` doesn't works. Can anyone help me in this? I really want this to work Still awaiting


title: permalink error when modifying sanitize_title_with_dashes function

text: By default, wordpress remove accents and weird characters to generate `post_name` in wp_posts table. This post_name is used when we change the permalink structure to `/%postname%/` or some similar structures. In my language, i don't want to remove and replace many characters as it distorts the meaning. I have change the `sanitize_title_with_dashes` function in wp- includes/formatting to: > function sanitize_title_with_dashes($title) {               $title = strip_tags($title);`     // Preserve escaped octets.     $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);     // Remove percent signs that are not part of an octet.     $title = str_replace('%', '', $title);     // Restore octets.     $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);      /* comment out this code block               if (seems_utf8($title)) {         if (function_exists('mb_strtolower')) {             $title = mb_strtolower($title, 'UTF-8');         }         $title = utf8_uri_encode($title, 200);     }          $title = strtolower($title);      */               $title = preg_replace('/&.+?;/', '', $title); // kill entities     $title = str_replace('.', '-', $title);      // comment out $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);               $title = preg_replace('/\s+/', '-', $title);     $title = preg_replace('|-+|', '-', $title);     $title = trim($title, '-');          return $title;      } The post_name is correctly generated for all characters in my language, for example `http://1.todaytravels.info` in the latest post, the url is very good, but wordpress simply does not find the post (it says `not found`). I guess i need to change something in permalink structure so that WP query to the correct post. Anyone know how to resolve this problem? Thanks for any help!


title: Rewrite category wordpress

text: Is it possible to rewrite only one category ? I have a category "Photos" and just for this category. I just want to rewrite it from /category/photos to /photos


title: Creating a Freemium plugin in the WordPress Repository

text: I would like to create a freemium model plugin and put it in the WordPress repository. I've been going through the rules for uploading plugins into the repository, but haven't got a clear indication on whether this is allowed or not, so I am searching for clarification here. http://wordpress.org/extend/plugins/about/guidelines/ I also came across WYSIJA which is a freemium plugin, and it is hosted in the repository without any problems, so I'm assuming it's ok to do this, however I would like some definitive reply on this.


title: Sliding pages + wordpress

text: do you have any idea how to achieve such effect with wordpress? http://www.papajastudio.pl/ http://soulwire.co.uk/ I mean the navigation. i want to have simple cms to edit website content + such sliding effect. An ideas?


title: remove older posts link

text: I use these following codes to delete older posts and newer posts links in `functions.php` but it still shows them.                function remove_post_navigation() {         remove_action('thematic_navigation_below', 'thematic_nav_below', 2);             remove_action('thematic_navigation_above', 'thematic_nav_above', 2);     }     add_action('init', 'remove_post_navigation');      How to remove them?


title: Combile External JS files using W3 Total Cache

text: Is there any option or is it recommended to combine external JS files using W3 Total Cache plugin for wordpress. When I say exxternal JS files, I mean that I want to combine .JS files that on other domains/CDNs, like the .JS for facebook like button, Google+1 ,etc. I want them to be combined using w3 total cache. Is it possible?


title: Simple text and image slider

text: I've been looking for a slider that can slide whatever kind of content that I want to enter. I tried out various Wordpress plugins, but most of them only can slide Wordpress posts or images only with a small caption. I'm looking for something like the WP Photo Slider 50. Unfortunately this slider doesn't work in my theme, though as there is a jquery conflict and I have no clue how to modify the plugin so that there won't be a conflict (if possible at all). I was wondering if somebody could help me find a slider plugin similar to the one above, direct me to a "how to creat a slider yourself" website or help me figure out how to get rid of the jquery conflict with the plugin mentioned above. My website (still heavily under construction): here Thanks a lot in advance :)


title: duplicate sidebar

text:
I have a problem with a sidebar. I have 4 sidebars: "Essential", "Essential+", "Premier" and "Premier+".               register_sidebar(          array(              'name'          => __('Essential Plan'),              'before_widget' => '
',              'after_widget'  => '
',              'before_title'  => '',              'after_title'   => ''         )     );     register_sidebar(         array(              'name'          => __('Premier Plan'),              'before_widget' => '
',              'after_widget'  => '
',              'before_title'  => '',              'after_title'   => ''         )     );     register_sidebar(         array(              'name'          => __('Essential+ Plan'),              'before_widget' => '
',              'after_widget'  => '
',              'before_title'  => '',              'after_title'   => ''         )     );     register_sidebar(         array(              'name'          => __('Premier+ Plan'),              'before_widget' => '
',              'after_widget'  => '
',              'before_title'  => '',              'after_title'   => ''         )     );      I have to render "Premier" and "Premier+" in the same page. When I do this WordPress renders the same content for both pages, how can i fix this?   why is this happening?


title: How to display posts from two taxonomies?

text: I have site with rankings of doctors. Medical specialization and localization where doctors live is stored as a taxonomy. For example:   `city -> New York, London, Paris`   `specialization -> surgeon, dentist, orthopaedist` If I want to display all the doctors from London, I have to navigate with my browser to: `http://my_site/city/london` but where should I navigate when I want to display all dentists from London?


title: Set JPEG compression for specific custom image sizes

text: I use various custom image sizes (by `add_image_size`) and I have set my JPEG compression to 30% with this filter:               function jpeg_quality_callback($arg) {        return (int)30;     }     add_filter('jpeg_quality', 'jpeg_quality_callback');      If I am not mistaken, the above code compresses **all** of my custom image sizes with 30%. Now, for two of my custom image sizes named `splash1` and `splash2`, I want to set the compression to 80%. How is this possible? Or alternatively, exclude those image sizes from the 30% compression filter.


title: Notification to author on posts bulk trashing not working

text: I am trying to notify the author when a post is trashed. It is working properly, but when trying to trash multiple post from bulk action (move to trash), then it's not working. Any suggestions? Here is the code I'm using               add_action('trash_post', 'sendmail');


title: Reordering themes in admin panel

text: I've been searching for a hook to change the order in which themes are displayed in the admin panel (i.e. wp-admin/themes.php) but so far haven't been successful. Is there an existing hook to do this, or another workaround so I can have a custom non-alphabetical ordering - i.e. have certain themes display before the rest?


title: how to insert a HTML form into a javascript popup?

text: I'm working on a plugin that generates a list of candidates as output. For each candidate there is a link (View Details) that once is clicked, a popup appears. I need to put a simple contact form into that popup, so when a visitor click on the candidate's link, the popup appear and the visitor can get into touch with the website owner and ask references about that candidate. As I said, all this is done by a plugin. I'm having problems in making a simple modal contact form from that plugin. Any idea in how to do that?


title: Unable to process php via shortcode

text: I've been searching around for a fix to this and while I definitely have a much better understanding of my issue (thanks to similar queries posted by others) I am still not sure of the solution. I am writing a shortcode as follows:               function cup_bc_shortcode(){          $html = file_get_contents('/html/cup_bc_layout.php', true);     return $html;     }     add_shortcode('budgetcalc', 'cup_bc_shortcode');      The file 'cup_bc_layout.php' contains html and PHP. The PHP code is being rendered as text on output rather than being processed by the browser. Is there anyway to include the PHP file in a manner similar to this? I appreciate that the shortcode must return the output in order to work but I'd prefer not to have to build this up as a single string from within this function if I can help it. Also I am quite new to PHP so even the most obvious of solutions may have eluded me. Your help greatly appreciated.


title: Custom taxonomy display name issue

text: i have created custom taxonomy named Locations , everything is working fine, but whenever i add a taxonomy, everywhere is showing the taxonomy name as Category not as Location, `Like Add New category` and so on , in wp-admin               function reg_location_taxonomy() {         register_taxonomy( 'location', array( 'product' ), array( 'hierarchical' => true, 'label' => 'Locations', 'singular_label' => 'Location', 'rewrite' => true ) );         // register_taxonomy_for_object_type( 'location', 'product' );     }     add_action( 'init', 'reg_location_taxonomy', 0 );


title: Ways to show multiple, separate galleries per post?

text: I'm working on a project that will require two separate galleries to be displayed on the same post. One gallery is specific to the product and the other is professional generic shots. The content of both galleries will change with every post. I need to figure out how to show two separate galleries on a post and repeat this process daily. The only way that I can think of is to store images in another post (post-b) and insert post-b using either @MikeSchinkel's or @Scribu's post to post connector. What would you do?


title: How can I allow trailing slashes on some URLs without a redirect, but not on others?

text: Here's the scenario. Assume I have a site, wordpress.site, which has the following Permalink structure: `/%postname%` Assume I then set up the following posts:   * /post1   * /post2   * /post3 If someone were to type in "wordpress.site/post1/" (extra slash), Wordpress will automatically 301 redirect the user to "wordpress.site/post1". So far so good. But now, let's imagine that there's an old URL "/post4/", and for SEO reasons, I want to create a post for this URL **_and_** keep the trailing slash? In other words:   * Calling wordpress.site/post4/ does not redirect to wordpress.site/post4 but   * Calling wordpress.site/post4, would redirect to wordpress.site/post4/ and   * Calling wordpress.site/post1 does not redirect, but    * Calling wordpress.site/post1/ would redirect to wordpress.site/post1 How would I go about achieving this? I attempted to do it by using add_rewrite_rule(), but couldn't seem to achieve what I was after (I was still redirected, and yes, I did flush the rewrite rules). Sample code:               add_action( 'init', 'my_rewrite_func' );     function my_rewrite_func()     {         add_rewrite_rule( 'post4/$', 'index.php?p=12', 'top' );     }      Any suggestions?


title: Page cache for categories not updating with W3 Total Cache

text: I noticed recently that the full page cache for category pages isn't getting updated. Other pages seem to work fine (home, posts, etc) but categories cache files stay untouched for days until I manually rm -rf them. What could cause this? Plugin updated to latest version.


title: Add Wordpress to Meteor js site

text: I have a Meteor app that I want to add Wordpress blogging platform to. There doesn't need to be any integration, just: http://example.com/blog/ Anything behind `blog/` belongs to WP. How would I go about doing this? Thanks in advance.


title: Displaying a custom field

text: I'm trying to display a custom field called 'my_custom_field' inside the loop:               $custom_array = get_post_custom( get_the_ID() );                         echo $custom_array['my_custom_field'];      This code display "array". Should it not display the value of the custom field instead?


title: Multisite use language code as subdirectory

text: I installed wordpress in the subdiretory "/de" and activated multisite features. The Main-Blog has the url/path: mysite.de/de Now i want to add a second site for the english language with the following url: mysite.de/en But after i added the site, the subdirectory for the english site was set as: mysite.de/de/en Any ideas how i can get these site urls: mysite.de/de mysite.de/en mysite.de/fr thx!


title: Is author.php a core file?

text: I want to change the author.php with more information. Can i edit author.php without it remove my code, after a Wordpress update? Or is there some hook for this.


title: Wordpress actions for plugin admin UI page

text: How can I make a custom edit page for my plugins admin UI page, if the requested page has a query argument of `$_GET['action'] == 'edit'`? My plugins entry url looks like               /admin.php?page=parser-top-level-handle      Than I have listed all my items per row in a table. On row hover appear "edit|delete"-links and other actions. If I'm then clicking on the `edit`-link, I get the following URl:               /edit.php?page=parser-top-level-handle&action=edit&record=55      At this point, I'd like to redirect the user to the edit form. The code what I'm trying to use to be redirected to custom edit Page                add_action( 'wp_loaded', array ( 'parserAdmin', 'init' ) );               class parserAdmin {                      private $db;                      private $add_page;                           public static function init()                 {                     new self;                 }                      //the consructor for parser admin                 function __construct(){                          global $wpdb, $posts;                     $this->db = $wpdb;                           add_action('admin_menu', array($this , 'parser_add_pages') );                          $this->get_targets();                     //Here I inspect if action exits or not                                  if($_GET['action']){                                     switch ($_GET['action']){                             case 'edit':                                    //than here should be a redirect to a custom page to edit the item passing the record query argument, do I need in this case hidden sup-page?!!!                                 break;                             case 'delete':                                 var_dump('test');                                 $this->_delete_target($_GET['record'] , $_GET['post_id']);                                       break;                                       }                                }     }


title: disable default widgets in Responsive theme

text: Theme: Resposive I have added "Widget Context" and has set it to show a widget only on the start side. This works perfectly BUT on all other sides there shows a default widget "Home Widget 1" with a default text.How do I remove the default widget? /Torbjorn


title: how to make a wplang for network fill automatically

text: I made a new network in my website its default language was ar when I add a new website it does not fill it WPLANG automatically, I made it manually but how to make it fill automatically.


title: options creation for plugins

text: I am new to wordpress and learning to create plugins. I want to know how wordpress itself create options in 'wp_options' table for plugin during plugin installation or activation? How wordpress decide about these option values, which is sometimes serialized data?


title: 'save_post' hook not working in WP 3.5

text: I used to have an extra option added to the 'Edit Media' screen (using the `attachment_fields_to_edit` hook, and then saving with `attachment_fields_to_save`). However, I've updated to 3.5 today, and the Edit Media screen is now based on the Edit Post screen, so those hooks no longer work in this context. To overcome this, I've added a metabox using `add_metabox()`. The metabox is displayed, but the issue is with saving the data. As the function wasn't working as I expeced, I thought I'd output `$_POST` to see what was going on. However, it appears that the function hooked to `save_post` isn't being run when I update the media. Here is my code. Can anybody tell me if I am going about this the wrong way, or perhaps if there is a differnt hook that I am unaware of for this purpose? Thanks.               /** Register hooks for creating a metabox on the Edit Media screen and then saving the values */     if(current_user_can('manage_options')) :              /** Add the option for including the image in the slideshow on the front page */         add_action('add_meta_boxes', 'add_front_page_slideshow_option');              /** Save the '_include_on_front' data */         add_action('save_post', 'save_front_page_slideshow_option');          endif;          /**      * Saves values from the 'Include in Front Page Sideshow' meta box when the users Updates the media      */     function save_front_page_slideshow_option($post_id){              echo '<pre>'; print_r($_POST); echo '</pre>';         die();              /** Check the security nonce to ensure we have the proper authorisation  */         if(!wp_verify_nonce($_POST['slideshow_noncename'], 'include-on-front-nonce')) :             return false;         endif;              /** Ensure that the user has the correct permissions */         if(!current_user_can('edit_post', $post_id)) :             return false;         endif;              /** Check if this is an auto save routine. If it is our form has not been submitted, so we dont want to do anything */         if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) :             return false;         endif;              /** Update the '_include_on_front' post meta field */         if($_POST['include_on_front']) :             update_post_meta($post_id, '_include_on_front', $_POST['include_on_front']);         else :              delete_post_meta($post_id, '_include_on_front');         endif;          }


title: Plugins will only be installed with 777 on folder. Solution?

text: I'm 100% not the first asking this question, yet I want to have this question be answered to my situation.. I got Wordpress installed on my server (I host it at Versio.nl) and configured whole Wordpress as it is recommended.. Which is default. Though.. I'm not being able to install any plugin (or theme or anything related to an 'write' action. Whenever I try to install one, I get the following message: > Downloading install package from http://downloads.wordpress.org/plugin/wp- > security-scan.zip… Unpacking the package… Installing the plugin… Could not > create directory. /home/sandexs1/domains/iscs.nl/public_html/wp- > content/plugins/wp-security-scan/ Plugin install failed. Could anyone help? Please ask if you need more information to answer my problem!


title: making a few sites in wordpress

text: I have just started to build in Wordpress, and my question is how can I build a few website in WP? After I purchase domains, do I need to install the program every time I want to create a new site?


title: Stop auto load wp-admin admin-ajax.php

text: I have a multisite. I want to stop autoload `wp-admin/admin-ajax.php`. As I have search in google. I have found out option `heartbeat`. But it reduced the request.               <?php      add_action( 'init', 'my_deregister_heartbeat', 1 );     function my_deregister_heartbeat() {     global $pagenow;          if ( 'post.php' != $pagenow && 'post-new.php' != $pagenow )         wp_deregister_script('heartbeat');     }      ?>      But I want to completely stop autoload wp-admin admin-ajax.php. As autoload wp-admin admin-ajax.php increase my cpu usage limit to 70 to 80%. So is there any option to stop autoload wp-admin admin-ajax.php request.


title: Wordpress shows 404 on pages 11 and above?

text: Recently I noticed that every page on post list above 10 shows 404 error. My site is http://skuvajme.com/, hosted on site5 and I'm using modified "Magazine Basic" theme. http://skuvajme.com/page/10 is visible.   http://skuvajme.com/page/11 returns 404 error. I don't have much experience with wordpress and php. Can someone help me to to fix this error?


title: Calling Custom Taxonomy Dropdown in Form

text:
I'm writing a plugin to allow users to submit fragments of lyrics to my site. I have the plugin working minus one aspect. When entering the lyrics I would like users to be able to select the artist whose lyrics they are from a dropdown. The artists are my custom taxonomy. Here is the function I created for the dropdown:               function suq_get_create_quote_form($suq_quote_author = '', $suq_quote_text = '', $suq_quote_category = 0){       $out .= '<form id="create_quote_form" method="post" action="">';         $out .= wp_nonce_field('suq_form_create_quote', 'suq_form_create_quote_submitted');         $out .= 'Who said it?
';         $out .= '<input type="text" id="suq_quote_author" name="suq_quote_author" value="' . $suq_quote_author . '"/>
';         $out .= 'Category
';           $out .= <CALL THE DROPDOWN HERE> . '
';           $out .= 'Quote
';                   $out .= '<textarea id="suq_quote_text" name="suq_quote_text" />' .   $suq_quote_text . '</textarea>

';                   $out .= '<input type="submit" id="suq_submit" name="suq_submit" value="Submit Quote For Publication">';       $out .= '</form>';       return $out;       }      The line that reads CALL THE DROPDOWN HERE is where I'm calling the dropdown function, which is this:               function suq_get_quote_categories_dropdown($taxonomy, $output){         $myterms = get_terms($taxonomy, $args);         $output ="<select>";         foreach($myterms as $term){             $root_url = get_bloginfo('url');             $term_taxonomy=$term->taxonomy;             $term_slug=$term->slug;             $term_name =$term->name;             $link = $root_url.'/'.$term_taxonomy.'/'.$term_slug;             $output .="<option value='".$link."'>".$term_name."</option>";         }         $output .="</select>";         return $output;     }          $taxonomy = array('hhie_artists');         $args = array('orderby'=>'count','hide_empty'=>true);         echo get_terms_dropdown($taxonomies, $args);     }      How can I call the dropdown function in my form? Or have I made a mess of the dropdown function?


title: How to add a download link to a movie from WP media library?

text: All, I'm creating a custom theme for WP and it has some pages that play videos from WP media library with an HTML5 player. I wanted to also have a link next to the player to allow the users to download the videos. But a direct link to an mp4 file opens a native player in some browsers (like Chrome and Safari) and plays the video instead of opening it. So I'd have to put a note next to the link "Right click and choose save link as..." to let the users know how to save it, and I'd like to avoid that if possible. So my question is, is there a way to maybe change the mime-type of the video (but only when accessed through the download link) to "application/octet- stream", or some other way, to make the browser save the file by default, instead of downloading it?


title: Worldpay Integration in Wordpress

text: Hi: I am working on a fast food website project, the theme is configured and all the data has been placed related to fast food, like the Order Menu, The payment method that will be used to order food is Worldpay, so I need help to integrate Worldpay in my WordPress website. Please guide me that how can I integrate Worldpay in my wordpress site.


title: Add Content to Content()

text: **The Question** ::: This is a strange question but I need to add content to `content()` in `page.php`. How do I do this? **The Why** ::: You see there's a plugin that uses the [plugin id="1337"] and I am linking this id with user ID so the ID needs to be dynamic and then added to the content of the page. This way each user will see something different from the plugin it will be cool I swear. I tried added it directly to the html but no luck it has to be added to `content()` somehow. No luck finding anything online either. **Installation** ::: I'm running wordpress version 3.2.1 and using the TwentyEleven Theme


title: Pagination on a custom page template

text: I have set up a custom post type called 'Events'. For reasons that I'm not going to get into, I chose not use `archive-events.php` as the archive template for my Events. Instead, I decided to create a custom page template, `page-upcoming-events.php`, to use as an archive. I wrote a custom query in this template to pull in events. I am also limiting posts_per_page to 4. I've successfully added pagination links using the `previous_posts_link()` and `next_posts_link()` functions. These functions are generating links to the expected urls: /upcoming- events/page/2/, etc. On page 1, I get the first 4 events and the next events link. The issue I'm having is that when I go to page 2, I get a 404 error, not events 5-8. How do I add properly add pagination to a custom page template?


title: How do I create a widget that only allows a single instance?

text: How do I create a widget that only allows a single instance of a widget to be added through the Wordpress interface? The default behaviour of widgets allows multiple instances to be added. I am using the Example code from http://codex.wordpress.org/Widgets_API I have seen a similar question where the answer was to use the old widget code, but I would like to continue to use that more modern code if possible. I have seen plugins such as Twitter for Wordpress that give exact control over the number of instances allowed. Thanks,   matt


title: HTML generated by WP

text:
For example, when using `wp_nav_menu` function, WP automatically generates menus with the following structure of elements and classes

Item

Item

Item

      Is there a documentation where I can find all default HTML structure, elements and classes generated by WordPress functions, so I can instruct better the Front-End Developer about how to code better when constructing the HTML of a WordPress theme?


title: Standard permissions for wordpress; Plugin installation asks for FTP credentials

text: I'm on a server that does not have FTP installed and will not have FTP installed. I have another website that I've been able to install plugins in before, including the one I'm trying to install now (WP-PageNavi). Does anyone have a list of standard permissions for WordPress that they use themselves so that they don't run into this issue? I've read the WordPress article on the topic and looked at other questions on this website. Any help is appreciated.


title: add_post_meta not saved

text:
EDIT I changed it to                           if(isset($_POST['Make']))         update_post_meta($pid,"Make", $_POST['Make']);          if(isset($_POST['Year']))         update_post_meta($pid,"Year", $_POST['Year']);          if(isset($_POST['Model']))         update_post_meta($pid,"Model", $_POST['Model']);          if(isset($_POST['Trim']))         update_post_meta($pid,"Trim", $_POST['Trim']);      And now it is working intermittently END EDIT I am updating meta boxes I created. They function flawlessly on the back-end. But on the front end I am having limited success. Firebug says the `POST` request has the values in them but they are not ending up in the database. Can anyone tell me why?               add_post_meta($pid, 'Year', $_POST['Year'], true);      is posting the meta key but not the meta value of a select box? More information available if you need just let me know what it is. EDIT TO PROVIDE MORE CODE This a condensed version of the form                   <form method="post" <?php echo $enc; ?>  action="<?php           echo post_new_with_pid_stuff_thg($pid,            $new_auction_step);?>" >

              <?php do_action('cn_before_image_upload');          if(isset($_POST['Make']))     update_post_meta($pid, 'Make', $_POST['Make'], true);          if(isset($_POST['Year']))                 update_post_meta($pid, 'Year', $_POST['Year'], true);               if(isset($_POST['Model']))         update_post_meta($pid, 'Model', $_POST['Model'], true);          if(isset($_POST['Trim']))         update_post_meta($pid, 'Trim', $_POST['Trim'], true);      ?>
      This is the before_image_upload in functions.php                       add_action('cn_before_image_upload', 'custom_nate_car');                 function custom_nate_car(){                include_once 'select.php';          global $wpdb;          ?>
Car YEAR/MAKE/MODEL/TRIM:

         <select name="Year" class="do_input" size="20" id="Year">             <?php echo $opt->getYear(); ?>         </select>         <select name="Make" class="do_input" size="20"  id="Make">           <option>Choose...</option>         </select>         <select name="Model" class="do_input" size="20" id="Model">              </select>         <select name="Trim" class="do_input" size="20" id="Trim">              </select>

      the select.php that the jquery calls is formatted like this               class selectList {          public function getModel(){         global $wpdb;         $sql = $wpdb->get_results(             "                  SELECT DISTINCT model, make                  FROM wp_car_details                   WHERE make = '$_POST[id2]'                  ORDER BY model ASC                  "             );              foreach ($sql as $res) {         echo '<option value="'.$res->model.'">'.$res->model.'</option>';         }         die();     }      one public function for each of the select boxes. is there a problem with my loop? EDIT Did var_dump($_POST); Looks like the select values are not going in into the $_POST array but showing fine in firebug.


title: I would like to display different text on different pages

text: I have at the very top of my page a line of text within a h1 tag thet I use for seo reasons. the text and html around it is written in my header.php. but I would like to write differnet txt so it appears different on each page for seo reasons. for example:   * homepage- line of text reads builders in lancaster, builders in morecambe etc   * plastereing page- line of text reads plasterers in lancaster, plasterers in morecambe etc   * roofing page - line of text reads roofing in lancaster, roofing in morecambe etc I know there is the Widget Logic Plugin but that's for widgets and not the main header.php. Is there a line of code I can write in header.php to do what the widget logic would do.


title: Least Number of Loops to Create Custom Homepage?

text: I am trying to create a custom homepage where the site content is shown as follows... See image... http://i.stack.imgur.com/ykrdf.png With separate loops this is simple... 3 individual query_posts inside a category fetch loop... But I want to reduce the number of query posts from 3 to 1 per category since they are coming from the same category... Is this possible... (since I couldn't figure out how to wrap 3 iterations with a div class block)


title: Set cookie for visitor

text: I'm writing a new plugin that will allow visitor to vote. After a visitor rated a post, I'd like to block double voting. I think the better way to do it is using cookie, but of course I can't insert the code in functions.php or in the theme header. In my case it's better to set cookie via jquery or php?


title: Custom Background default color not changing

text: I need to set several default states for a theme's background. The idea is that the background changes upon choosing a color scheme. Everything is working and changing EXCEPT the background color. The color only changes if saved from the admin screen. Am I missing something?               add_action( 'after_setup_theme', 'theme_custom_background');          function theme_custom_background(){       $theme = genesis_get_option('bf_style_selection');            switch ($theme) {         case 'bf-blue':           $bg_color = 'def1fc';           $bg_image = 'header-bg-blue.gif';           break;         case 'bf-black':           $bg_color = 'dadada';           $bg_image = 'header-bg-black.gif';           break;       }            $defaults = array(         'default-image'          => get_stylesheet_directory_uri().'/images/'.$bg_image,         'default-color'          => $bg_color,         'default-repeat'         => 'repeat-x',         'default-position-x'     => 'top',         'wp-head-callback'       => '_custom_background_cb',         'admin-head-callback'    => '',         'admin-preview-callback' => ''       );            add_theme_support( 'custom-background', $defaults);     }


title: how to call jQuery in admin as well as in homepage

text: I have this jquery code inside my wordpress admin page that checks if the input value is empty.               $j(function(){     $j('form').submit(function(){               var link = $j('#input').val();         if(link == ''){              alert('hi there');         }          });          });      Now if the form is empty it will alert ' hi there'. the plugin works fine but the alert does not show on the main page. Only in the admin section. what would be the problem? here is how I am calling jquery.               function test(){     wp_enqueue_script('jquery');     wp_enqueue_script('myscript', plugin_dir_url(__FILE__). 'js/test.js');               }     add_action('wp_enqueue_scripts','test');     add_action('admin_head','test');      I would like that if the value of input is empty, the alert show also in the wordpress homepage and not only in the admin page.


title: How to query post by user role?

text: I want to query posts by their author role. And do something with the post based on the role. I know we can get the post by get_posts or WP_query, the problem is there are no argument to sort the post based on the author role. Or, we also can combine get_users and get_posts together, like this               $users = get_users(array(role => 'author'));     foreach($users as $user){     //here we can use get_posts to query the posts by the $user->ID        } .....      this is too clumsy to doing this. I want to know if there any other way to query the posts based on the role, SQL query perhaps?


title: Custom Form Data save after Login User

text:
This is form on my first page. I have to manage if user is not logged in, in that Case after submit form action is Login Page.               <?php/** Template Name: Form */      get_header(); ?>          <form id="new_post" <?php do_action('post_edit_form_tag'); ?> name="new_post" method="post" action="<?php if ( is_user_logged_in() ) { } else { echo 'http://localhost/manage/login'; } ?>">
Project Title
     <input type="text" id="title" value=""  name="title" />

Category:
     <?php wp_dropdown_categories('type=post&show_count=0&selected=-1&hierarchical=1&depth=1&hide_empty=0&exclude=0&show_option_none=Select Category&taxonomy=category');?>

Project Description
     <textarea id="description"  name="description" ></textarea>

submit date:
     <input type="text" value="" tabindex="5" size="16" name="post_date" id="post_date" />

<input type="submit" value="Publish" tabindex="6" id="submit" name="submit" />
     <input type="hidden" name="action" value="new_post" />     <?php wp_nonce_field( 'new-post' ); ?></form>          <?php get_footer(); ?>      After Submit this form i am sending POST value on LOGIN PAge where I want to SAVE Post With UserID after user logged In . This PAGE Code :               <?php     /**      * * Template Name: Login Page     */     get_header(); ?>          <?Php     // Values Comin From 1st Page     $title =  $_POST['title'];     $description = $_POST['description'];     $category = $_POST['cat'];     $date = $_POST['post_date'];          if (isset ($_POST['login'])) {         $new_post = array(                              'post_author'    => LOGGED IN USERID,                              'post_title'    => $title,                              'post_content'  => $description,                              'post_status'   => 'publish',                              'post_type' => 'post'                              );                              //save the new post                               $pid = wp_insert_post($new_post);                                  add_post_meta( $pid, 'category', $category , true );                             add_post_meta( $pid, 'date', $date, true );             }     ?>                  <form id="login" action="login" method="post" name="new_post">
Site Login

             Username             <input id="username" type="text" name="username">             Password             <input id="password" type="password" name="password">             <input class="submit_button" type="submit" value="Login" name="login">               <?php wp_nonce_field( 'ajax-login-nonce', 'security' ); ?>             <input type="hidden" name="action" value="new_post" />             <?php wp_nonce_field( 'new-post' ); ?>         </form>     <?php get_footer(); ?>      So This is Code which i am using.


title: How come `wp_options` table does not have an index on `autoload`?

text: In the beginning of each page served by WordPress, there is a MySQL call to fetch options:               SELECT option_name, option_value FROM wp_options WHERE autoload = 'yes';      Because there's no index on `autoload` column, MySQL has to lookup ALL rows. I also came across the comment of this answer saying there would be no performance gain even if there was an index. In my application, I used a lot of transient values to serve as a session replacement. They worked great and I have my own garbage collection routines. I noticed that in the `wp_options` table, my transient values (the ones beginning with `_transient_`) all have `autoload=no`. I expect the number of rows of my `wp_options` table to increase as the number of concurrent user increases. I'd like to know why the table is designed this way. And should I create an index for my particular case?


title: pasting code in wordpress blog

text: I am using wordpress for my blog. I disabled visual editor. I tend to use markdown for writing so I installed 'Jetpack Markdown' plugin for wordpress. Also I installed 'Auto SyntaxHighlighter' for code highlighting. However, there is a problem to deal with "#include <iostream>" or "template <typename T>" 1) cannot show code correctly 2) extra tags in the end Somebody says it is due to smart quote. I disabled it with plugin "Disabler", but it did not work. I am not sure whether it is due to 'Jetpack Markdown' plugin. I just want to use markdown and code highlighting feature. * * * I fixed it by 'SyntaxHighlighter Evolved" plugin for code highlighting. Thanks.


title: Custom Post Type and Taxonomy pagination permalink

text: I have a custom post type of galleries with pagination for the posts thumbnails. It worked great until I activated the permalinks in the WP admin panel. I saw many posts on this problem but none of them helped me solve this problem. Here is the link to my gallery: Heseg website Thanks


title: Multi Upload In Theme Options

text: I need to use the WordPress media upload on a theme options page. It needs to be able to have multiple fields on one page. I have seen a few things on the site using search but nothing recent and nothing i can get to work. Can someone please show me an easy way to do this. Would really like to use the new gallery style where you pick a picture from the media gallery, or choose to upload.


title: CPT in Posts tab instead of its own tab

text: I was wondering for CPT list and editing pages to show under Posts tab instead of creating its own tab. I really want to use CPT (over using categories) because I'd have control over capability and different templates. Any input is appreciated.


title: How to change the label text in default setting pages?

text: I've seen various tutorials on how to modify the menu items of a Wordpress Site's admin, but I'm trying to find a tutorial or way on how to modify the actual admin page labels. Here's what I mean: When you are in the back end and you hover over SETTINGS, and click GENERAL, a page comes up with, of course, the general settings for the site. The labels for each input field are as follows: SITE TITLE, TAGLINE, WORDPRESS ADDRESS(URL), SITE ADDRESS(URL), etc. I'm looking to add a function to my functions.php for a theme that will allow me to change these labels Is this even possible? Or do I just have to hard code it in?


title: How to check if post/page or taxonomy post is published by admin

text: Example :- 10 users and 2 admin in a site. If the post is published by admins than               <?php ?????() { ?>       <!-- do this -->          <?php }        else { ?>        <!-- do this if posted by user -->        <?php } ?>


title: How can I manage all multisite pending comments in one place?

text: I have a WP multisite installation with a large number of sites. Thanks to auto-approving comments from registered users and invite only registration we no longer need to receive email notifications for comments pending moderation. This is good and intended behaviour, but it has introduced a further issue. Some of the sites are accumulating large numbers of 'pending' comments, because its too much hassle for me to regularly visit each of the subsites specific admin page and manage their comments. Users could manage comments on their own sites, but most can't be bothered. I wouldn't mind doing it if I had a central interface with which to bulk approve/mark as spam/delete selected pending comments from accross the entire multisite, but I don't want to have to go into each sites admin screen. Alternatively, list of all sites on the network, with their total pending comments and links to their comment admin page would suffice. At least then I wouldn't waste time visiting the admin page of sites that don't have pending comments. Does anyone know of a plugin that can help with this? I've been searching and searching and can't find anything that gets close to what I'm looking for.


title: .htaccess in subdir gets ignored by Wordpress' own .htaccess in /

text: I have a Wordpress installation on the root of an apache (I.E. on `/`) and WP wrote this custom .htaccess:   `<IfModule mod_rewrite.c>   RewriteEngine On   RewriteBase /   RewriteRule ^index\\.php$ - [L]   RewriteCond %{REQUEST_FILENAME} !-f   RewriteCond %{REQUEST_FILENAME} !-d   RewriteRule . /index.php [L]   </IfModule>` Now I need to hide a single php script, let's say in `/scritps/hello.php`, I tried a .htaccess in `/scripts` with:   `<files hello.php>   Order allow,deny   Deny from all   </files>` But it gets overriden by WP's .htaccess, and hello.php is shown anyway. (I know this because moving the `scripts` directory out of WP to another vhost on my local environment makes it work. I want to hide this php file on the live site because it should only be called by cron from the command line, and I can't put the file outside the apache root because that's all I have FTP access to.   And no, I don't have SSH access, someone else's going to set the cron job.


title: Conditional tags issue for multiple is_page() conditions in sidebar.php

text: I've been pulling my hair out today trying to get this right. Basically I have a sidebar, which makes requests to individual files (such as sidebar-home.php, sidebar-residential.php) and different dynamic menus are supposed to be loaded depending on what page you're on. Previously this has been easy to set up when moving between: is_page, is_single, is_category, is_archive etc... But, as I have read, is_page keeps returning as true, despite any reset or endif condition. Would love to hear some feedback on what I am doing wrong here. How can I get is_page(24) and is_page(36) to see different parts of the sidebar? Code is below               <?php         if ( is_page('189') ) :             get_sidebar('home');            elseif ( is_page() && !is_page(array('189','24','36',is_tree('24'),is_tree('36'))) ) :             get_sidebar('page');         elseif ( is_page('24') && !is_page(array('36')) || is_tree('24') || is_or_descendant_tax('6','product_category') || is_or_descendant_tax('6','topic') ) :             get_sidebar('residential');         elseif ( is_page(array('36'))  && !is_page(array('24')) || is_tree('36') || is_or_descendant_tax('15','product_category') || is_or_descendant_tax('5','topic') ) :             get_sidebar('utility');         elseif ( is_post_type_archive('download_type') ) :             get_sidebar('download');         endif;     ?>