title: post parameter 'name' 404 error

text: I am integrating the WorldPay hosted payment pages gateway to my WordPress installation and I am setting a notification URL in WorldPay to a route within WordPress. The problem I am having is that WordPress automatically responds with a 404 error if you pass it a parameter called 'name', or any other reserved term as defined here: WordPress reserved Terms as WorldPay does. I was wondering whether it is possible to change this default 404 response, I have tried using `unset($_POST['name'])` within my plugin code, but I assume that this is too late within the request lifecycle as it didn't alter the response. I would also prefer not to set my callback url to another script, which would then alter the $_POST array and pass it on to my plugin, if anyone can suggest a way I can achieve a 200 response without doing this? **edit: My question in a much easier to read format** Remote service X is sending a callback to my WordPress site of example.com/?name=nameofaccount how do you handle that when WordPress uses name as a reserved term and the remote service wont change?


title: Disable plugin only for one post

text: It's possible to disable a plugin just for a post? I'm displaying a post in my footer but I've installed **Simple Facebook Share Button** and I don't know how to remove that button. Unfortunately I can't use css to hide the button :( How can I do this? Thanks


title: Is it possible to setup a gallery in the backend without including it in the content?

text: I want to setup a gallery without including it in the content to be able to access it in the theme files. Currently I use a dummy page that only contains the gallery and isn't reachable from the front end. I would prefer to skip this step and keep the gallery setup on the page where it is displayed. If the gallery has to be include in the content could I modify the handling of the shortcode in a template specific way and include the gallery before calling `the_content();`?


title: Unexpanded shortcodes in search engine results

text: I have some shortcodes on pages e.g. [fb_like] [twg_gpo_button] [ratings]. If I visit page they expand correctly but on search engine results page, they do not expand on some pages. I have installed W3 Total Cache plugin. Is this due to it? What should I do to prevent this in future? I want to remove such pages from search engines results too.


title: Theme editor menu item refuses to go away

text: I've got an action set up on `admin_menu` to modify it as needed. I successfully removed the themes menu with the following:               remove_submenu_page('themes.php', 'themes.php');      Now I want to get rid of the useless yet dangerous theme editor.               remove_submenu_page('themes.php', 'theme-editor.php');      This refuses to work for whatever reason. I can remove any of the other appearance menu items but the theme editor refuses to listen to my demands. That particular menu item is indeed added via `add_submenu_page` on line 163 of `wp-admin/menu.php` so I fail to see why I can't get rid of it. Is this a bug or am I missing something?


title: Disable media upload in rich text editor

text: I wonder if there any way to disable/remove the Upload/Insert button on the text editor that created on the custom field? I already has a field that handling the file upload, so I just want the text editor to handle text with basic formatting and lists features. Thanks


title: Remove Ability for Other Users to View Administrator in User List?

text: _( **Moderator's note:** Original title was "Remove Admin from User Menu")_ I have created a client administrator role which is essentially an Editor with ability to add/remove users. The article _"Editor can create any new user except administrator"_ was excellent in helping keep my new client admin role from editing or creating a True admin user. However what would be ideal is to hide administrators from client admins when they are viewing users. I want them to _"believe"_ that they are the admin of their site but I do not want them to be able to even view my role/user-- essentially hiding the _"administrator"_ role from them when they are in the _"Users"_ panel.


title: restore a db after bad backup

text: i haven't got any experience in wordpress so please sorry me if answers seems too trivial. one upon a time i had a blog. then the hosting service expired and i get a backup in a hurry way: the bad way.   * i copied all the root directory   * i dumped the mysql database now i've just paid for reactivate the host and i want to restore the blog project ( **BUT** the directory is changed now, the file are no more in _/htdocs/public/www_ but in _/public/www/blog_ ), but i am experiencing some troubles.   1. first of all i've fixed wp-config.php with the new database name, and new user, it seems to be OK.   2. then i've done a copy of all files back in the server and redone a wordpress installations via wp-admin/install.php . updated wordpress and plugins.   3. imported the database back with phpmyadmin. now if i go to visit index.php i get this error after the title:               Error 404 - Not Found          Apologies, but we were unable to find what you were looking for. Perhaps searching will help.      and no css is loaded. i've tried the queries founded in this link but they have produced no changes in sql tables. some advice?


title: Displaying Posts Attached to Custom Taxonomy Terms

text:
The following displays a parent term in a custom taxonomy, then displays the child terms and finally is intended to display the post links (custom posts) for the posts attached to each term. Thus:   Parent     * Child 1      * Post 1.1     * Post 1.2    * Child 2      * Post 2.1   etc.   etc.   However, the query is returning no posts. I'd appreciate any pointers as to the source of the problem. For the sake of brevity I've omitted the set up list of variables that precedes this code.                 echo("
". $chapter_info->name . "
");     echo("
"); // Start sections Div.         foreach ($sections as $section){                     echo("
". $section->name."
");// Display Section Name         $pagequery=NULL;         $postqueryargs = array(                 'post_type'=>'book',                 'taxonomy'=> $taxonomy,                  'terms'=> $section->slug                                                                 );         $pagequery = new WP_Query($postqueryargs);         echo("
");// Start pages div         echo("
");             if($pagequery->have_posts()){                 while ($pagequery->have_posts()):$pagequery->the_post();                     echo('
' .get_the_title() . '
');                  endwhile;}         else{             echo("No Pages Yet In This Chapter");             }                echo("
");           echo("
");/* End pages */               }// End foreach - Sections     echo("
");/* End section */


title: How to find an option in the database?

text: As far as I can tell, the plugin that I'm using is saving options to the wp_options file:               ### New global settings container, will eventually be the only one!     $cformsSettings = get_option('cforms_settings');      When I go into phpmyadmin, however, I can't find the cforms_settings option_name? Can anyone help me trouble-shoot this? I have a backup of my old data but I can't add it. I've also tried creating a completely new form and then searching the database and I've been unable to find it. Very puzzled!!


title: How to get rid of shortcodes in post content once and for all

text: I changed theme/plugin now the post content still display shortcodes. There are some tips around on hiding them, but everytime I use some content functions, the shortcodes shows up again. Also, my shortcodes are the "extended type" such `[theshortcode id="34877"]`, `[theshort size="large" "tiny"]` etc so the tips on removing them from database doesn't work at all.


title: Calling multiple scripts using wp_enqueue_script

text: I'm trying to call multiple JQuery scripts using wp_enqueue_script. The call to JQuery works perfectly but the second call to cufon doesn't. I'm not a php or javascript expert - could anyone lend a hand, is there a best practice method for this?               function my_init_method() {         if (!is_admin()) {             wp_deregister_script( 'jquery' );             wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js');             wp_enqueue_script( 'jquery' );         }     }              add_action('init', 'my_init_method');          function my_init_method2() {         if (!is_admin()) {             wp_deregister_script( 'cufon' );             wp_register_script( 'cufon', 'http://mydomain.com/wp-content/themes/simplefolio/js/cufon-yui.js');             wp_enqueue_script( 'cufon' );         }     }              add_action('init', 'my_init_method2');


title: restricted rss feed

text: One of my wordpress blog is protected by the wordpress password plugin. however, I would like provide rss features. I found how to configure wordpress plugin to make rss work. But, by default, it seems that all the content of a post is sent by the feed. I would like to limit the information available by rss. Ideally, I would like to provide only the title of a post by rss. I have pictures and video (by vimeo) that have not to be available by rss ! Any help ? Thanks


title: Why Does the WordPress Twitter Tools Plugin give a 500 Internal Server Error?

text: When submitting API key information and clicking "Connect to Twitter" in the WordPress "Twitter Tools" plugin, I get a 500 internal server error. Nothing is logged by apache or php. I'm using WP 3.3.2, Ubuntu Meerkat, apache2, PHP 5.3.3-1ubuntu9.10. Although I am not sure what their wp/web/php/wordpress server settings are, others seem to be experiencing the same issue, as can be seen on this thread (which is in what is supposedly the official support forum, but no luck with a response there yet): http://wordpress.org/support/topic/plugin-twitter-tools-error-when-clicking- on-connect-to-twitter. Any ideas on possible causes or fixes? Does anyone know if this plugin is still being supported?


title: Questions about Robots.txt

text: I need some help with robots.txt. Under Privacy Settings, I selected "I would like my blog to be visible to everyone, including search engines..." As I understand it, WordPress automatically creates a robots.txt file. But, I need to exclude one page from the automatically generated robots.txt file. Let's say the page is called, "myPage". How do I keep myPage from being indexed? If I make my own static robots.txt will it be overwritten by WordPress' dynamic one? Also, does WordPress' auto-generated robots.txt exclude files like wp-admin, that shouldn't be indexed? Thank you! -Laxmidi


title: Access code/password only restricts page access, no user registration..?

text: Does anyone know of a plugin that will allow for a simple access/invite code to be given out, and when entered, will allow access to a certain page? I'm looking to only have one input field and no user registration needed to access a certain page of the site, and to just be able to give out unique codes that will grant access. I can't find anything like this that isn't a full user membership plugin. Any help or point in the right direction is much appreciated.


title: List top 5 authors with most posts

text: How are you? I have a blog which have 20 authors. I want to write code to show the 5 author who have more posts. like this: Adam (10 Posts) Khal (8 Posts) Yous (5 Posts) Moha (3 Posts) Yousef (1 Post) but I don't know how can do it that


title: How to query / DB requests?

text: what is the correct way to query the a Wordpress database, meaning to pull row and column info, and then place it into a corresponding table in the Wordpress admin? I'm wanting to do a query similar to that of the "links" section in the Wordpress admin, being able to both "edit" and "delete" the rows/columns individually. I've already found plenty of articles on setting up tables, and have the edit/delete front end in place, but just need a solid example of how to make a database query pull the info to edit/delete/add the info to the table.


title: Possible?! A contextually titled back link

text: The dilema:   1. I have a category menu in sidebar.php that highlights the category one is in.   2. I need to keep that highlight ON when one dives into a post of that category.   3. The blogs posts are usually associated with more than one category. So we can't rely on getting the posts category to achieve this as it'll return multiple categories.   4. Furthermore, the user is able to navigate to the next or previous post from within the post, so when the user navigates with this method, how will that communicate to the category menu that it's still in the originally specified cat? You can see it partially working here. When you are in catagory.php, i have it so that it highlights the current category in the category menu, but it's not working once you go to a post. I think this one is surely for the pros. I dont even think Mullenweg could figure this out!


title: post_content getting cut off on blank space on $wpdb->update

text:
I am publishing the following post via xmlrpc               <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">     <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta name="Generator" content="Microsoft Word 14 (filtered)">

This is a new document

Test Test Test

                 With **define('SAVEQUERIES', true);** option in wp-config, the following MySQL query is produced:               (         [0] => UPDATE `s_6_posts` SET `post_author` = 9, `post_date` = '2012-04-11 20:40:05', `post_date_gmt` = '2012-04-11 20:40:05', `post_content` = '\n\n\n
\n\n
This is a new document
\n\n

\n\n
Test Test Test
\n\n
\n\n\n', `post_content_filtered` = '', `post_title` = '', `post_excerpt` = '', `post_status` = 'draft', `post_type` = 'post', `comment_status` = 'open', `ping_status` = 'open', `post_password` = '', `post_name` = '', `to_ping` = '', `pinged` = '', `post_modified` = '2012-04-11 20:40:05', `post_modified_gmt` = '2012-04-11 20:40:05', `post_parent` = 0, `menu_order` = 0, `guid` = 'https://qa.citivelocity.com/cvauthor/equitywire/?p=230' WHERE `ID` = 230         [1] => 0.12744808197021         [2] => wp_xmlrpc_server->serve_request, IXR_Server->IXR_Server, IXR_Server->serve, IXR_Server->call, wp_xmlrpc_server->mw_newPost, wp_insert_post     )      When I look at the database after the insert, the post_content column only contains

This is a new document

      What is happening here is in                      block, everything after the space between `<span>` tag is cut off. I manually ran the MySQL update statement from console and it inserts the data properly. The collation for mysql is **utf8_general_ci** and the data does not contain any special characters. I am at a lost as to why this is happening.


title: Having two different versions of the same post?

text: I'm currently working on a site that's targeted for beginners in a new language. Now I'm looking for something that can ease my work with having two different versions of the same post. One "easy to read" and one with more adept language. In the front end there should be some sort of option that let the user tab to which ever version he or she would want to read. Would be good if the user could set a default value in the user profile aswell. Anything ring a bell? I figure WPML would be worth a shot, but I haven't used it before, and I would like to try and find something else, since WPML also seems a little bit to advance for this purpose.


title: Show metabox in custom-post-template depending on taxonomy term?

text: I'm not sure if there is a solution for that but I'll ask it anyway :) I've built a custom-post-template and a related custom-taxonomy. The taxonomy works as kind of "categories" for the custom-post-template. The taxonomy has terms like "car, house, wood". I use `metaboxes` to add custom meta-data to my custom-post-template. I wonder if it's possible to have different metaboxes visible for different tax-terms? e.g. When I create a new post (with my custom-post-template) and check the "car"-category I want an additional `metabox` to input additional data. This metabox should just appear if the post is associated with the car-term inside that taxonomy! Is that somehow possible? Thank you!


title: Comment author url link is wrong? How to change from authors/ to author/

text: I’m maintaining a rather simple blog where a small number of people are registered as administrators to write posts. When making a link to the authors URL in a posts meta data, I use the function               get_author_posts_url(authorid).      This links to e.g. `mydomain.com/author/bill` This is the correct URL for the author Bill. Now I’ve just discovered that when one of the admins create a comment to a post, the author comment URL link reference to the wrong URL. If same author, Bill, makes a comment to a post, the link is:   `Mydomain.com/authors/bill` (with an **s** behind author). This is wrong and when following this URL it gives me a 404 error. I’ve tried different methods to overcome this, trying to create my own callback comment function, tried to create a custom rewrite function and such but nothing has worked. Initially I don’t understand why the comment author URL is different but that’s another question. Any help or suggestions to solve this small, but very much annoying problem would be appreciated. Thanks   \- Mestika


title: Remove on behalf of in wordpress emails?

text:
//email to members             $Memberdata_all ="select * from lwy_users where ID = $GuestID[$h]";              $Memberdata_array = $wpdb->get_results($Memberdata_all, OBJECT);             $to = $Memberdata_array[0]->user_email;              $from=$Sender_data_array[0]->user_email;                  // Email subject and body text             $link='abc';             $subject = 'A Golfing Executives member is offering to host golf';             $headers = "From: "membership@executives.com"\r\n";             $message = "Hi $fromname,

             This is to inform you that a  member wishes to host a round of golf.

             The following are the member details:

                       MemberID:       $user_id
               MemberName:     $fromname $fromnamelastname
             Golf Club Name: $clubname
                 Golf Club Location  $ClubCity
             Golf Club Website:  $ClubWebsite

                    Here are the hosting details:

             $noticetext

             Please visit the link to accept the request

             If you have any questions, please contact the member directly at  $from

             Regards

            ";            add_filter('wp_mail_content_type',create_function('', 'return "text/html"; '));       $hostemail=wp_mail($to, $subject, $message, $headers );       in Received email im getting...               golfinge@fs05.freshsites.co.uk; on behalf of; WordPress <membership@executives.com>      please help me ,how can i removegolfinge@fs05.freshsites.co.uk; on behalf of; WordPress .i need only from membership@executives.com


title: Style category link depending on category ID

text: I want to style a link depending on its ID, for instance, if the category ID is 2, then I want the link to be pink. My theme calls the category like this:               <?php if (in_array('categories', get_option('theme_postinfo2'))) { ?> <?php the_category(', ') ?>      I found a way to style specific categories in **lists** by adding:               li.cat-item-7 { ... }  /* category ID #7, etc */      to my stylesheet, however, I cannot find a way to do the same thing to links. What type of solutions are available? Please be detailed in your reply as my coding knowledge is limited.


title: Custom post type posts don't show in archive widget

text: I have a custom post type called 'Podcasts' but none of the posts are showing in the archive widget. Only the main query (blog posts) are being shown. I've tried adding this code below to include the Podcasts posts, but this only allowed them to show up in the archive template, which is great but not quite there yet.               /* Show Podcasts posts in archive */     add_filter('pre_get_posts', 'query_post_type');     function query_post_type($query) {       if(is_category() || is_tag()) {         $post_type = get_query_var('post_type');         if($post_type)             $post_type = $post_type;         else             $post_type = array('nav_menu_item','post','podcasts');         $query->set('post_type',$post_type);         return $query;         }     }      How can I get the Podcasts posts to show up in the archive widget? Edit: For clarity, I'm talking about when I click the dropdown in the native archives widget. The days/months that should have podcast posts don't even show up. Only the day/months for the blog posts show. Edit 2: I tried dropping this into `functions.php` and now the months containing the podcasts posts show up, but when I click on those months, it just leads me to the 404 WordPress template. However, when I click on a month containing a post from the main query, it takes me to the `archive` template listing those posts.               add_filter( 'getarchives_where', 'custom_getarchives_where' );     function custom_getarchives_where( $where ){         $where = str_replace( "post_type = 'post'", "post_type IN ( 'post', 'podcasts' )", $where );         return $clauses;     }


title: Multiple sub directories for theme template pages

text: I apologize if this questions has already been answered, I have a feeling I'm just not using the right terminology for my search. I'm in the process of building a base theme for my employer. One of the things we want to do with this new theme is have the option to switch from a standard template to one that's been Zurbified. The way I'd prefer to handle this is by having an admin panel checkbox. Within the theme itself we want to have 2 separate folders that contain the actual theme template files (Ex: `theme_folder/normal/page.php || theme_folder/zurb/page.php`). How would I go about properly processing this? Is there a hook/filter that allows you to specify which sub folder to use in the specific situation? From what I read its possible to have the sub directories house the template page files,   http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in- wordpress-3-4/   , but I'm not finding the call I need to tell Wordpress to use the specific subs.


title: Displaying year, month and day archives differently

text: I'd like to display daily archives differently than monthly/yearly archives. How do I check to see if the archive template is being pulled for a daily archive vs. a monthly/yearly archive?


title: Wordpress error on log out 'Not Permitted' and can't log out

text: I've got a weird situation whereby I sometimes can't log in as clicking on a link (or going directly) to /wp-login.php shows me a blank page with the words 'Not Permitted'. If I go to the /wp-login.php page directly from that 'Not Permitted' page, then I can log in using my details. If I try and log out again though, I reach that 'Not Permitted' page again and can't log out. That's a bit long-winded, so I've created a video so you can see what I mean: http://www.youtube.com/watch?v=BI3NTiGNgoE Has anyone come across this before? This is the first time I've seen this type of error, I've seen the 'are you sure you want to log out' error message before, but not this one... Thanks Osu


title: Changing order in which custom fields appear in dashboard

text: I have several custom fields for my CPT. In dashboard page of my CPT, when editing a CPT, I see my custom fields in "custom fields" box. But I want to change the order in which they are displayed. Is it possible?


title: How to specify widget order or css name via script?

text: I've got a routine (see below) that creates and inserts several widgets into the active theme's sidebars. However, I need more control over either the order/index the are assigned (ie, one of my widgets need to be at the top of any other widgets in the sidebar) OR, I need to be able to specify a custom css name for the widget. I've inserted a comment to catch the widget titled "my important widget" and apply the index or custom css I'll need to assign to that widget. Are either of these possible?               $file_name_widget = $files_widgets->getPathname();     $widget_text = file_get_contents($file_name_widget);     $widget_text_label = 'text';     $widget_ops = get_option('widget_text', array());     $widget_id = count($widget_ops) + 1;     if($file_name_widget == 'my important widget') {         //place code here to make this widget move to the top of any others in the sidebar its assigned to         }     $widget_ops[$widget_id] = array('title' => $files_widgets->getBasename('.txt'),'text' => $widget_text,);     update_option('widget_text', $widget_ops);                       $sidebar_id = basename($files_widgets->getPath());     $sidebars_widgets = get_option('sidebars_widgets', array());     $sidebars_widgets[$sidebar_id][] = $widget_text_label."-".$widget_id;     update_option('sidebars_widgets', $sideb


title: Plus sign in query string to custom page gets 324 server error

text: OK, so I've created a page (http://justinhealth.com/testsite/error-signing- up). It's a custom error page for iContact. Now, when there's an error in iContact's signup, it actually goes here: http://justinhealth.com/testsite/error-signing-up/?[error+message+here] The problem is that the plus signs in the URL cause a 324 server error. If there are no plus signs (like http://justinhealth.com/testsite/error-signing- up/?error-message-here) it works fine, but since I can't rewrite how iContact generates the address, I need to work with the plus signs. Any ideas on why I get an error? On the page itself, I capture the error using `$_server['QUERY_STRING']`, but I get the error regardless of whether that's on the page or not.


title: Problem with Line spacing in wysiwyg editor in WP 3.5.1

text: Since updating to 3.5.1, I can no longer get single line breaks in the WYSIWYG editor. I used to be able to shift-return for a line break and return for a paragraph break. But now all lines have double spacing. Hitting "delete" at the beginning of the line does not help. I can of course fix this by switching out of WYSWYG mode, but this makes no sense to me. I tried replacing the WP-ADMIN folder with a fresh copy, no change. Any ideas? ![enter image description here](http://i.stack.imgur.com/OPUpm.png)


title: qTranslate get content by language using wp_query

text:
I've similar problem to the issue described here. On my bilingual website here http://redscouseworld.com/ I'd like to display posts only in Polish language. And here http://redscouseworld.com/en/ I want to show posts written in English only. I added following code to my homepage:
     <?php $the_query = new WP_Query( 'showposts=10' ); ?>     <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?>

<?php the_excerpt(__('(more…)')); ?>
     <?php endwhile;?>
      And you can see that on English version both post types are being displayed (Polish and English) - half of them as untranslated ones. How can I display only proper ones on each site? I tried to hide them using qTranslate function "Hide untranslated content" but the result was empty page. I'd be grateful for your help! Thanks in advance!


title: What are the parameters are used in add_action and filters?

text: add_action( $hook, $function_to_add, $priority, $accepted_args );      I am unenable to understand what the code is used for? What are the inbuilt parameters and functions are mostly used in add_action?


title: Wordpress admin for a custom post, hide/collapse the main "title" and "description" boxes

text: Is there a way to hide the main "title" and "description" boxes for a custom post? I have a custom post with a large meta box. I won't be using the regular title and description so I would like to either hide it or collapse it so the user won't have to scroll to get down to my meta box.


title: Display All Non-Used Plugins

text: My company currently has a multisite of about 20 sites, and growing every day. We're trying to go through the plugins and set standards. IE, forms use plugin X. However, we have not found a single way to go through and systematically show which plugins aren't even used. Is there a function that can show us the used, or unused plugins? I have tried searching everything I can think of and cannot for the life of me find an answer.


title: How do I restore my site?

text: I accidentally deleted all my pages and posts from my wordpress admin. I was trying to delete some dummy data that one of my plugins installed on the website and wham!, all my posts and pages were gone. In the wordpress dashboard, my uploads are not showing but when I looked in the folder on my server, they were all there. Why is is showing on the server but not in the wordpress admin? I never backed up too. Now, what should I do to get everything back?


title: TinyMCE Anchor Button not showing

text: I'm using this filter and function to display a custom, stripped-down version of the TinyMCE editor. Everything works as it should...except the 'Anchor' button will not show ('anchor')? According to the TinyMCE website (http://www.tinymce.com/wiki.php/Controls), that is the control to use. **Does anyone know why the anchor button will not show?** ![enter image description here](http://i.stack.imgur.com/LfZ9C.png) **EDIT:** the code example comes from here (this shows the full code I am using, not just the snippet below): https://gist.github.com/mrwweb/9937127               add_filter( 'mce_buttons', 'wpse_mce_buttons_1' );     function wpse_mce_buttons_1( $buttons ) {         $buttons = array( 'styleselect', 'bold', 'italic', 'link', 'unlink', 'bullist', 'numlist', 'table', 'anchor');              return $buttons;     }     add_filter( 'mce_buttons_2', 'wpse_mce_buttons_2' );     function wpse_mce_buttons_2( $buttons ) {         $buttons = array();         return $buttons;     }


title: Hide custom menu when when no menu selected

text: The title might not a 100%, feel free to correct... I'm building a custom theme that has a couple of costume theme locations for menus (1 main menu, 1 footer menu, 1 "Follow Live" button). These are specified as a Theme Location in the Menu's panel. I'm having an issue with the footer menu: when that theme location does not have a menu selected, it falls back to displaying all pages. I'd like it to not display anything when it's not linked to a menu. The menu is defined in functions.php like this:               function add_footer() {     register_nav_menus(         array('footer-menu' => __('Footer Navigation'),));}      add_action('init', 'add_footer');      And it's displayed on the page like this:                   <?php              wp_nav_menu( array(             'theme_location' => 'footer-menu',              'menu_class' => 'false',              'container' => 'false',              'fallback_cb' => 'wp_page_menu',              ));?>      I've tried removing the `fallback_cf`option but that doesn't help.


title: Wordpress admin stylesheet

text: Is there a way to override the styles in the admin in my theme? I don't want to touch the admin style sheet if I don't have to. I just want to make a column bigger in my admin, but also, to do it in a way that doesn't get overridden in a future wordpress update.


title: How to add multiple the_content or something like that?

text: ok... let me explain: i have an example post in wp admin and i want to add :   * some text (already added via the posts editor)   * some custom stuff (some taxonomy that i have already added)   * some videos   * and some images How can i do this? I don't know how to add the videos and images after the content (the text )


title: add_filter 'single_template' and use of wp_nav_menu in template

text: I'm using `add_filter('single_template',...)` to call a unique template file under a certain condition. The problem we're running into is that no matter what I do I can't use `wp_nav_menu()` successfully in the template file we are calling. Does anyone have any experience with this situation?


title: get_footer can't find any variables set in functions.php

text: footer.php can't find any variables I set in functions.php, I've tried a global (urggh) and object array like so:               $foo = (object)array("bar" => "test text");      It works within page template, just not in the header or footer, does anyone know why this is happening? Thanks for reading.


title: where to set the PO file for a plugin?

text: I have a Cimy user plugin and I want to make translations and then force the Cimy user to read from my translation. Should I define the language in `wp- config.php` in the root folder?   I do not know where to change it? I have `define('WPLANG', 'fa_IR');` in `wp-config.php` and it is reading from path > \wp-content\languages Should I change the fa_IR PO edit and just add the ones from Cimy user in the bottom of the WordPress fa_IR PO? or I should use separate file?


title: List Posts For Terms Of A Custom Taxonomy For Any Post Type

text:
The function is great and i am using this function with these filter to just display selected taxonomy term posts by id, but what result i am getting is like this Child Taxonomy 1   \- Child Taxonomy 1 Post 1   \- Child Taxonomy 1 Post 2   \- Child Taxonomy 1 Post 3   Child Taxonomy 2   \- Child Taxonomy 2 Post 1   \- Child Taxonomy 2 Post 2   \- Child Taxonomy 2 Post 3   Parent Taxonomy   \- Child Taxonomy 1 Post 1   \- Child Taxonomy 1 Post 2   \- Child Taxonomy 1 Post 3   \- Child Taxonomy 2 Post 1   \- Child Taxonomy 2 Post 2   \- Child Taxonomy 2 Post 3   Means at the last after listing the Child Taxonomy Term Name and Its posts the function is also displaying the parent Taxonomy Name and All the posts from its Child taxonomies in parent Taxonomy as its posts. I need help to get rid of that parent taxonomy at the last and all posts from child taxonomies in it too, so it will just display the result like this: "List All Child Taxonomies and Its Posts Only like below" Child Taxonomy 1   \- Child Taxonomy Post 1   \- Child Taxonomy Post 2   \- Child Taxonomy Post 3   Child Taxonomy 2   \- Child Taxonomy 2 Post 1   \- Child Taxonomy 2 Post 2   \- Child Taxonomy 2 Post 3   What should i do in this function to get the result working code below: Post Type = events Post Type Custom Taxonomy Term = events_cat Parent Taxonomy Term = announcments i need this function to only list child taxonomies of announcments and their posts not the announcments too at the end with all posts from its child taxonomies. Please help me how.                   // List posts by the terms for a custom taxonomy of any post type     $post_type = 'events';     $tax = 'events_cat';     $tax_terms = get_terms( $tax );     if ($tax_terms) {         foreach ($tax_terms  as $tax_term) {         $args = array(             'post_type' => $post_type,             "$tax" => $tax_term->slug,             'post_status' => 'publish',             'posts_per_page' => 4,             'caller_get_posts'=> 1         );               $args = array(     'tax_query' => array(     'relation' => 'AND',     array(     'taxonomy' => 'events_cat',     'field' => 'slug',     'terms' => $tax_term->slug,     ),     array(     'taxonomy' => 'events_cat',     'field' => 'id',     'terms' => array( 3, 37 ),     'operator' => 'NOT IN',     )     ),     'post_type' => $post_type,     'post_status' => 'publish',     'posts_per_page' => -1,     'caller_get_posts'=> 1     );             $my_query = null;             $my_query = new WP_Query($args);                  if( $my_query->have_posts() ) : ?>
All <?php echo $tax; ?> Posts For <?php echo             $tax_term->name; ?>

                 <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>                          <li id="post-<?php the_ID(); ?>">                         <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?>
                      <?php endwhile; // end of loop ?>
                  <?php else : ?>             <?php endif; // if have_posts()             wp_reset_query();              } // end foreach #tax_terms     }


title: category pagination got broken suddenly

text: i need some help here please! The pagination just stopped working suddenly with the default post type and default wp query, with plugin "wp-paginate" or even with next/prev arrows! It echo 404 error when navigate to any sub page. Any clues what may cause this ? thanks


title: post_class output in wrong area?

text: Trying this in my functions file. There is actually a lot more to this function than I am showing, but this is the important part that is messed up.               function xyz_loop() {             $defaults = array (                 'before' => 'article id="post-' .get_the_ID(). '"' .post_class('clearfix'). 'role="main">',                 'after' => '/article>',             );                        $args = wp_parse_args( $args, $defaults );         extract( $args, EXTR_SKIP );              echo $before;              echo 'doing stuff here';              echo $after;}      the problem is the post_class is outputting the post classes before the article container instead of inside it. Can I not use post_class like this?


title: Querying posts with meta value that begins with a certain pattern

text: I am trying to create a search filter using meta_query. The only problem I'm having now is that I can't compare with wildcards. I think that's how you word it?               $keyword = 'sos';     $tlds = array('com','net','org');          query_posts( array(         'post_type' => 'domains',         'meta_query' => array(                 array('key' => 'domain_name',                       'value' => $keyword,                        'compare' => 'LIKE'                 ),                 array('key' => 'domain_tld',                       'value' => $tlds,                        'compare' => 'IN'                 )         )      ));      This code will work fine, but right now it just checks whether the domain_name contains the keyword anywhere in the string. I want to check whether the domain_name begins, contains or ends with the keyword. I tried adding the '%' sign to define the wildcard so that it would search for the pattern, but I don't think meta_query allows wildcards.               $keyword = 'sos%';     function where_keyword( $where = '' ){         $where .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)          WHERE $wpdb->postmeta.meta_key = 'domain_name'          AND $wpdb->postmeta.meta_value LIKE '$keyword'";         return $where;     }     add_filter( 'posts_where' , 'where_keyword');      This was my second attempt, but I am not sure if my approach is correct? I'm a novice when it comes to sql. I've been get this working for days so I thought I'd see if anyone else has attempted this.


title: Does WordPress have an Browser Agent?

text: I want to block a directory to everyone but WordPress's internal upgrade feature (I am trying to get WordPress to do auto-updates of my premium plugin). I have it updating, but I really would like to block the directory for everyone but WordPress. Anyone know what WP's internal User Agent is?


title: How to obtain a reference to the_excerpt() from custom loop

text:
I have a script in archive.php, which is outside the loop, that calls on the function get_blog_links() to list all posts that belong the the current category (my "blog" category). I'm trying to do some trace testing inside the "get_blog_excerpt() function in order to write out either the post excerpt or (if no excerpt appears) the first 55 words of content (the_excerpt) for each post. However, I'm unable to obtain a reference to the_excerpt in my function. Any help much appreciated.               //Blog Listing     function get_blog_links(){         $myposts = get_posts();         echo '
';          echo '
'; foreach($myposts as $idx=>$post){ ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?>       // THE FUNCTION CALL IM WORKING ON...                 <?php echo get_blog_excerpt();?>
         <?php }          echo '

';     }               function get_blog_excerpt(){         // return get_the_excerpt(); WORKS         // return the_permalink();  WORKS         // return the_excerpt(); DOES NOT WORK?         // return get_the_content(); DOES NOT WORK?     }


title: What's the difference between home_url() and site_url()

text: My understanding is that `site_url()` returns the location where the wordpress core files are. So, if my blog is hosted at `http://example.com/blog` then `site_url()` returns `http://example.com/blog` But then how does `home_url()` differ? For me, `home_url()` returns the same thing: `http://example.com/blog` If that's correct, then can I get wordpress to return `http://example.com/` ?


title: How does W3TC Auto Minify deals file file name

text: # Hi there, I am having problems with W3TC Minification of JS and CSS on automatic mode. Since I have alot of wordpress websites, auto mode would be the best way to go for me. It would take alot of time to feed script names to manual mode for each site. Minification is the ONLY resource I have active on W3TC, I do not need anything else fornow. Anyway, minification is generating files with filename too big. Too big that they cannot be created by debian (filename too long error). I do not understand, first of all, how W3TC comes up with those strings for file name? What is the logic? Files are getting minified and served on the fly and no cache is being saved on disk. Second, I do not understand the effect of the options "Disable minify automatic file name length test" and "Filename length:", since I change them and see no effect other then a slight change in the generated file name - but it is still too big. Also the generation seems to not respect the "Filename length:" option. Below are a generated filenames:               wp-content/cache/minify/000000/jZFrcoMwDIQvhO1Scp-OsBUjApZjmdD09DEJGToZ2sk_zbfrtR6N6c8TpmvVrIUaySfIqEcK1cHIfOS2R5ur2pwiWRBQHoahOI104Hhu-XurimuOyk6SecSkEl4IZ9ljxdljjmBP5ouCNZEljygCHl-lR2OawvLwD3FlJV3oZ0nwzH5AZWHA4CApvGDIYnp5znnOFP_1eYtKbKK4zN4r6Thlyw4fIXB9petalia3bzSCUPC61s17_kxlSaJq_fme_xdVjf64n60xEz31ibTlhHt8Jucx7ykZWtnjYEuWIw53cbvEyG4acLmzT9zxDQ.jss      Thats like 320 characters long. If I want filenames that can be created on disk by Debian, I need to tick "Disable minify automatic file name length test" and set Filename Lenght to 100. That way I get a bunch of files (soo much for combining), but the lenght is okay. If I seed filename lenght to 80, files are created and served from cache just fine.                |-- M9QvL9AtSk1OLChJzkjUh7MA.css     |-- M9QvL9BNLi0uyc9NLdItSi3LTC0vxiYGAA.js     |-- M9RPz89Pz0nVLcgpLdbNz0vVTSotKcnP002q1M3OLdZPL8iPB0kBZQA.css     |-- M9RPz89Pz0nVTU7MSc1LSSzSTS1LzSsp1s8CosLS1KJK3cKSzAIA.js     |-- M9TP0i3OyC8qSc5PSS3WT0_MyUktqizLTC3XzyrWzyosBfL0SjJzU4uKdQ31jAA.js     |-- M9TP0i3OyC8qSc5PSS3WTy4u1s8qLE0tqtQvzs3PL8nIS4WL6JZm6hrqWehZ6iWXFpfk5wIA.css     |-- M9TP0i3OyC8qSc5PSS3WTy4u1s9KrNQxRBVOT8zJSS2qLMtMLYcoKSwFcvWQhHWN9QwA.css     |-- M9TPSi0pSEzO1s_NTynNSS3WLy9IL8rPyAcA.js     |-- M9TPSi0pSEzO1s_NTynNSS3Wz8nMBpLFJZU5qQA.css     |-- M9YvzdTPKixNLarUK83US0xOzi9KyczP08vNzAMA.js     |-- M9bPKixNLarUMYYydHMz04sSS1L1cjPzdEz0i8vT8pOyUpNLdAz1swsykxOLE3XTE3NygCr1izMSU_LLk_IrECwA.js     |-- PcVBDoAwCATAD0lIn0TohqhYGkGNv_fmXKaxRZiDVByjy0m4MSpZM9kUlPU6lsYbaorufES_HMnP2g31_wE.css     |-- XYpbCoAgEEU3lIq0omG8TIpoOWa4-8LPPs_DO6lVMgxTRgnUDAZKV5fUCcMot3j2zbtk9Kitcw1YMdH8W6Gc0eaIeNZx3R9ZkMYi1tv9BQ.js     |-- bYpBDoAgEMQ-JEFfZFacKBGBsCsrv9eDxou3tmlvRRGlIaAiWpYW0A12y94Rk1koBJT2-vj4z8ErzUmndH50X5qNO1jSjmIKqofyX7sA.css     |-- bclBDoAgDADBD0mr4UUIDZagRAoSf68eSDxw3NkFg5It5WKTI0FvYqR8X0wNg2A461vwU6Vhhp2PSWPl_iuDTZlG3th5KqNTzCqfPw.js     |-- dclBCoAgEAXQC5kidJ8Q-cRYM5pjhZ2-Fm1atH3Pu4RWQlzcRBJdydoYqmGG8d9K247aLclBOH_ytaFC6YIZXczMkPZAWbtlkhs.js     `-- index.html      Can anyone point me to the right direction, please? The code is too big and complex to navigate. I would like to not have to go there. Any help is welcome. Best regards. Edit: It seems W3TC uses SHA-1 for file names, hence the long file names. Problem is my OS cant handle names larger than 250 chars.


title: How can i retrieve the username and password from my wordpress installation?

text: I had a developer working on a website. Now i learned a bit of wordpress and i would like to continue some of the work on my own. I asked the developer for the passwords and he only gave me the passwords of the hosting account and not from the wp-admin of the wordpress installation. When i asked about those passwords he told me that he never used the wp-admin panel to develop the website and he doesnt know about any passwords about it. He refused to tell me also how he developed the website if not from the panel. Is this even possible?!?! The only way to develop a website is from www.mysite.com/wp-admin right? Anyway i still have the passwords from the hosting account that means the ftp passwords and everything. Is the username and password of my website , stored in one of the files that are on the ftp account? For example in the wp- config.php file or somewhere else? I cant understand if the developer simply wants more money for it , or i am missing something here...


title: Integrating jQuery mobile page transitions with my theme

text: I'm trying to integrate jquery mobile page transitions using the advice on this site I have a functions.php file:               function theme_js()     {         wp_register_script( 'jquery.mobile', 'http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js', array('jquery'), '', false);         wp_enqueue_script( 'jquery.mobile' );         wp_enqueue_script( 'theme_js',  get_template_directory_uri() . '/js/theme.js', array('jquery'), '', false);          }          add_action( 'wp_enqueue_scripts', 'theme_js' );      My theme.js file:               jQuery(document).ready(function(){     ('#wrapper').live('pagecreate', function(){     jQuery('a').attr('data-transition','flip');     });     });      In header.php, just after the opening `<body>` tag, I created a wrapper div:               <div data-role="page" id="wrapper" class="wrapper">      And then closed it in footer.php right before the closing `</body>` tag. I'm obviously doing something wrong because when I test the site the page transitions aren't working. Any help is greatly appreciated.


title: Upload multiple images via theme options

text: Is there a simple script out there that would allow multiple images to be uploaded via my theme options page (Which is based on this script - http://buildinternet.com/2010/01/create-custom-option-panels-with- wordpress-2-9/ )? I need to be able to upload 6 images which will feature in a site-wide slideshow.


title: load_child_theme_textdomain doesn't work in function.php

text: I have a child theme which is not localized. So I added this in function.php               add_action( 'after_setup_theme', 'my_child_theme_setup' );     function my_child_theme_setup() {         load_child_theme_textdomain( 'mytheme', get_stylesheet_directory() . '/languages' );     }      It doesn't work. I searched for hours and I read somebody advised putting this to the top of header.php               load_child_theme_textdomain( 'mytheme', get_stylesheet_directory() . '/languages' );      Suddenly it started working. The problem is solved but I'm still curious why the legal way didn't work. Any of you have an explanation?


title: Categories show 404 error on multisite installation

text: I have a wp multisite installation with multiple blogs that are totally separated websites. I use a plugin for domain mapping. Right now I am configuring everything and I wanted to remove the /blog slug from the main blog, I did it by editing the settings as "network admin". I used /%POSTNAME%/ and / for category and tags base. The posts opens fine opening www.url.com/postname, but www.url.com/categoryname show 404, I tested changing the category base to anything (like /c) and www.url.com/c/categoryname works. But I don't want to have a category base I want the category post lists to open on www.url.com/categoryname. How can this be done?


title: Photo comment plugin

text: I'm searching for a plugin that is (for all logged-in persons of a group) showing one picture of a member/gallery and allow them to leave a short comment on this. Users shouldn't see comments posted by others and once they have seen a picture it shouldn't be shown again. They should also be allowed to skip a picture. Is there some plugin that is doing something near to that? I don't mind coding and changing it for my needs, so any plugin that is doing at least some parts of it is appreciated. Thank you!´in advance!


title: How to Use the Filter "sidebar_login_widget_form_args"

text: I need to rename some of the labels on the Sidebar Login form using the sidebar_login_widget_form_args" filter; I have been trying few days to do this without any success. I would very much appreciate it if someone could point me in the right directions. Specifically, I need to rename the "Login->" button to just "Log In", rename the "Username" to "Username:" and "Password" to "Password:" Here's my code which doesn't work:               /* Sidebar Login Plugin - Change Form Labels     add_filter( 'sidebar_login_widget_form_args','my_sidebar_login_widget_form_args', 10, 2);     function my_sidebar_login_widget_form_args() {          if ( 'label_username' === 'Username' ) { return 'Username:'; }// Change Username Label     if ( 'label_password' === 'Password' ) { return 'Password:'; }// Change Password Label     if ( 'label_log_in' === 'Login →' ) { return 'Log In'; } // Change Login Button Label     }      Thank you very much for your help in advance.


title: Search and replace special characters (å,ä,ö) for image attachments only in database

text: I need to replace the special characters å,ä,ö (with a or o) in my WP database for all image attachments. How can I apply this search and replace only to affect these links? Edit: Solved


title: Get User ID on registration form before submit

text: I am creating a registration page and not using the wp-register page. Is it possible to pre populate the username field with the user id the person will be assigned with? So the username field will look like this "user- _userid_ ". I am trying to get the $user id meta value before the registration form is submitted I have tried:               <input class="form-control" id="signup_username" name="signup_username" placeholder="Username" type="text" value="" />          value="user-<?php echo $user_id; ?>"          value="user-<?php echo $user->id; ?>"      Thanks! **_ UPDATE _** Now, this may be another solution I am considering though any input on this mehtod is greatly welcomed. I am generating a random username by the time, microtime, and a 5 digit random number using this code below:               <?php         $date = date('H:i:s');         $time = microtime();         $random_numbers = 2;         $random_digit = rand(pow(10, $random_numbers-1), pow(10, $random_numbers)-1);                            $date_time_number = $date . $time . $random_digit;                           $random_username = preg_replace('/[^a-zA-Z0-9\']/', '', $date_time_number);              value="user-<?php echo $random_username;"     ?>      This is how it looks: `user-033610045034900140703697021719` What do you think about pagespeed using this method to create a random user id? I hope it's not an overkill. Thanks!


title: Is it possible to make one of two custom fields in Custom Post Type UI Required but not the other?

text: I'm new to wordpress and I'm trying to make a field that either links to a page internally via a dropdown OR a text area for a URL. Obviously I don't want the button to have two destinations so I'd like to make them both required but only one can have a value at a given time. Is this possible in CPT UI?


title: How to create page with lots of dynamic content(AJAX?)

text: I am setting up a Wordpress-homepage which has a lot of toggled content(sort of like this: https://jqueryui.com/tabs/). So for example I have a list of links on the left side, and a content-container on the right, which dynamically shows the content for the current tab. I thought about loading the content through AJAX, but then I'd have to create hundreds of subpages just to store all the information. Also everything has to be maintainable by the client, so it should be as easy as possible. What would be the best way to achieve this? Also, is it possible to create 'templates' for sections of a page? I have several sections and subsections on a page, each with a specific markup and styling, which I want to be maintainable by the client without having to switch to HTML view. I'm thinking about something like WPs custom fields, only for pages instead of posts, and a bit more flexible.


title: Advanced Custom Fields Wordpress querying relationships

text: Having an issue using the `Advanced Custom Fields` `Wordpress` `plugin`. I've got 2 Custom Post Types   1. pa_supplier    2. pa_supplier_product There is a one to many relationship between a supplier and their products. (One supplier has multiple products). I've got a page displaying a list of my suppliers and when I click on a supplier I am taken to `single-pa_supplier` page where I would like to display a list of the products associated with that Supplier. I've successfully managed to make a query on this page and display products, but they are not the corresponding ones to the Supplier. This works: - It displays a list of products with a quantity of 10,000 as expected               <?php $products = get_posts(array(                     'post_type' => 'pa_supplier_product',                     'posts_per_page' => '100',                     'meta_key' => 'quantity_per_pallet',                     'meta_value' => '10000',                     'compare' => 'LIKE'                 ));?>      This does not work: - I was hoping it would display all products that have a supplier called "Cavan Box"               <?php $products = get_posts(array(                     'post_type' => 'pa_supplier_product',                     'posts_per_page' => '100',                     'meta_query' => array(                      array(                        'key' => 'supplier',                        'value' => 'Cavan Box',                        'compare' => 'LIKE'                       )                     )                 ));?>      I don't know why the second query is not working, I've a field called supplier and it is of type Relationship. when I create a product I assign it a supplier. Any help would be much appreciated.


title: Change Wordpress Shortcode added in to post

text: Problem: I am using a plugin that turns the wordpress gallery into a cool slide show. How ever, every time I make a gallery - Wordpress add this code to the post . [gallery ids="334,332"] I need it to be this - [wp-slideshow include="334,332"] * * * Might be helpful: I think this is the file controlling the output? http://core.trac.wordpress.org/browser/tags/3.0.1/wp-includes/media.php#L745


title: Why Won't my jQuery Play Nice with Wordpress?

text: Code in question here: http://pastebin.com/PN29WKNq It worked on the HTML page I tested it on. Its supposed to add "display: none" to the content divs and then add "display: block" when the appropriate tab is clicked. But it just changes to "display: none" and never changes.


title: Using transients to store captchas

text: I was just wondering if something like this would work:   * The page displays a form, with a captcha code inside it.   * When this form is generated, a transient is set to store the captcha code.   * The vistor submits the form   * After submit `$_POST['captcha']` is compared to the transient from the database; if matched return success, otherwise fail   * Delete the transient What do you think? Is this secure?


title: Forum Software that Integrates with a WordPress Blog/Website?

text: If you wanted to add a user forum to your software site, and make it look and work like your WordPress blog, what forum software would you choose? Apparently bbPress has the same origins as WordPress, but is it best or are there other choices that are better?


title: Possible to create a permalink to sort with meta_key?

text: I feel like I've been all around the web and back again looking for an answer to this and it's really starting to grind my gears. Not sure if this is the correct way to do it, but I want to add a query_posts array to a URL in the form of a query_arg. This is our query:               query_posts( array( 'meta_key' => 'rank', 'orderby' => 'meta_value_num', 'order' => 'DESC' , 'paged' => $paged,      How do I use add_query_arg to pass that to the URL so as to re-order the posts with that meta_key/query_posts array? I tried this, it doesn't seem to change the order of the posts, there's something I'm missing here.               <a href="<?php echo $by_rank;?>">  Rank           <?php $by_rank= esc_url(add_query_arg(array('meta_key' => 'rank',  'orderby' => 'meta_value_num', 'order' => 'DESC'))); ?>      The reason I want to add the query vars to the URL string is so users can sort posts on category pages based on the meta_key/meta_value. Sort of in a similar way to doing ?orderby=date, except with a meta_key. This can be done, right? Because I'm seriously starting to think it's not possible. EDIT:- Tried this, this works to sort posts by ASC/DESC order, but not by the meta_key               <?php     $meta_key = (isset($_GET['meta_key'])) ?                 sanitize_text_field($_GET['meta_key']) : 'rank'; // use default value here ''          $orderby = (isset($_GET['orderby'])) ?                sanitize_text_field($_GET['orderby']) : 'meta_value_num'; // use default value here ''          $order = (isset($_GET['order'])) ?              sanitize_text_field($_GET['order']) : 'DESC'; // use default value here ''          $by_rank = esc_url(add_query_arg(array(         'meta_key' => $meta_key,         'orderby' => $orderby,         'order' => $order     )));     ?>     <a href="<?php echo $by_rank;?>">  Rank       I should add that if I add the query_posts array directly into the page template it works just fine.


title: Is there a plugin that will allow a tag cloud to be created from any mysql field?

text: I have run into a frustrating situation in the development of my site/store. I am using the Shopp plugin and there is a disconnect between the tags in WP and the tags in the store plugin. In my case I have both articles with tags and products with tags. I do not want them in the same tag cloud but I do want tag clouds of both categories. While this discrete issue is solvable with tools that already exist... It started me thinking that many situations would benefit from a tag cloud that was definable directly to a db field. This would allow rapid addition of tags and the ability to have multiple tag clouds on a site that perform radically different functions. Has this already been solved? For most users to use it would need to be an easily used plugin. If one could define a set of tags by the content of a mysql field you could have a tag cloud for about anything. I hope the editing of the question made the issue a bit clearer. Input appreciated! MM/RC


title: add capability to author role to be able to delete attachments

text: I need my authors to have the right to delete any of the attachments they uploaded in case they made some mistake. Currently if the author clicks on any thumbnail in media-library, he gets the `edit_image` link but not the `delete_permanently` link ( as it appears for higher roles ). So right now, the author gets to edit the text content and edit the image but _cannot delete the image-attachment_. I took a look at wordpress codex for roles and capabilities and found that there is nothing called delete_attachments. So is this possible, What am I missing ? I am trying to employ a bit of code something like the one suggested here for the add_cap filter. _example code :_               function add_author_caps() {             $role = get_role( 'author' );                  $role->add_cap( 'delete_attachments' ); //of course this wont work          }     add_action( 'admin_init', 'add_author_caps');      How do I get something like this to work. Again, basically I am just looking for a way for my site-authors to have a capability to delete the attachments they uploaded.


title: multiple wordpress installs w/shared user database but separate content databases

text: Is it possible to have two wordpress installs, one at the main address and one at a subdomain, with a shared user database but totally different/separate content databases? For example: http://www.maindomain.com and subdomain.maindomain.com I am trying to build a community website that will allow for admins only to make posts on the main domain but allow for a shared set of users to make posts on the subdomain. I want the content to be totally separate for each install (so content from both databases doesn't show up in a search on either site) but make it easy for users to jump back and forth between the two sites and comment on posts/message one another...etc. Any help would be greatly appreciated!


title: Ajax - Call to undefined function get_option()

text: So I've been working in Wordpress lately with Ajax and I managed to get some stock data into my site from my database. However, I am now trying to use Ajax to load Wordpress posts into my left sidebar, which requires the use of Wordpress functions and it seems as if I am not doing this properly. I have gone through the Wordpress Codex and several other threads/tutorials about this topic, however I am extremely confused about what I am doing wrong. **Javascript File**               function load_blog_posts_function()      {          jQuery.ajax({          url: "wp-content/themes/Divi/js/stockchart/blog-list-query.php",          data: ({action : 'load_blog_posts_sidebar'}),          success: function(data) {          alert(data);          }          });     }      **PHP File**               <?php      function load_blog_posts_sidebar()     {     $stockSymbol = $_GET['symbol'];     /* Set up the query arguments. */     $options = get_option("widget_rpwe_widget");     $args = array('fb' => $cat);     $default_args = apply_filters( 'rpwe_default_query_arguments', $args );     $rpwewidget = get_posts($default_args);     //echo $options;     echo("hello world");     }     ?>      I also read that some code was needed in my functions.php, so I have this:               $dirName = dirname(__FILE__);     $baseName = basename(realpath($dirName));     require_once ("$dirName/js/stockchart/blog-list-query.php");          add_action("wp_ajax_nopriv_load_blog_posts_sidebar", "load_blog_posts_sidebar");     add_action("wp_ajax_load_blog_posts_sidebar", "load_blog_posts_sidebar");      I currently get two errors when I try to run this, the more important one is > Call to undefined function get_option() which tells me that my php script is not recognizing Wordpress functions and I also get this one: > Warning: session_start(): Cannot send session cache limiter - headers > already sent (output started at .../www.3weekwebsites.com/wp- > content/themes/Divi/js/stockchart/blog-list-query.php:12) in > .../www.3weekwebsites.com/wp-content/themes/Divi/header.php on line 1 Could anyone please share some insight here? I would really appreciate it. :)


title: Custom Fields - Taller editing area

text: Don't know if this is possible, but can the custom fields be adjusted to be taller in the admin panel? It's a bit tedious to have to stretch the textbox every time you want to edit an existing field that contains a lot of text.


title: WP already installed is asking to install

text: Hey guys, i did a mistake on a wp site, i uploaded a wrong wp-config.php file on the server during a 3.1 update, saw the mistake, recreated a good one with the good infos, uploaded the file and didnt get back the site! Now wordpress askes me to install it! Which i dont want to, cos it's all already installed. I backuped the database and checked it online, it's all fine, with for exemple the good infos for 'home' and 'url' tables. If anyone knows what's going on (the install question) and i could get it back, it'd be more than welcome (am kinda stressed a lot now). Second question, if i do reinstall it, will it crash the existing datas in the database? EDIT: i checked the english version which is on the same database on the same server, site.com/en, it works fine.


title: Plugin for sortable posts in grid

text: I'm looking for a plugin that will emulate this current php page: ![Screenshot of flower grid](http://i.stack.imgur.com/GK35I.png)   1. Each flower to be a post with more info.    2. The dates to be sortable    3. Current blooming flowers to be featured in the widget sidebar (ok, this last one is probably a pipe dream).  Anyone have any clever ideas? Maybe a cart system of some sort?


title: Bulk User Deletion

text: I've created a WordPress 3.0 site w/ MultiSite enabled and the BuddyPress plugin installed (latest available versions of each). Initially, the site did not have a captcha enabled and now there are hundreds of spam accounts created. By default, the Super Admin panel for Users only shows 15 users at a time. I need to delete several hundred users and going through this page by page is monotonous. Is there plugin available which would assist with bulk user deletion? I'd like to be able to select and delete a few hundred users at a time (or even better do a regex search by username). Thanks.


title: Optimize Multiple Taxonomy Term MySQL Query?

text: _( **Moderator's note:** Title was originally: "query/database optimisation")_ I'm written a function for a custom "filter" search panel that allows users to select terms from up to four custom taxonomies. I'm running the queries directly against the database and the query is averaging half a second to execute (with terms for all four taxonomies and one result returned). This seems pretty slow to me. I was wondering if there's anything I can do to either optimise the query or even the database to make this more efficient/faster. Perhaps writing a view, even? I have experience with MS-SQL but not much with MySQL and I'm not sure how things are different. Here's my function code:                   function filter_resources($phase,$wa,$aus,$topics){         global $wpdb;         $querystr="         SELECT *              FROM $wpdb->posts A                 LEFT JOIN $wpdb->term_relationships B ON(A.ID = B.object_id)                 LEFT JOIN $wpdb->term_taxonomy C ON(B.term_taxonomy_id = C.term_taxonomy_id)                 LEFT JOIN $wpdb->terms D ON(C.term_id = D.term_id)                  LEFT JOIN $wpdb->term_relationships BB ON(A.ID = BB.object_id)                 LEFT JOIN $wpdb->term_taxonomy CC ON(BB.term_taxonomy_id = CC.term_taxonomy_id)                 LEFT JOIN $wpdb->terms DD ON(CC.term_id = DD.term_id)                  LEFT JOIN $wpdb->term_relationships BBB ON(A.ID = BBB.object_id)                 LEFT JOIN $wpdb->term_taxonomy CCC ON(BBB.term_taxonomy_id = CCC.term_taxonomy_id)                 LEFT JOIN $wpdb->terms DDD ON(CCC.term_id = DDD.term_id)                  LEFT JOIN $wpdb->term_relationships BBBB ON(A.ID = BBBB.object_id)                 LEFT JOIN $wpdb->term_taxonomy CCCC ON(BBBB.term_taxonomy_id = CCCC.term_taxonomy_id)                 LEFT JOIN $wpdb->terms DDDD ON(CCCC.term_id = DDDD.term_id)                  WHERE A.post_type = 'resources'                  AND A.post_status = 'publish'                 AND C.taxonomy = 'phase-of-learning'                 AND D.term_id = '$phase'                 AND CC.taxonomy = 'wa-curriculum'                 AND DD.term_id = '$wa'                 AND CCC.taxonomy = 'australian-curriculum'                 AND DDD.term_id = '$aus'                 AND CCCC.taxonomy = 'topics'                 AND DDDD.term_id = '$topics'             ORDER BY A.post_date DESC";         return $wpdb->get_results($querystr,OBJECT);     }      Thanks!


title: TEMPLATEPATH without the theme name? No THEMEPATH constant?

text: Is there a way to get a path to the themes directory without the current theme in the path? ie, in a standard WP install, I would want a reference to: > C:\xampplite\htdocs\sitename/wp-content/themes/ But the TEMPLATEPATH constant returns... > C:\xampplite\htdocs\sitename/wp-content/themes/currentActiveTheme


title: How to change what the post creation page looks like?

text: Is there a way (plugin, or something else) to set it where there is a drop down on the "New Post" page that allows you to choose a post type and the fields change allowing you to filter what content you are putting into a post without confusing a user by having 20 different custom fields on the "New Post" page. Also, is there a plugin or other that can make custom fields with different value types (textarea, list, file upload, etc)?


title: Disable a plugin from ever upgrading?

text: Is there a way to mark a plugin as "never upgrade this plugin" ? I can't upgrade my OpenID plugin, and this prevents me from clicking the otherwise convenient "Upgrade All Plugins" button.


title: How to form post thumb in Google's result page?

text: So, this is what kind of thumbs I'm talking about. ![salads](http://n-wp.ru/wp- content/uploads/2014/04/n-wp.ru_20140410193903.png) I know a method, where is possible to show authors' avatar (We just need to use G+ account), but this is another story, I want to have unique thumb for each post. How to do this? I tried               <?php         if ( has_post_thumbnail() ) {             $thumb_id = get_post_thumbnail_id( $post->ID );             $img = wp_get_attachment_image_src( $thumb_id, array(1500,1500) );             $width = $img[1];             $height = $img[2];             if($height>=$width){                 $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), '160x160_thumb');             } else { //$height<$width                  $thumb_url = wp_get_attachment_image_src( get_post_thumbnail_id(), '160x160_thumb-3-4');             }             $thumb_abs_url = $thumb_url[0];         } else {             $thumb_url = trailingslashit( get_stylesheet_directory_uri() ).'images/default-thumbnail.png';             $thumb_abs_url = $thumb_url;         }         if ( has_post_thumbnail() ) {     $thumb_abs_url = get_the_post_thumbnail($page->ID, 'thumbnail');          }     ?>     <meta name="thumbnail" content='<?php echo $thumb_abs_url; ?>'>      in header.php file. Like in the source code of these web-sites, but this doesn't work =(


title: Wordpress Localization and Templating

text: I'm using Smarty Templates for the back-end and Handlebars for the front-end for the plugin that I'm building. It's only now that I discovered that the localization doesn't work when I declare my labels this way:               $ecom_labels = array(         'product_details' => __( 'Details', 'ecom' ),         'technical_specs' => __( 'Specifications', 'ecom' ),         'images' => __( 'Images', 'ecom' ),         'customer_reviews' => __( 'Reviews', 'ecom' )     );      And then later on supply it on my templates:               $smarty->assign( 'label', $ecom_labels );      But it seems like its working on individual variables:               $var = __('Specifications', 'ecom');     echo $var; //especificaciones      And this leads me to a solution like this:               $details_label = __('Details', 'ecom');     $specs_label = __('Specifications', 'ecom');          $labels = array(         'product_details' => $details_label,         'technical_specs' => $specs_label,     );      But I'm declaring an extra variable for each item in the array just to make the localization work. **update** Playing with the code, I noticed that its actually working:               $labels = array(     'technical_specs' => __('Specifications', 'ecom'),     );          echo $labels['technical_specs']; //especificaciones      The variable I was using was declared globally. But when I tried to declare the variable directly inside the function for the ajax hook it echoed out the translated version of the text. So I guess the problem here is how I structured my plugin. Because what I'm currently doing is declared all the variables that I plan to use globally in the global scope and then just use `global` keyword to access them later on inside the functions. Any ideas?


title: How does add_action 'comment_post' work?

text: I found an example how to How To AJAX-ify WordPress Comments. I tweak it little bit and so far everything works fine but I want to understand the code.   1. Where did the arguments `$comment_ID, $comment_status` come from? I cannot find any reference about the arguments that are available. Can I use any other? More importantly do I have to use above names and what are the values for $comment_status?   2. Do I have to call `wp_notify_moderator()` and `wp_notify_postauthor()` functions or they would be called by WordPress when inserting the comment into database?   3. I don't understand syntax of these two lines `$commentdata=&get_comment($comment_ID, ARRAY_A); $post=&get_post($commentdata['comment_post_ID'])` what does the `&` does and what is `ARRAY_A` Could some one answer my questions about below function that is called from this action. I know that `2` means that `ajaxify_comments` can accept two arguments but where did they come from? What about the names? Values? Possible values?               add_action('comment_post', 'ajaxify_comments',20, 2);      and the function code is like               function ajaxify_comments($comment_ID, $comment_status){         if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){             //If AJAX Request Then                  switch($comment_status){                 case '0':                     echo "success1";                        // send a message to ajax                     wp_notify_moderator($comment_ID);       // notify moderator of unapproved comment                     break;                 case '1':                                   // approved comment                     echo "success2";                            // send a message to ajax                     $commentdata=&get_comment($comment_ID, ARRAY_A);                     $post=&get_post($commentdata['comment_post_ID']);                     wp_notify_postauthor($comment_ID, $commentdata['comment_type']);                     break;                 default:                     echo "error";                           // send a message to ajax              }              exit();           }     }


title: How does Cross Site Scripting (XSS) work exactly?

text:
On WordCamp Europe I attended the talk by Brad Williams on Writing Secure WordPress Code and I would like to make sure that I implement these tips in my own code. In his presentation he gives the following example: BAD:               <?php          $title = "";     ?>
<?php echo $title; ?>
      GOOD:               <?php          $title = "";     ?>
<?php echo esc_html( $title ); ?>
      Although I realise that this is a very simple example, my question is _how_ \- or perhaps more important **when** \- would someone be able to add something like `<script> alert( 'Hello Europe!' );</script>` in the first place?


title: Editor hidden tags when switch Visual to Text tabs

text:
From Wordpress 3.9, 3.9.1 versions was errors with showing on Editor. Here is problems: **Step 1: When create new page and paste this content:**
Allyson Ignazio rated       **Step 2: And click Update. Next step: I switch to Visual Tab and see result:**               Allyson Ignazio rated      **Step 3:When I switch back to Text Tab, content is:**
          Allyson Ignazio rated
      **Step 4: When I reload page (do not click update): and result same Step 1.** **_==> Here is problem with Wordpress 3.9, 3.9.1 version. Have anyone help me resolve this problems?_** Thanks and regards, Lai


title: Category count but only if category has at least one post

text: I need to display the number of categories which I can do with this...               <?php echo $num_cats  = wp_count_terms('category'); ?>      ...but I only want it to count categories that have at least one post. Thanks in advance.


title: Running a Development Copy of WordPress?

text: * Download a copy of development site (in wordpress) + the database into my local machine   * I reconfigured site_url & home in database   * The url is myhost/wordpress   * htaccess file:                    RewriteEngine On     RewriteBase /wordpress/     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /wordpress/index.php [L]             * I use permalink link: myhost/wordpress/%category%/%postname%/   * Issue: the admin end seems working, but the non of the urls are working. It gives me 404 error. **Update:** I solved it by adding "AllowOverride All" to apache config. It was changed back to default after upgrade. The lesson for me is: I should look around myself, rather than go too far away from the problem.


title: How are these PHP functions applied to a specific page in WordPress?

text:
I'm getting most of what's going on in the following code, with some help from http://www.php.net and http://codex.wordpress.org/Function_Reference/. In its current situation, only one page on the site triggers the popup form if no cookie is set. Is that functionality specified within this code? Here's the functions:               if (isset($_POST['confirm']) && isset($_POST['location'])) {          setcookie("Location", $_POST['location'], time()+3600);          }     elseif (!isset($_COOKIE["Location"])) {         setcookie("Location", "", 1);     }     elseif (isset($_POST['deny'])) {         setcookie("Location", "", 1);     }          // Popup confirmation      function show_popup($content) {         global $post;         $location = get_post_meta($post->ID, 'location', TRUE);         if (strtolower($l) == strtolower($location) || strlen($location) == 0            || (isset($_COOKIE["Location"]) && strtolower($_COOKIE["Location"])           == strtolower($location))) {             return $content;         } else {             ?>

Foo.

Yes/No?
         <form action="<?php echo $PHP_SELF ?>" method="post">         <input type="hidden" name="location" value="<?php echo $location; ?>" />         <input type="submit" name="confirm" value="Yes" />         <input type="submit" name="deny" value="No" />         </form>
             <?php         }     }     add_filter('the_content', 'show_popup');          // Adds content to the  tag     function add_meta_content() {     if(isset($_POST['deny'])) {     ?>     <meta http-equiv="refresh" content="0;url=<?php bloginfo ('wpurl') ?>">     <?php     }     if(isset($_POST['confirm'])) {     ?>     <meta http-equiv="refresh" content="0;url=<?php echo $PHP_SELF; ?>">     <?php     }          }     add_action('wp_head', 'add_meta_content');


title: Performance impact with inactive plugins?

text: > **Possible Duplicate:**   >  Do deactivated plugins slow down a WordPress site? Hi, Does having inactive plugins installed (but not active) impact the performance of your wordpress install? Is it always better to delete them rather than just leaving them installed but inactive? Thanks! -Adam


title: How do I add custom attributes to javascript tags in Wordpress?

text: I am looking to enable CloudFlare's RocketLoader feature that enables asynchronous loading of Javascript for my Wordpress site. The problem, however, is that there is one plugin for that I want to be loaded normally. From a technical point of view, according to https://www.cloudflare.com/wiki/Rocket_Loader, I simply need to change any script tag I want ignored to have the `data-cfasync="false"` attribute as follows: `<script data-cfasync="false" src="/javascript.js"></script>` Unfortunately, I can't seem to figure out how to do this for plugins that are automatically loaded by Wordpress. Any ideas?


title: Can I create a page template, use it once, then hide/remove the option to use it again?

text: I am working on a WP theme/project that includes several custom page templates that will only be used once each. For example, there is a page with a map and search form for finding things on the map. Clearly the map page needs a unique page template, but that template will never be used for any other pages. I would like to hide or remove this page template from the "Template" drop-down menu, so when the client is selecting page templates they only see options they should select from. Anyone know how to do that, or should I be approaching this from an entirely different angle? Thanks, Kirkland ++++++++++++++++ UPDATED - Solution: For each of the page templates that I wanted to use one time only (ie: during setup, before the client had access) I simply removed...               /*     Template Name: NAME_HERE     */      So that it wouldn't show as an option when adding a new page. Then I replaced everything in page.php with this...               if ( is_front_page() ) { include('page-home.php'); }     elseif ( is_page(22) ) { include('page-something.php'); }     elseif ( is_page(48) ) { include('page-whatever.php'); }     else{ include('page-default.php'); }      Everything that was in `page.php` gets moved to `page-default.php`. Or you could just put it all inside the `else` statement at the end. Either way. This works for me because I will be doing the setup for the client, so I will be creating the "one time only" pages before handing this project off to them - I will know the page IDs. BTW... You do not need to keep the naming scheme `page-XXX.php` for this to work. I just did that so I can group them more easily. I left the "Template Name" comment in the pages I do want the client to be able to select when adding pages (ex: "full width" `page-full.php`) and did not add a if condition or include to them in `page.php`.


title: Is There A WordPress Plugin That Produces PDFs of Posts Locally?

text: Most of the WordPress PDF plugins out there use services like Joliprint and Print Friendly to convert posts to PDFs. Is there a plugin that does this locally utilizing the power of PHP (and/or WordPress), I mean, without using an external service?


title: WP_Query orderby meta key/value suddely stopped working

text: I have code that has been working for a long time which when a user clicks a button to order database results by name/value, it gets the results via AJAX from a page that does all the querying. I have recently moved the entire site to a new dedicated server and changed some javascript files around, but for some reason the ordering has now stopped working. Here is my code:                   if($pageType == 'prize-home'){              if($orderby == 'pointsvalue'){ //Must have these if statements because if its ordered by pointsvalue, its orderby meta_value_num, but if its a srting (smalltitle) its orderby meta_value             $my_query = new WP_Query('post_type=prizes&showposts='.$per_page.'&meta_key='.$orderby.'&orderby=meta_value_num&order=asc&paged='.$page);         }elseif($orderby == 'smalltitle'){             $my_query = new WP_Query('post_type=prizes&showposts='.$per_page.'&meta_key='.$orderby.'&orderby=meta_value&order=asc&paged='.$page);         }else{             $my_query = new WP_Query('post_type=prizes&showposts='.$per_page.'&meta_key=smalltitle&orderby=meta_value&order=asc&paged='.$page);         }                  while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; $my_meta = get_post_meta($post->ID,'_my_meta',TRUE);                   $pointsvalue = get_post_meta($post->ID,'pointsvalue',TRUE);             $bigtitle = get_post_meta($post->ID,'bigititle',TRUE);             $smalltitle = get_post_meta($post->ID,'smalltitle',TRUE);             $productUrl = get_post_meta($post->ID,'producturl',TRUE);             $imageUrl = get_post_meta($post->ID,'imageurl',TRUE);             include('profile/prize-style.php');                   endwhile;               $no_of_paginations = $my_query->max_num_pages;             wp_reset_query();      It now loads different pages (paginated results) fine, but when the order button is clicked it doesnt really do anything. Some things move about occasionally but it doesnt sort the results alphabetically. I really dont think I have changed anything but Ive been trying different things all day with this and its getting frustrating. Has anyone has a similar experience? All console firebug results seem fine - as in all the query parameters are being passed over properely etc...


title: Site not responding error - taking long to load

text: I have a wordpress website which gets around 20K visits a days and with around 7pages/visit and 62 hits per visit. My server is : > 8 processors --> Intel(R) Xeon(R) CPU E5405 @ 2.00GHz > > 8 GB RAM Now my users are complaining about that the site takes time to load sometimes and craches giving the taking too long to load and it also happened to me a couple of times wher i thought it was my connection. From previous issues I know that there is a query that sometimes take too long and the site was crashing from it. I then tweaked the server and changed the query_cach_size (because on days with traffic spike the site was stopping alot) in the `my.cnf` file into `256MB` and after that the site stopped the errors on busy days but started giving this kind of error. Any ideas ? How can I monitor my site and see when it goes down and what is causing it to troubleshoot this ? * * * **EDIT:**   1. I am using a dedicated server.   2. The `my.cnf` file looks like:              [mysqld]     max_connections = 250     safe-show-database     skip-locking     key_buffer = 128M     max_allowed_packet = 24M     table_cache = 700     sort_buffer_size = 16M     read_buffer_size = 8M     read_rnd_buffer_size = 16M     myisam_sort_buffer_size = 64M     query_cache_size = 128M     max_heap_table_size = 180M     tmp_table_size = 180M     thread_cache_size = 16     wait_timeout = 45     interactive_timeout = 600     skip-name-resolve     skip-innodb          [mysqldump]     quick     max_allowed_packet = 16M          [mysql]     no-auto-rehash          [isamchk]     key_buffer = 80M     sort_buffer_size = 64M     read_buffer = 2M     write_buffer = 2M          [myisamchk]     key_buffer = 80M     sort_buffer_size = 64M     read_buffer = 2M     write_buffer = 2M        3. The site will stop responding sometime when I click on any hyperlink (post, page just anything that requires action). Thank you


title: How to Change the path of a child page?

text: I am displaying the list of child pages of the current page. but at one child page i want to give a path to pdf. how can it be possible? Please help. Here is my code:               $args = array(             'child_of'     => get_the_ID(),             'date_format'  => get_option('date_format'),             'depth'        => 0,             'sort_column'  => 'ID',             'sort_order'   => 'ASC',             'title_li'     => ''             ); ?>        <?php wp_list_pages( $args ); ?>      output is-                **current page**         child page1         child page2         child page3 (..it should be link to pdf..)         child page4         child page5      Please help me to find out the solution?


title: Custom comment types. Are they a possibility?

text: I see everywhere this has been discussed, there still isn't a good answer out there. I don't want to create a custom post type and associate it that way. I want a custom comment type so editors in the backend can add comments on posts while they're in the editorial phase before it goes out and we need to display those comments in the backend as well but, also keep them separate to where those comment won't display on the front end.


title: Empty meta-box returns publishdate if no value is set?

text: I have no idea why this would/could happen. I have a custom metabox for an "event_end_date" set for a custom-post-type. If I leave this field blank it always puts out the publish-date of the post itself? I use the Custom-Metaboxes-and-Fields-for-WordPress library like this …               $meta_boxes[] = array(         'id'         => 'event_info_optional',         'title'      => 'Optional',         'pages'      => array( 'wr_event'),         'context'    => 'normal',         'show_names' => true,         'priority' => 'core',         'fields'     => array(                  array(                 'name' => 'End time of event',                 'id'   => $prefix . 'event_end_time',                 'type' => 'text_time',             )         ),     );      And I save the value like this …               $wr_event_end_date = isset($_POST['wr_event_end_date']) ? $_POST['wr_event_end_date'] : '';     $event_end_date = new DateTime($wr_event_end_date);     update_post_meta($post->ID, "event_end_date", $event_end_date->getTimestamp());      And I query the value like this …               function get_event_end_date($post) {        $date = get_post_meta($post->ID, 'event_end_date');        if ( !empty( $date[0] ) ) {            //only if a value is saved I return the value            return $date[0];        }     }      This works for all other custom fields. Just for my event-end-date it doesn't. If I leave the field empty in my backend and save the post, the post itself always shows the publish-date of the post as event-end-date. Why and how could this `get_event_end_date()` function return the publish-date of the post if I leave it empty. If I set a value to the field it works fine, but if I leave it empty I don't want the function to return anything. **UPDATE**                       // End-event-date             /*$wr_event_end_date = isset($_POST['wr_event_end_date']) ? $_POST['wr_event_end_date'] : '';             $event_end_date = new DateTime($wr_event_end_date);             update_post_meta($post->ID, "event_end_date", $event_end_date->getTimestamp());*/                  if ( isset($_POST['wr_event_end_date']) ) {                 die('this is getting called even though the field is submitted blank');                 $event_end_date = new DateTime($_POST['wr_event_end_date']);                 update_post_meta($post->ID, "event_end_date", $event_end_date->getTimestamp());             } else {                 update_post_meta($post->ID, "event_end_date", "");             }


title: Plugin or method of allowing user to rearrange custom post types with drag and drop?

text: I'm using a custom post type entry to represent each person in an About Us page. When going to the About Us page, it displays the people in a side menu and if the user clicks on a person's name, it goes to a page about that particular person. My client wants to be able to order the people in the side menu. Is there a good way to do this? I'd prefer to allow the client to drag and drop the posts around to the right order similar to how the Page Manager works, but alas it does not work for custom post types. Any ideas?


title: get_var result empty for query of custom table in plugin admin

text:
(There are a lot of related questions to this but none I can find with answers that have worked.) get_var returns empty when I query a custom table from a custom plugin for multisite. What am I missing? (I have also tried get_row and get_results which also return empty.) This is for a publish/unpublish button in the subsite admin using jquery/ajax. The publish function works, creates a new post in the subsite user's blog, and inserts the post_id, blog_id and uniquecode in the custom table. The unpublish function also works in so far as I am able to delete the correct row from the custom table. What's not working is, within the unpublish function, before deleting the row from the custom table, I need to retrieve the post_id and delete the post from the subsite user's blog, but the get_var query for the post_id returns empty. Here is the relevant portion of the unpublish function, showing the get_var query and delete correct row, plus print_r checks at bottom:               global $wpdb;      $customtable = $wpdb->$table_prefix.'customtable'; // works for $wpdb->delete but not $wpdb->get_var     $user_blog_id = get_current_blog_id(); // works      $uniquecode = $_POST[uniquecode]; // works via jquery-ajax, value obtained from external database     $post_id = $wpdb->get_var($wpdb->prepare('SELECT post_id FROM '.$customtable.' WHERE uniquecode = '.$uniquecode.' AND blog_id = '.$user_blog_id.'')); // not working, returns empty     wp_delete_post ($post_id, true); // $post_id = $wpdb->get_var is empty, preventing wp_delete_post from working           $wpdb->delete( $customtable, array // works - deletes row from $customtable          (         'blog_id'=>$user_blog_id,           'uniquecode'=>$uniquecode          ),           array('%d','%s')         );           echo 'Post ID#';     print_r($post_id); // returns empty     ?>
<?         echo 'Unique code #';     print_r($uniquecode); // returns correct value     ?>
<?     echo 'Blog ID#';     print_r($user_blog_id); // returns correct value


title: How can I tell if I'm on a login page?

text: There are functions for `is_home()`, `is_blog()` `is_single()` etc... What's the best way to tell if I'm on a page that is requesting that I login? I guess that would just be the wp-login.php page.


title: output custom Posts on a Page

text:
I'm trying to write a function that will output a set of posts on a page. Because I want to display more than just the post titles, `wp_get_archives()` won't do (I think). The function to add the post list parses the page meta to find out what kind of list it's supposed to output. Then it runs a query for those post types and outputs them using the same template fragment used for in `archive-{posttype}.php`. At least that's how it's supposed to work. Here's the function which lives in my `functions.php` file:               function ASH_archive(){         global $posts;         $postholder=posts;//so I can reset to original after archives done         if(!$ptype=get_post_meta('ASHarchivetype')) return;//no archive requested         $path="layouts/layout-blog.php";         $pt='post';         switch($ptype){             case 'equipment':             case 'dyeing':             case 'spinning':             case 'weaving':                 $pt='ash_'.$ptype;                 $path="layouts/{$ptype}/layout-blog.php";                 break;             case 'loomsong':                 $pt='ash_loomsong';                 break;         }         $posts=get_posts(array('post_type'=>$pt));         get_template_part($path);         $posts=$postholder; //reset to original value     }      I want to use the function in this template:               <?php     /*     Template Name: Archives with Content     */          get_header(); ?>
     <?php     suffusion_page_navigation();     suffusion_before_begin_content();     ?>
     <?php     global $post;     if (have_posts()) {         while (have_posts()) {             the_post();             $original_post = $post;     ?>             <div <?php post_class('fix'); ?> id="post-<?php the_ID(); ?>">     <?php suffusion_after_begin_post(); ?>

                         <?php suffusion_content(); ?>
                 <?php                     // Due to the inclusion of Ad Hoc Widgets the global variable $post might have got changed. We will reset it to the original value.                     $post = $original_post;                     suffusion_after_content();                 ?>
     <?php          ASH_archive(); //NOTHING HAPPENS. WHY????          comments_template();     ?>
     <?php         }     }      ?>

     <?php get_footer(); ?>      The function doesn't seem to do anything. I don't know if this is because the function is written improperly or if I need to attach it to a hook of some kind. I've read about filters and actions and I can't figure out which hook I should use for my function or even if that's the right direction. Help? ps, what might be even nicer, is a shortcode to call the function whereever I wanted to.


title: Help with add_filter('the_content', 'some_function') and multiple matches

text: I have a site where a user can insert slideshows into a post by entering the shortcode in the content box. He can also add videos by adding the video code in the same box. I need to separate these two shortcodes out from each other so that I can control when the slideshows are displayed and when the videos are displayed. I'm using add_filter and preg_match to match the correct shortcode and then echo each match out - however it's currently only displaying the first match from each one. Here's my code - I'm not sure I completely understand how add_filter works, so probably have my display methods wrong: Videos:               /* VIDEO SLICE */     function video_slice( $content ){         preg_match( '/\[video.*\]/' , $content , $matches );         if( isset( $matches ) && $matches !== "" ){             foreach( $matches as $match ){                 return $match;             }         }     }          if( !has_filter('the_content') ){       add_filter( 'the_content','video_slice');        }else{       remove_filter('the_content','slidedeck_slice');       add_filter( 'the_content', 'video_slice');       }     the_content();      I have a similar setup for the Slideshows, except my slideshow_slice function matches `[SlideDeck .*]` instead. How can I loop through an array of matches and print the output via `the_content()`? Thanks


title: Authentication from sub-folder non-wp cookie WordPress

text: I have a question about user authentication in my WordPress Multisite site. My site is http://www.drezzy.it that has its own user db with a login and logout system. This is a non-WP website. When you login, it gives a cookie which include the email and the password of the user. I created a WordPress Multisite website inside this one, http://www.drezzy.it/community/speciale/ that can have access to the cookie. My questions are:   1. How can I allow WordPress to log in users by using the main site's cookie, so that they don't have to register or log in again? A sort of bridge between the main site and WP that would enable to log in only once for all.   2. How can I create a new user in WP for each user logged in the main website? P.S. I'm sorry for my English, if you have some troubles with understand it, ask me, I will explain better! :D