title: Trying to Implement .pdf File Upload in Admin for plugin

text:
This is the first time in my plugin development that I have had a need to upload a file. UH-OH!!! I create my plugins OOP and I have always used jQuery .serialize to post the data to my plugin.php file but I can't do that and upload a file. The admin form that will allow the admins of the site to upload .pdf files for their users:
                 <?php                      echo '';                 ?>                                   Add New Document

                 <form id="frmNewDocument" action="<?php echo plugins_url('new_document.php', dirname(__FILE__)); ?>" method="POST" enctype='multipart/form-data'>                     <input type="hidden" name="post_date" value="<?php echo date('Y-m-d'); ?>">

                                                                                Select Group (required)                                                                      	         <select name="groupID" id="groupID">                                         <?php foreach($groups as $group): ?>                                             <option value="<?php echo $group->id; ?>"><?php echo $group->name; ?></option>                                         <?php endforeach; ?>                                     </select>

                                                                                Document Name (required)                                                                      	         <input type="text" id="document" name="document" value aria-required="true" />

                                                                                Description (required)                                                                      	         <textarea id="description" name="description" value aria-required="true"></textarea>

                                                                                Upload PDF: (required)                                                                      	         <input type="file" name="doc" id="doc" />

                         <button href="#" class="btnCancelAdd">Cancel</button>                                                       <input class="button button-primary" type="submit" id="btnNewDocument" name="newDocument" value="<?php _e( 'Add New Document' ); ?>" />
                 </form>      In the root of the plugin folder, I created the new_document.php to handle the upload. I want to create a camelCase name for the .pdf created from the "document" field. Here's what I have in that file:               <?php     require_once('/public_html/wp-config.php');     global $wpdb;          define("UPLOAD_DIR", '/public_html/wp-content/uploads/gdocs/');          if( !empty( $_FILES['doc'] ) ):         $uFile = $_FILES['doc'];               if ($uFile["error"] !== UPLOAD_ERR_OK) {             echo "
An error occurred.
";             exit;         }              $post_date = $_POST['post_date'];         $groupID = $_POST['groupID'];         $document = $_POST['document'];         $description = $_POST['description'];              $d_pieces = explode(' ', $document);         $new_name = ' ';         $count = 1;              foreach ($d_pieces as $piece){             if ($count !== 1){                 $piece = ucfirst($piece);             } // end if             $newName .= $piece;             $count++;         } // end foreach              $flName = $newName.".pdf";         $fileName = strtolower( $flName{0}) . substr($flName,1);              $success = move_uploaded_file($uFile['tmp_name'], UPLOAD_DIR . $fileName);     else:         echo "No File Uploaded.";     endif;          $wpdb->insert( 'ppm_group_documents', array( 'groupID' => $groupID, 'post_date' => $post_date, 'document' => $document, 'description' => $description, 'path' => $fileName ), array( '%s', '%s', '%s', '%s', '%s' ) );          header('Location: http://[sitename]/wp-admin/admin.php?page=ppm-doc-viewer');     ?>      ---UPDATE--- The code above works but it is a PHP only rather than WordPress solution. I hope someone could point me to a book or article explaining how to uploads files the "right way" in an OOP plugin. ---END UPDATE-- I am only getting the white screen of death and through FTP, I checked the upload folder and the file isn't there. Since this is a live site, I can't turn on debugging. I am hoping someone will spot something I am doing incorrectly but would also like it if someone could point me to a book or article explaining how to uploads files the "right way" in an OOP plugin. Thanks in Advance!!!


title: Automate post creation in wordpress

text: I have a database which has 2000 items. I would like to a) create a page for each item b) Create another page comparing two items. With 2000 items I can create thousands of pages. I am from java programming background so my solution was to write code which will fetch all the items from the database a) run in a loop and create the pages b) run two loops and pass in if of items. Code will fetch details and create the pages. My questions Is the right way to go create searchable, SEO friendly page for each item ? Where do I create the code to execute the desired functionality ? Will it be a plugin or function or a script ?


title: Plugin Flexible Captcha Image Generates 500 Internal Server Error

text: I am getting an internal server error on a captcha image at http://dev.smithonstocks.com/newsletter-subscription/ and I do not know why. **Screen Shot Exhibit** ![enter image description here](http://i.stack.imgur.com/xfr9P.jpg) **Research I have Done** - I have Googled this issue extensively for 3 days now. I have posted this issue here on WPSO on 2 other occasions. I have emailed the developer 3 times (no response). I have offered to pay the developer to solve the issue. I have looked at the server logs for the 500 error and they tell me nothing. I have increased my server memory from 256M to 512M. I turned PHP error display on for ALL errors (nothing revealed). I have posted 3 WordPress Forum messages (no helpers). **What I Need to Have Happen** - to get the Captcha Image to render **Server Error Log Excerpt**               123.456.789.012 - - [30/Dec/2013:11:52:45 -0500] "GET /?FC_captcha_request=a3916daa8e4597cbe764dccb03c45cc0&rs=1388422365&cwidth=200&cheight=24&uniqueID=a6346bb16d4c875c15269ae86fabd1fe HTTP/1.1" 500 - "http://dev.smithonstocks.com/newsletter-subscription/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"      **My Custom Tweaks to Server**               PHP_INI('memory_limit'): 512M     PHP_INI('safe_mode'): off     cURL is Enabled     IMAP Extensions are Enabled within PHP     mcrypt() is Enabled within PHP     PDO is Enabled     PEAR is installed     PHP GD Support: bundled (2.0.34 compatible)


title: Display WP Start bar on front page only

text: I was wondering if someone could help me display the plugin WP Start bar only on my static frontpage. If it helps my static frontpage url is: http://zackarylundquist.westhostsite.com/portfolio/


title: Cannot Save Data to the wp_options table using the wp_editor

text:
The following code I have written is not saving the data to the wp_options table:               function create_company_paragraph_1(){     ?>
Write the text you want to be displayed in the first paragraph in the company info secition.
     <?php         $options = get_option('company_info_arraykey');         $args = array(             'wpautop' => false,             'textarea_name' => 'company_info_arraykey[textarea_one]',             'media_buttons' => false,             'textarea_rows' => 5         );         wp_editor( '', "company-paragraph-1-editor", $args);          }      When I type anything into the editor and press submit when the page refreshes the data is gone and not saved. I know this works because on another option using a text input box it works see below:               function create_input_company_title_option() {         $options = get_option('company_info_arraykey');         ?><input type="text" name="company_info_arraykey[company-title]" value="<?php echo $options['company-title']; ?>" /><?php     }      I just need to know what little thing I am doing wrong?


title: Trouble preventing duplicate posts between 2 loops on homepage

text: I know this topic has been covered multiple times before, but I've tried every tutorial I've found online and haven't been able to figure it out. I'm using the free NewsMojo theme (http://fthemes.com/newsmojo-free-wordpress- theme/) on my blog (http://eldoradofrontier.com/) and would like to have the posts appearing in the "featured" carousel not also appear in the main feed below it. I don't want to use any category filtering, because I expect my site to have too many new posts for it to make sense to have to go back and remove old posts from the featured carousel. I don't know much about PHP, but I tried the $do_not_duplicate trick mentioned in the codex ( _it won't let me post the link because I'm new_ ) without any success. As far as I can tell, these are the two loops on my homepage: One, in the file template.php in the folders "featuredposts":               <?php                 $featuredposts_source = $this->theme->get_option('featuredposts_source');                 $featuredposts_moreoptions = $this->theme->get_option('featuredposts_moreoptions');                      $featuredposts_query = false;                      if($featuredposts_source == 'category') {                     if($this->theme->display('featuredposts_source_category')) {                         $featuredposts_query = 'posts_per_page=' . $this->theme->get_option('featuredposts_source_category_num') . '&cat=' . $this->theme->get_option('featuredposts_source_category');                     }                  } elseif($featuredposts_source == 'posts') {                     if($this->theme->display('featuredposts_source_posts')) {                         $featuredposts_query = array('post__in'=> explode(',', trim($this->theme->get_option('featuredposts_source_posts'))), 'post_type'=>'post');                     }                  } elseif($featuredposts_source == 'pages') {                     if($this->theme->display('featuredposts_source_pages')) {                         $featuredposts_query = array('post__in'=> explode(',', trim($this->theme->get_option('featuredposts_source_pages'))), 'post_type'=>'page');                     }                  }                      if($featuredposts_query) {                     $featuredposts_excerpt_length = $this->theme->get_option('featuredposts_excerpt_length');                     query_posts($featuredposts_query);                     if (have_posts()) : while (have_posts()) : the_post();                      ?>      And the next, in the file loop.php:               <?php     global $theme;     if (have_posts()) : while (have_posts()) : the_post();     ?>      I think I need to create an array with the post IDs in the first loop, then tell the second loop to ignore those posts ... right? But how do I do that? Thanks in advance for the help, and sorry for the noob question! -Cody


title: get cat id is not working from custom taxonomy

text:
I have a custom taxonomy "city". I am having a hard time to get cat id. the number. It's also custom post type "job" This works only for default category under the default post.                 $provinceID = get_cat_ID($cityname);       echo "
bb=".$provinceID."
";      I have found this one but it's not also working as well. the function name was get_cat_ID and it caused an error. so I have changed name.                 function get_cat_ID11( $cat_name='$cityname' ) {     $cat = get_term_by( 'name', $cat_name, 'category' );     if ( $cat )         return $cat->term_id;     return 0;       }            echo get_cat_ID11;      How can I get the cat id from custom taxonomy , custom post type?


title: How to add a new link to the default register form's footer links?

text: I would like to add a custom link to the footer section of the register form. How can I do this? I am using the `login_footer` hook:               add_action( 'login_footer',array($this, 'add_forum_menu'), 50, 2 );     function add_forum_menu() {         //need code to append the new items on the menu      ) );      ![enter image description here](http://i.stack.imgur.com/ULLVG.png)


title: Fetching posts that match a User Profile setting

text: I have a Custom Field in my User Profile page that allows site authors to specify which town they come from when they set up their account. The towns are in the form of a selectable dropdown select element. What I would like to do is query the WP database to populate a dropdown of all the towns on the **front end** of my WP site and, when one town is selected, go to a page that lists all the authors who live in the town selected. I don't have any code as I'm not even sure how to begin such a thing.


title: How to override the wordpress default widget markup

text: I am new to wordpress, Here i use the wordpress TwentyEleven theme, i need to customize the widget markup. It means the suppose i want to change the element 'ul' to div and add some class or id to this element. Now currently it was not possible for me because the wordpress default widgets are already available inside wordpress core file..


title: Replacing a placeholder term with a session variable value in taxonomy filter

text: I have in my themes some code which will set a session variable. For the sake of example, it's a geolocation routine which will set to either USA, UK or ROW, resulting in:               $_SESSION['region'] = 'USA';      and I have a custom taxonomy of 'regionok' which any or all of the same terms are set. I wish to use the session variable value as the taxonomy term to filter on. The cleanest solution I can imagine would be to have a filter hook in my functions.php which would replace the placeholder term 'auto-region' with the session value before each query is executed. That way I can use widget plugins without having to hack them - I would just use the placeholder term in configuration. However, I don't know what the relevant hook would be. (Other use cases would be session variables for family filter, referrer, etc. The geolocation example is entirely incidental.)


title: How to add custom columns to Custom Post Type admin screen

text: I have another dumb question, but I can't get one thing :) I've found this very good article on creating custom post types: http://thinkvitamin.com/code/create-your-first-wordpress-custom-post-type/ I'm not sure how Step 4 works. This guys writes:               add_action("manage_posts_custom_column",  "portfolio_custom_columns");     add_filter("manage_edit-portfolio_columns", "portfolio_edit_columns");          function portfolio_edit_columns($columns){       $columns = array(         "cb" => "<input type=\"checkbox\" />",         "title" => "Portfolio Title",         "description" => "Description",         "year" => "Year Completed",         "skills" => "Skills",       );            return $columns;     }     function portfolio_custom_columns($column){       global $post;            switch ($column) {         case "description":           the_excerpt();           break;         case "year":           $custom = get_post_custom();           echo $custom["year_completed"][0];           break;         case "skills":           echo get_the_term_list($post->ID, 'Skills', '', ', ','');           break;       }     }      I have two different post types ('books' and 'movies'). And I can't get how to link this code with right one! I'm sure I'm missing something (most likely in the code), but I didn't see him including "portfolio_edit_columns" anywhere in the code. I have found this in WP Codex: http://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column and it seems like > manage_edit-${post_type}_columns does the magic, but I've tried both manage_edit-books_columns and manage_edit- movies_columns and nothing! :) So how to create two separate column layouts for different post types?


title: Wordpress Theme Development Seemingly Awful Partitioning of Includes?

text: I just finished a tutorial that told me to create my `header.php` without closing a tag at the bottom of the included file. Now while I realize that in anyone of the parent files which includes `header.php` it includes the closing tag; this really goes against my better judgement as a front-end developer; because someone who edits the theme later (and it could be me, it could be somebody else) would have to know that this tag needed to be closed in the parent file which includes it. It just feels wrong. It feels like when your editor marks the tag as "an extra closing tag" you want to delete it. I'm not breaking a standard if I use:               <?php include(TEMPLATEPATH . '/justTheHTMLHeader.php'); ?>     <!-- AND -->     <?php include(TEMPLATEPATH . '/justTheBlogHeader.php');` ?>      instead of `get_header()`? It seems to me that this approach would be more modular and not leave any extraneous tags not closed between included files and their parents. I also noticed that the default Wordpress template is setup this way, so I'm obviously wrong and breaking some sort of Wordpress theme standard not matter what I think. What's the reasoning behind this?


title: how could I have a user signing up for a blog, be assigned to that blog only

text: We have a WPMU instance: http://my.blogs.com/blog1 http://my.blogs.com/blog2 Now, blog1 is closed to used registration, while blog2 us open to users registering and posting. now, how do I get to have a user added to only blog2 when he signs up ? as of now, he is not added to any blog and only this. Now, if I have blog3, which also has registration enabled, how could a user signup only to that ? Is there a plugin that can detect the blog URI and add the user only to that ?


title: Automatically create a loop for post ID

text:
I am having trouble generating a loop for my post. The JS calls the slide_ID which then needs to display each slide-ID in numeric order for it to work. Example for slide-1 to scroll to its next slide the slide_ID needs to be slide-2 (this is being controlled by a next button). The problem is not in the JS but within the loop. I need to populate each post so each post ID number is in numeric order.                 <?php if (have_posts()) : ?>       <?php while (have_posts()) : the_post(); ?>             <section id="<?php $x=1; do { echo "slide-$x"; $x++; } while ($x<=1); ?>" class="homeSlide">                   <div class="bcg"                          data-center="background-position: 50% 0px;"                          data-top-bottom="background-position: 50% -100px;"                          data-anchor-target="#<?php $x=1; do { echo "slide-$x"; $x++; } while ($x<=1); ?>">
                   <div class="hsContent" data-center="opacity: 1" data-106-top="opacity: 0" data-anchor-target="#<?php $x=1; do { echo "slide-$x"; $x++; } while ($x<=1); ?> h2">
Fade out elements before
they leave viewport

This slide moves background image at a slower speed then the page scroll.

       <?php endwhile; endif; ?>      The loop I am using to display the slide ID number is $x=1; do { echo "slide-$x"; $x++; } while ($x<=1); but I can not seem to figure out how to change the number automatically when a new post has been submitted. Any help would be great


title: Problem converting tags to categories while having large number of tags

text: I'm trying to convert some tags in my website to categories, via either Wordpress import tools or Taxonomy Converter plugin. In both cases, I get **Internal server Error** , when I try to query (load) the tags, because my website is having over 20,000 tags. Is there a manual or MySQL query method I can use for converting? Since my website can't just display the 20,000 tags in a single page for me to choose from.


title: How to add custom rewrite rule to .htaccess?

text: I want to add a custom rewrite rule to my .htaccess file using a function inside functions.php The rewrite rule I want to add is as follows: `RedirectMatch 301 ^/author/(.+)$ http://name-blog.com/$1` I know there is a wordpress function that adds a rewrite rule to the .htaccess: `$wp_rewrite->add_external_rule( 'mobile/([^/]+)$', 'mobile/index.php?action=$1' );` So, how can I use that to add my rewrite rule to .htaccess? ## SOLVED! I found the solution just after posting here. Here is the codex: http://codex.wordpress.org/User:Amereservant/Editing_and_Customizing_htaccess_Indirectly And this is the code I was looking for:               function my_htaccess_contents( $rules )     {     $my_content = <<<EOD     \n # BEGIN My Added Content     # Protect wpconfig.php     <Files wp-config.php>         Order Allow,Deny         Deny from all     </Files>     # END My Added Content\n     EOD;         return $my_content . $rules;     }     add_filter('mod_rewrite_rules', 'my_htaccess_contents');


title: Disable user profile editing for one user

text: I have being looking in internet how can I disable the option of edit profile in Wordpress for a user and I didn't find a good way. The problem is that I want that the 95% of users can edit their profiles (address, telephone,...) but there is another 5% that I don't want them to have access to the profile section. The best solution for me is to select manually the users that I want to disable but I also thought about create a role or a group of users to manage it. There is no plugin for this and the only thing I have found is the following code but it is not working.               add_action('admin_init', 'user_profile_fields_disable');          function user_profile_fields_disable() {              global $pagenow;              // apply only to user profile or user edit pages         if ($pagenow!=='profile.php' && $pagenow!=='user-edit.php') {             return;         }              // do not change anything for the administrator         if (current_user_can('administrator')) {         return;         }         if (current_user_can('custom_role') {           add_action( 'admin_footer', 'user_profile_fields_disable_js' );         }           }     /**      * Disables selected fields in WP Admin user profile (profile.php, user-edit.php)      */     function user_profile_fields_disable_js() {     ?>         <script>             jQuery(document).ready( function($) {                 var fields_to_disable = ['email', 'role'];                 for(i=0; i<fields_to_disable.length; i++) {                     if ( $('#'+ fields_to_disable[i]).length ) {                         $('#'+ fields_to_disable[i]).attr("disabled", "disabled");                     }                 }             });         </script>     <?php     }      You have to substitute the "custom_role" with the name of the role I have assign to the user. Is that code obsolete or bad? Any idea of how to solve it? * * * Thank you very much G.M.! It was a great and perfect solution. I forgot to tell that I am using the Woocommerce plugin and I still have the problem of profile editing in the "my account" page. Could you add something to the plugin above to remove the "edit" link? I don't mind that the user can read his profile but don't allow to edit it. Here is what I am talking about (some fields are in spanish): ![enter image description here](http://i.stack.imgur.com/Py9h1.jpg) Thanks again for your work!


title: custom processing for posts

text:
Although I'm very well aware of PHP, but I'm kind of new to WordPress. So I created this WordPress site, but there's a bunch of posts that I want them to include some PHP and JavaScript and HTML codes.   for example, let's say that I want some POST to include an HTML code like this

___XXXXXX___

                      <?php          /*some php code here*/      ?>      and the **_ _xxxxx_ _** should be changed according to client input. but the client has no coding background at all. so is there some type of custom forms that I can add to the (add new post) page ? or is there a way to add new post type with different processing ?      also it should be inside the wordpress Dashboard


title: Multiple post back-to-back display only one gallery

text: I have 3 post, post1=text, post2=text and gallery1, post3, text and galery2 I like to list ALL the post from one category, and the result is all the data get out, but the gallery associated with the post is ALL THE SAME. yep the second post and post#3 have the same picture... the problem, the shortcode of gallery is associated with post, but with all the post display in a single page, the gallery are not specific what i have done wrong ? some code :               //Add a ShorCode to get a page/post content     add_shortcode ('page','get_page_content');        function get_page_content ($att) {            if (is_array($att)) { $req_id = $att['id']; }            else { $req_id = $att; }            $post = get_page($req_id);             $content = apply_filters('the_content', $post->post_content);            return $content;        }


title: jQuery conflict

text: I am trying to run the following jQuery to change the text of my username and password boxes so that they do not need a label (inside `<script>` tags):               jQuery(document).ready(function($) {         $('#user_login1').val('Username');         $('#user_pass1').val('Password');         $('#user_login1').focus(function(){             $('#user_login1').val('');         });         $('#user_pass1').focus(function(){             $('#user_pass1').val('');         });     });       The code works on jsFiddle **[updated]** (proving it's a WP issue not a jQuery issue). I have tried without the `function($)` modifier and replacing the `$` with `jQuery` but to no avail. ~~I am "trusting" the folks that codeUse Google Libraries to sort the jQuery out on my site meaning my jQuery include looks like this: `<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>`~~ **EDIT 1** Now not calling it at all, as when I add `wp_enque_script('jquery');` it breaks the admin pages showing nothing but a blank white page. Never the less jQuery gets called like so:               <script type="text/javascript" src="http://elitetradersgroup.com.au/wp-includes/js/jquery/jquery.js?ver=1.7.1"></script>      **END EDIT 1** **EDIT 2**   * Changed spelling to `wp_enqueue_script('jquery');`   * Changed `$` in jQuery to `jQuery`   * It has become apparent that jQuery is broken site wide, save wp-admin Still not working. The above location (edit 1) that the jQuery is called from does exist. I noticed that it calls `jQuery.noConflict()` twice. Once in the output of the page, and once at the bottom of the jQuery file. **END EDIT 2** **EDIT 3** In response to Chip Bennett here is the call found in `functions.php` of my theme.               wp_deregister_script('jquery');     wp_enqueue_script('jquery');      It also occured to me I had not posted up my website for testing, outside of the jsfiddle code. The form I am trying to get working is on the top right of this page: http://elitetradersgroup.com.au/ **END EDIT 3** **EDIT 4** Replaced the jQuery in edit 3 with the following based off of chip bennett's answer               function wpse45377_enqueue_scripts() {         wp_enqueue_script('jquery');     }     add_action( 'wp_enqueue_scripts', 'wpse45377_enqueue_scripts' );      I also thought to look at the console output in Chrome's dev tools and got this:               Uncaught ReferenceError: jQuery is not defined   Line:25         (anonymous function)      The code it is referencing is this               25: <script type='text/javascript'>jQuery.noConflict();     26: /* <![CDATA[ */     27: var tb_pathToImage='http://elitetradersgroup.com.au/wp-includes/js/thickbox/loadingAnimation.gif';     28: var tb_closeImage='http://elitetradersgroup.com.au/wp-includes/js/thickbox/tb-close.png';     29: /* ]]> */     30: </script>      **END EDIT 4** Which is the same version of jQuery that jsFiddle uses so I can't understand why this isn't working. A little help would be much appreciated.


title: How to add/edit content Custom Content item in theme

text: For my first wordpress/website, I purchased a WordPress theme. I can edit and add pages fine. My level of understanding is: to add a page I use the Pages | Add New button in the Dashboard. Where I'm stuck: The theme also comes with a header that cycles through images and accompanying text. I can't figure out how to change the text. Are there files somewhere that I'm supposed to edit, or somewhere through the dashboard to enter this information, or has this been forgotten by the theme developer? The examples for the header from the dummy content that's currently loaded appear in the Dashboard under Custom Content, but I can't see anything that links to the actual content, e.g., the text that's displayed. (I've pasted the code below, but I think it's all just style info).               [lnt_flexslider gallery_id="979" image_type="image-1980-600" slider_style="1" title_enable="1" title_font_size="70" title_animation_initial_position="25,15" title_animation_target_position="0,15" title_animation_duration="800" title_animation_easing="easeInOutExpo" subtitle_enable="1" subtitle_font_size="28" subtitle_animation_initial_position="25,55" subtitle_animation_target_position="0,55" subtitle_animation_duration="1000" subtitle_animation_easing="easeInOutExpo" pagination_style="1" pagination_position="inner" pagination_bottom_border="1"]      I'm a complete novice with these tools, so please let me know if there's some additional info that would help.


title: Is there a way to prevent author change when editor/administrator edits a post?

text: As an administrator when I change or edit a post of an author (for example add a category through quick edit) the author of the post changes. We do not want this to happen. Is there a way to prevent this?


title: Wordpress site blacklisted by Google about .htaccess

text: my website www.saoyuying.com (the site is in Chinese :)) is included in Google's malware blacklist yesterday. But I didn't find any unusual files on the server. Google's report mentioned that "Some of the URLs on this site redirect browsers to web pages that install malware. This indicates that the server(s) that host pages for this site may contain altered configuration files (such as Apache's .htaccess file)." While my .htaccess content is copied below:               # BEGIN WPSuperCache     # END WPSuperCache          # BEGIN WordPress     <IfModule mod_rewrite.c>     RewriteEngine On     RewriteBase /     RewriteRule ^index\.php$ - [L]     RewriteCond %{REQUEST_FILENAME} !-f     RewriteCond %{REQUEST_FILENAME} !-d     RewriteRule . /index.php [L]     </IfModule>          # END WordPress      Is anything harmful here? Or what else should I check? I would really appreciate your help! Thanks & Regards, Joe * * * **[UPDATED]** @Dwayne Thanks to Dwayne's answer, the actions below have been taken: I. Installed 3 security plug-ins in wordpress: Exploit Scanner, WP firewall 2, BulletProof Security. Exploit Scanner scanned the website and found several 'eval' and 'base64_decode' like               eval(function(p,a,c,k,e,r){e=function(c){return(c<a?      I know it just means executing string content. But I was not able to find anything suspicous. II. Sucuri SiteCheck. The result is here: Sucuri SiteCheck on saoyuying.com which says: > Malware found in the URL: http://www.saoyuying.com//404javascript.js > > Known javascript malware. Details: http://sucuri.net/malware/malware-entry- > mwht291 Location: http://namesti.bee.pl/ But I can't find this '404javascript.js' on the server, nor inside functions.php or index.php. This js looks like the root cause as the URL 'namesti.bee.pl' is also mentioned in Google's warning. But how to locate and get rid of it? Thanks again in advance.


title: How can this multiple loop have pagination as described?

text:
In the paste below is the code for the template running the CPT archive page at http://www.m.angiemeekerdesigns.com/totd Everything about the page is working as expected except the pagination. What would like to happen is that when "Next Page" is clicked, Page 2 and forwards show the next posts from the CPT archive that were not also shown in one of the two loops on the first page. SO, I would not like for the first loop to repeat on subsequent pages, and I do not want subsequent pages to have the first post offset, and since there are 11 total posts on page 1 of this archive, I'd like the next page to not show those first 11 posts. Right now what is happening is that it is not showing the first loop (good), it is not offsetting the first post (good), but it is showing all 11 posts from the first page - for page 2 and every page after. Whew! Can this archive be corrected to paginate as I'd like? I have read MANY other posts and the codex on pagination for loops, and multiple loops (that's how I got to what I have), but alas, what I have is not working.               <?php          /**      *      * Display the Tip of the Day Custom Post Type archive custom fields using      * ACF.      *      * @author Angie Meeker      * @uses   Advanced Custom Fields      */          add_action('genesis_entry_content','genesis_do_post_title', 2);                               //* Add Tip of the Day body class to the head     add_filter( 'body_class', 'add_tiparchives_body_class' );     function add_tiparchives_body_class( $classes ) {        $classes[] = 'tiparchives-post-type-archive-{tipoftheday}';        return $classes;     }           // Return Category and Tip of the Day on Single Posts     add_action ( 'genesis_before_content', 'show_totd', 9 );     function show_totd() {             echo '
Tip of the Day
';     }       // Remove Post Author     add_filter( 'genesis_post_info', 'remove_post_author_totd_posts' );     function remove_post_author_totd_posts($post_info) {         $post_info = '[post_date]';         return $post_info;     }               /** Replace the standard loop with our custom loop */     remove_action( 'genesis_loop', 'genesis_do_loop' );     add_action( 'genesis_loop', 'totd_do_loop');     add_action( 'genesis_loop', 'totd_teasers_do_loop');                                   add_action('genesis_loop', 'totd_do_loop');     function totd_do_loop() {     if ( !is_paged() ) {         global $wp_query;         // Set up your query here         $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;         $query = array(             'post_type'      => 'tipoftheday',             'orderby'        => 'date',             'posts_per_page' => '1',              );              $wp_query = new WP_Query( $query );              if( $wp_query->have_posts() ):             while( $wp_query->have_posts() ): $wp_query->the_post();                 // Get the custom fields                         // Store the pre tips data             $tips_data_pre = array(                     'totd_tags' => get_field( 'totd_tags' ),                     'tip_article_headline' => get_field( 'tip_article_headline' ),                     'article_author' => get_field( 'article_author' ),                     'article_author_link' => get_field( 'article_author_link' ),             );               // Only output if we have tips data                 if ($tips_data_pre['totd_tags'] != '' ||                     $tips_data_pre['tip_article_headline'] != '' ||                     $tips_data_pre['article_author'] != '' ||                     $tips_data_pre['article_author_link'] != '') {                    echo '' , do_shortcode('[post_date]'),'' ;                          echo '

';                    echo '
' . get_the_title() . '
';                                echo the_excerpt();                                     echo '
' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'
' ;                                     echo '

Share This Tip:

';                               echo '
';             }                            endwhile;              endif;         // Reset the query         wp_reset_query();         }     }                                             add_action('genesis_loop', 'totd_teasers_do_loop');     function totd_teasers_do_loop() {         global $wp_query;         // Set up your query here         $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 0;         $query = array(             'post_type'      => 'tipoftheday',             'orderby'        => 'date',             'posts_per_page' => '10',             'offset'        => '1',             'paged'  => $paged,         );              $wp_query = new WP_Query( $query );              if( $wp_query->have_posts() ):             while( $wp_query->have_posts() ): $wp_query->the_post();                 // Get the custom fields                         // Store the pre tips data             $tips_data_pre = array(                     'totd_tags' => get_field( 'totd_tags' ),                     'tip_article_headline' => get_field( 'tip_article_headline' ),                     'article_author' => get_field( 'article_author' ),                     'article_author_link' => get_field( 'article_author_link' ),             );               // Only output if we have tips data                 if ($tips_data_pre['totd_tags'] != '' ||                     $tips_data_pre['tip_article_headline'] != '' ||                     $tips_data_pre['article_author'] != '' ||                     $tips_data_pre['article_author_link'] != '') {                     echo '
                     ',get_the_time( 'l' ),'                     ',get_the_time( 'm/d/Y' ),'
';                          echo '

';     echo '
' . get_the_title() . '
';                     $excerpt = get_the_excerpt();       echo string_limit_words($excerpt,25); echo 'ID) . '"> Continue Reading→';                                     echo '
' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'
' ;                                     echo '

';                               echo '
';             }                       endwhile;             // Pagination! Woo!             genesis_posts_nav();         endif;         // Reset the query         wp_reset_query();     }               genesis();      * * * EDITED I've come back to show my progress which used most of that same code offered by @mneil below (someone also mentioned in it the WP.org forums). The pagination does work correctly, and the first post is showing correctly in the first loop, but now the second loop is not offsetting properly (not skipping that latest post - the same shown in the first loop). Besides that though, this does work. Any thoughts on why the second loop would now skip the offset post?                  /** Replace the standard loop with our custom loop */     remove_action( 'genesis_loop', 'genesis_do_loop' );     add_action( 'genesis_loop', 'totd_do_loop');     add_action( 'genesis_loop', 'totd_teasers_do_loop');          add_action('pre_get_posts', 'myprefix_query_offset', 1 );     function myprefix_query_offset(&$query) {              //First, define your desired offset...         $offset = 0;              //Next, determine how many posts per page you want (we'll use WordPress's settings)         $ppp = 11;              //Next, detect and handle pagination...         if ( $query->is_paged ) {                  //Manually determine page query offset (offset + current page (minus one) x posts per page)             $page_offset = $offset + ( ($query->query_vars['paged']-1) * $ppp );                  //Apply adjust page offset             $query->set('offset', $page_offset );              }         else {                  //This is the first page. Just use the offset...             $query->set('offset',$offset);              }     }          add_filter('found_posts', 'myprefix_adjust_offset_pagination', 1, 2 );     function myprefix_adjust_offset_pagination($found_posts, $query) {              //Define our offset again...         $offset = 0;              //Ensure we're modifying the right query object...             //Reduce WordPress's found_posts count by the offset...              return $found_posts - $offset;         }                    add_action('genesis_loop', 'totd_do_loop');     function totd_do_loop() {     if ( !is_paged() ) {         global $wp_query;         // Set up your query here         $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;         $query = array(             'post_type'      => 'tipoftheday',             'orderby'        => 'date',             'posts_per_page' => '1',              );              $wp_query = new WP_Query( $query );              if( $wp_query->have_posts() ):             while( $wp_query->have_posts() ): $wp_query->the_post();             $do_not_duplicate = $post->ID;                  // Get the custom fields                         // Store the pre tips data             $tips_data_pre = array(                     'totd_tags' => get_field( 'totd_tags' ),                     'tip_article_headline' => get_field( 'tip_article_headline' ),                     'article_author' => get_field( 'article_author' ),                     'article_author_link' => get_field( 'article_author_link' ),             );               // Only output if we have tips data                 if ($tips_data_pre['totd_tags'] != '' ||                     $tips_data_pre['tip_article_headline'] != '' ||                     $tips_data_pre['article_author'] != '' ||                     $tips_data_pre['article_author_link'] != '') {                    echo '' , do_shortcode('[post_date]'),'' ;                          echo '

';                    echo '
' . get_the_title() . '
';                                echo the_excerpt();                                     echo '
' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'
' ;                                     echo '

Share This Tip:

';                               echo '
';             }                            endwhile;              endif;         // Reset the query         wp_reset_query();         }     }                                             add_action('genesis_loop', 'totd_teasers_do_loop');     function totd_teasers_do_loop() {         global $wp_query;         // Set up your query here         $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 0;         $query = array(             'post_type'      => 'tipoftheday',             'orderby'        => 'date',             'posts_per_page' => '10',             'offset'        => '1',             'paged'  => $paged,         );              $wp_query = new WP_Query( $query );              if( $wp_query->have_posts() ):             while( $wp_query->have_posts() ): $wp_query->the_post();                      // Get the custom fields                         // Store the pre tips data             $tips_data_pre = array(                     'totd_tags' => get_field( 'totd_tags' ),                     'tip_article_headline' => get_field( 'tip_article_headline' ),                     'article_author' => get_field( 'article_author' ),                     'article_author_link' => get_field( 'article_author_link' ),             );               // Only output if we have tips data                 if ($tips_data_pre['totd_tags'] != '' ||                     $tips_data_pre['tip_article_headline'] != '' ||                     $tips_data_pre['article_author'] != '' ||                     $tips_data_pre['article_author_link'] != '') {                     echo '
                     ',get_the_time( 'l' ),'                     ',get_the_time( 'm/d/Y' ),'
';                          echo '

';     echo '
' . get_the_title() . '
';                     $excerpt = get_the_excerpt();       echo string_limit_words($excerpt,25); echo 'ID) . '"> Continue Reading→';                                     echo '
' , do_shortcode('[post_terms taxonomy="totd_tags" before="See More Tips For: " taxonomy="totd_tags"] '),'
' ;                                     echo '

';                               echo '
';             }                       endwhile;             // Pagination! Woo!             genesis_posts_nav();         endif;         // Reset the query         wp_reset_query();     }


title: Logout redirect to current page - function

text: I'm looking for a function that can redirect users when they logout to the current page. I'm looking for a code I can use in `functions.php`?


title: How To Change Custom Taxonomy To Radio Buttons

text: I've actually found a solution to my problem here: Altering the appearance of custom taxonomy inputs but I wanted to ask a followup question, and it seems I couldn't ask in that thread. Here's the code provided on that thread that seemed to work.               add_action('add_meta_boxes','mysite_add_meta_boxes',10,2);         function mysite_add_meta_boxes($post_type, $post) {         ob_start();     }     add_action('dbx_post_sidebar','mysite_dbx_post_sidebar');          function mysite_dbx_post_sidebar() {         $html = ob_get_clean();         $html = str_replace('"checkbox"','"radio"',$html);         echo $html;     }      When I use the code above, it does transform the checkboxes in all taxonomy boxes to a radio button. But I only want 3 boxes to change their checkboxes into a radio button. So how do you turn the checkboxes into radio buttons for a specific taxonomy box? tnx.


title: Why won't draft listings appear for non-admins?

text: I have a draft post with the author set to 5. User #5 is trying to view that draft on the front end using a WP_Query with the following arguments:               array {       ["name"]=> "example-52f00a8ba19f4"       ["post_status"]=> array {         [0]=> "draft"         [1]=> "private"       }       ["post_type"]=> "customlisting"       ["posts_per_page"]=> 1       ["author"]=> 5     }      The user trying to view this is user #5. They are trying to view their own draft post, so that they can publish it... (on the front end) The SQL query that is available in `$wp_query->request` **does in fact return the listing** (screenshot from HeidiSQL). But it does not appear in `$wp_query->posts`, and it seems WP_Query is removing it after the actual SQL query. How can I prevent WP_Query from removing this? I don't know where to look. I don't know why it's happening either :/ **Update:** It seems the query only fails if searching by post name. It works by post ID (post__in, rather).


title: Plugin could not be activated because it triggered a fatal error, unexpected '['

text: I'm attempting to dynamically create a text widget, add it to a named sidebar widget that my theme has already created ($sidebar_id = 'home-header-widget'), then populate the text widget with some preset content. I'm getting an error as indicated above at line 35 (commented below). Any ideas what I'm doing wrong?               Parse error: syntax error, unexpected '[' in C:....widgettest.php on line 35               <?php     /*     Plugin Name: Widget Test     */               function cb_activate_widgettest(){              $ops = get_option('widget_text');         // find an $id that works...         $ops[$id] = array(           'title' => '',           'text' => 'bar', // content?         );         update_option('widget_text', $ops);              $sidebar_id = 'home-header-widget';         $sidebars_widgets = get_option('sidebars_widgets');         $sidebars_widgets[$sidebar_id] = ["widget_text-$id"];  //this is line 35         update_option('sidebars_widgets', $sidebars_widgets);     }          register_activation_hook(__FILE__, 'cb_activate_widgettest');     ?>


title: Is it possible to move a comment that should be a reply to another comment?

text: I like to have a clean blog, and I also like that comments that are replies to other comments actually are replies to other comments. Some people don't mind that difference too much and just leave another comment instead of a reply. That's alright, but I'd like to fix it so that my blog stays clean and so that things are clearer to myself. Is there a way that I can "move" a regular comment so that it becomes a reply to a certain comment instead?


title: Re-write URL for certain sub-pages only

text: For better Organization in my Admin panel for Pages on a site I would like to add a page called "Unlisted" and then add sub-pages to this page that I do not want to be listed on the site...the purpose of these "landing pages" is for them to only show up in search engines or directly linked. Now if I do this, these sub-pages will end up with a url like this `/unlisted/page-name` and I would like to do a re-write for sub-pages of the 'unlisted' page ONLY so that all the sub-pages of that page will instead have a url like this `/page-name` I am pretty sure this is possible as I have done many fancy re-writes in the past with WordPress but I could use some help here please?


title: Possible to use pagename inside get_template_part?

text: I'd like to grab the current page name and pull that specific template part per page. This way I can just set up a generic tier-1 template that calls in a secondary section based on the current page's title (without having to use a bunch of conditional statements). So, it'd look like this...               <?php get_template_part( 'section', '$pagename' ); ?>      Pulling in the file: **section-pagename.php** (eg., **section-about.php** ). Is this possible? I wonder if anyone has used this approach. I think it'd be a really efficient way of templating.


title: How would I go about listing only unattached media in say a sidebar?

text: I have a client who uses PDF files for their newsletter, I don't think that this is a good idea personally, but it's not negotiable. They have a news page where they put real time news and they'd like to add a sidebar to this page where there would be links to download these PDF files which would update automatically when they add them to the media library. So that the page doesn't over populate we've agreed that only the 12 most recent newsletters should be shown, that's 1 for each month of the year. They have no plans to add media of any other type without it being attached directly to posts or pages, so I figure that just a list of the 12 most recent unattached media files should suffice. Is there a way that this can be done using say a custom loop or WP_query object? I really have no idea how to go about starting this. I've done all sorts of workarounds in all sorts of ways regarding custom loops and sidebars so that's not the issue, what I really need to know is if there is an option for the loop to only display unattached media, or some WordPress function that lists media. I can't really give any examples or snippets of my code because I haven't started anything yet. EDIT: Okay, figured it out. Okay, I found a pretty straight forward sort of solution. It's not perfect because it's taking excessive amounts of steps per newsletter but it works exactly how I want it to. This is what I've got sitting in my sidebar:                       <?php query_posts('category_name=newsletter&number_of_posts=12');                   if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>                        // From here down I found on a site which I'll cite below.                   <?php $args = array(                         'post_type' => 'attachment',                         'numberposts' => null,                         'post_status' => null,                         'post_parent' => $post->ID                   );                   $attachments = get_posts($args);                   if ($attachments) {                         foreach ($attachments as $attachment) {                               echo '<li>';                               the_attachment_link($attachment->ID, false);                               echo '</li>';                         }                   } ?>                        <?php endwhile; endif; ?>                   <?php wp_reset_query; ?>      I made a category called Newsletter and the only thing I put in each post is a title and attach a PDF, the title doesn't even carry through, but it's necissary to publish the post. Finally, here is the link to the source for that code. I love these guys.


title: Automatically adding meta data to posts or multiple query help

text: I run an events company whose website uses a custom post type system for posts (blog), events and tickets all stored as CPT's in the DB. On the guestlist (which counts 'ticket' custom posts if the event [post] number == current post) I would like to implement a "New Customer" tag to prompt the host to look out for them. There are two problems with this: you cannot search for the oldest 'ticket' post, as they may not have bought them in chronological order, and you cannot get all tickets and order by post number as they may not have been added to the site in chronological order either. The two ways I can think of getting around this is either: (1) By multiple search arrays, i.e. query TICKET > to get USER > get all TICKETS for USER NUMBER > get EVENT [POST] NUMBERS from those tickets (stored as meta) > get EVENTS by post number > - SORT ARRAY BY DATE of event > IF FIRST EVENT IN THAT ARRAY == CURRENT EVENT [post] NUMBER echo **NEW CUSTOMER**   This seems to be an awfully long way around and I am a little reluctant to try and make all that work as a relatively novice coder. (2) Somehow retrospectively adding a 'date of event' meta data tag to all ticket posts and then I can directly query them.... Much easier, but I am unsure how to then re-translate that 010214 so that the query recognises it as a date rather than a number... Number (2) would be ideal but I can't find any information as to how to add all this data retrospectively, and then for future posts - all the data is there in the system but all searches for information lead me to people talking about going back and batch adding search engine meta, not WordPress post meta. I started coding Number (1) and realised the mountain ahead of me and stopped - if anyone would like that portion of the code though, I can still post it... Thanks in advance, sorry for the long question - trying to equip any helpers with as much information as possible. > EDIT: A way around this could be actually to use the event page itself as > each `$event` and `$ticket` are called there. Structure could be:               write meta to `$ticket`     with     meta key = 'event_date'     value = $eventDay [= date( 'dmy', $event->start );]      Then a simple query to find all user tickets, and order by this new meta tag 'event_date'. If first entry event number == current post, BINGO!


title: How build a custom login/register form with error handling?

text:
So, I'm working on a plugin in which I'm making a custom page containing a login form as well as one for user registration; I have the forms built and operational, below is my code.                                   <form name="loginform" id="login_form" class="login_form" action="<?php echo esc_url( wp_login_url() ); ?>" method="post">
             <input type="text" name="log" id="user_login" class="input" placeholder="Username" />

             <input type="password" name="pwd" id="user_pass" class="input" placeholder="Password" />
              <button name="wp-submit" id="wp-submit" class="btn"><?php _e("Sign in", "shorti"); ?></button>              <input type="hidden" name="redirect_to" value="<?php echo $_SERVER["REQUEST_URI"]; ?>" />          </form>                    <form method="post" id="register_form" class="wp-user-form" action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>">
             <input type="text" name="user_login" id="user_login" class="input" placeholder="username" />

             <input type="email" name="user_email" id="user_email" class="input" placeholder="email address" />

You will receive an email with a generated password
(which you can change in your "user settings")
              <?php do_action('register_form'); ?>         <button name="wp-submit" id="wp-submit" class="btn"><?php _e("Register!", "shorti"); ?></button>         <?php $register = $_GET['register']; if($register == true) { echo '
Check your email for the password!
'; } ?>         <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>?register=true" />         <input type="hidden" name="user-cookie" value="1" />          </form>      This works fine beside the fact that whenever there's an error message it redirects the user to wp-login.php. I'm needing the page with the form to handle all the errors with AJAX; so as to give a better user experience. What is the best way to go about doing this?


title: How do I list multisite users for the current site only

text: I'm looking for a way of selecting the users for one site within a multisite set up. Can anyone tell me how to do this please? This is what I have at the moment:               $user_search = $wpdb->get_results("SELECT ID, display_name, user_email FROM ".$wpdb->base_prefix."users");      but this selects all users across the multisite. Many thanks!


title: Jetpack - stats_get_csv period parameter

text: I'd like to create a query to show the top 6 most read posts over the last two days. However, I'd like to only include posts created within the last month to prevent older stories from showing up. I am using Jetpack and wordpress.com stats, so I've created this query for Top Posts, but I'm unsure whether it is the correct approach               $top_posts = stats_get_csv('postviews', 'period=month&days=2&limit=6')      My primary confusion is with the stats_get_csv API period parameter, and how it is used / what the effects are.


title: How to change how many list item show in category generated by file edit-tags.php

text: It's always been a pain in the @$$ to see only 20 item in category. If i have 30, it paged on 2 pages, i hate that. If WordPress had a preference for that. So the question, Hot to list ALL the category, whatever the number... if i have 200, list them all, no paging. I inspect edit-tags.php and could not find "show_item=20" of something like that The question, how to make edit-tags.php show 9999 item (or unlimited) of have a plugin to customize that without hacking the WP core file. * * * I think the magic is happening here, but changing 20 to 999 dont change anything               add_screen_option(          'per_page',          array(             'label' => $title,              'default' => 20,              'option' => 'edit_' . $tax->name . '_per_page'         )      );      It's for product attribute in woocommerce.


title: Title tags show twice

text: My Title tags same sentence show twice. please see it. how i can solve this problem . my site


title: Separator for multiple terms

text:
I'm trying to show terms of custom taxonomies. I have that. But, my problem is how to separate when I have multiple terms.   My code:
         <?php $loop = new WP_Query( array( 'post_type' => 'member', 'posts_per_page' => -1 ) ); ?>         <?php while ( $loop->have_posts() ) : $loop->the_post(); $do_not_duplicate = $post->ID; ?>

<?php $terms = get_terms('department');                     foreach ( $terms as $term ) {                         echo $term->name.' and ';                     }                 ?>
                 <?php the_post_thumbnail('full'); ?>

<?php the_title(); ?>

<?php $terms = get_terms('position');                         foreach ( $terms as $term ) {                             echo $term->name.' and ';                         }                     ?>
                     <?php the_content(); ?>                     <a href="<?php the_permalink(); ?>">See Full Biography

         <?php endwhile; wp_reset_query(); wp_reset_postdata(); ?>
      With this I am able to display all terms used (good). But, I need it to say "and" only between terms. Right now, it says "and" after every term, even it's only one term.   I know my problem lies within here:               <?php $terms = get_terms('department');         foreach ( $terms as $term ) {             echo $term->name.' and ';         }     ?>      How do I only get the "and" to only show between terms and not after every term?


title: Wordpress Network site edit missing user list?

text: `[domain]/wp-admin/network/site-users.php?id=2` shows no users listed but there are definitely users in the blog. Where/How can I fix this?


title: Can I use Pages like a Wiki

text: I would like to have a central place to keep my notes for projects. Does it make sense to use pages like a Wiki?


title: Redirect deleted posts to category archive

text: I have a website (http://www.ticketyoda.co.uk) and the events listed become outdated after they have been and gone. I have set it up so that posts automatically expire and are moved to Drafts. So now I have links which point to the site which are outdated. What I want is the following redirection               example.com/1stcategory/2ndcategory/eventABC      when it expires to go to               example.com/1stcategory/2ndcategory/      This not only makes sense for a user point of view but also as an SEO factor. I cannot seem to get any plugins to work for me so stuck at the moment.


title: Web 2.0 theme with content on a single page and scrolling links?

text: I've been looking for a specific WordPress theme for days now and still can't find anything. I appreciate that this isn't really the place to ask but I'm really out of options. http://cellprivate.com/ I'm looking for a theme like this, which scrolls down the page when you use the header links, and also has a lot of Web 2.0 aspects like a custom web font and text shadows.


title: Get Category ID inside Category template

text: how do I get the cat ID inside the Template. Very important: I can not do it by the name, because we have muliple cats with the same name. Only the slug is different. If I'd get the slug, it would be okay, too. But like I said: I can not use the Cat title.....


title: Publish pages/posts as HTML?

text: We're looking to use a plugin or custom setup for authors to create pages or posts and publish them as single HTML files. The file could be saved on the server in a specific directory or have a download button from within the editor. So far we have found 2 plugins that almost achieve this function: WP Static Output Really Static Both work fairly similar but need admin access to generate. They also create the files in the following fashion: dir-on-server/page-title/index.html _where I would need_ dir-on-server/page-title/page-title.html Any thoughts on this? Has anyone done something similar? Thanks in advance.


title: How to prevent multiple comments

text: We have an internal WordPress blog and a sort semi-trolling type situation going on. Almost all posts are flooded with comments by a single person. Basically the person is keeping a blog in the comments. This is pretty annoying and discourages other people. I don't think we want to block this person entirely (commenters use real names). Is it possible to only allow one comment per person? Maybe being able to answer in a thread? I'm not responsible for maintaining the site, but it would be nice if you could point me to a resource so I could forward it to the appropriate people.


title: nested Shortcode doesn't work

text: Shortcode:               [permalink][title][/permalink]      Output:               [title]      Wordpress shortcode API sais, it's correct: http://codex.wordpress.org/Shortcode_API#Nested_Shortcodes Any Ideas?


title: get posts and postmetas in assoc array

text: how do I get all posts and postmetas in an associative array?               $allposts = $wpdb->get_results("     SELECT $wpdb->posts.post_title, $wpdb->postmeta.meta_key     FROM $wpdb->posts     JOIN $wpdb->postmeta      ON $wpdb->postmeta.post_id = $wpdb->posts.id     WHERE $wpdb->posts.post_type = 'post' AND $wpdb->posts.post_status ='publish';", OBJECT_K);      I just don't get it....


title: Favicon plugin for WordPress running in network mode (multisite)?

text: What favicon plugin should I use in order to define favicons for Wordpress when I run in multi-site mode. Uploading favicon.ico files is not an option for multi-site wordpress instances. I am looking for something simple that will not pollute the generated pages with hidden advertising. **EDIT:** Looking to be able to define favicons on a per site basis. Different favicons for different sites.


title: Any guides on creating custom admin pages?

text: I basically want to create a table (preferably AJAXified) that lets the user enter a line of information, and be able to add new lines of information, and delete selected ones. I've found this post and this post. The design side looks very straightforward, but I want to know about the functionality. How do I go about adding the field contents to the database and summoning them back up? How do I get that page "plugged in" to Wordpress as a whole? I have literally no idea where to start. I'm coming from the perspective of someone who's confident in HTML & CSS, and fairly so with JS/jQuery, but basically just hacks up PHP code that he finds around. Any help would be appreciated, even up to telling me that it's beyond me right now, and to go play with X plugin. FWIW, I was considering doing this with a custom post type, or the Magic Fields plugin, but I wanted a more user- friendly experience. Many thanks!


title: Creating a social media score plugin

text: I'm creating a plugin which counts social scores on various sites. It uses the various API's available on the web to determine a "count" of shares or likes across facebook, twitter, delicious, linkedin, stumbleupon, digg etc. Many of you are probably familiar with javascript widgets for these sites. I'm frustrated with the overhead which this brings (multiple javascript calls, so I'm building something to work this out and store natively within Wordpress). This will also give scope for designers creating their own buttons with HTML, and a shortcode will show the share count. My problem lies in the speed of the response for the networks. They can be slow, so I'm looking for architecture / design advice. I was thinking of creating a table which holds POST_ID and a collection of scores which is updated often via WP-CRON.. and updates when a user clicks the share button as well to keep it in synch. Sound like a valid idea? Or any other ideas? If you are still confused, take a look at the new share button on the BBC. I want to bring this to Wordpress, minus the speed overhead.


title: Can /%year%/%monthnum%/%day%/ structure tags be added to custom post type permalinks?

text: Just wondering if anyone had tried using any of the structure tags available to post permalinks with custom post types... I'm moving my "listings" posts on a site I manage from a category hack under Posts to their own custom post type, but I'd like to still keep some sort of numeric date reference in the permalink structure. How difficult is that to set up?


title: How can I change the theme of different posts using a plugin?

text: I'd like some posts to look different from others. Wordpress let's me easily switch themes for pages, but not posts. Is there a plugin that will let me do that for posts?


title: Redirect to another page using contact form 7?

text: I'm using CF7 to send some information to my email and everything's working fine, but I need to redirect the users to a different page after the email has been sent, by default the forms are sent to the same page via ajax, I was thinking about setting a hidden field with the page url but since the form submits asynchronously I don't know how to set it in my page template. If the form was submitted normaly I'd do something like:               if (isset($_REQUEST['hidden_field_url']) {         wp_redirect($_REQUEST['hidden_field_url']);     }       So is there any way to send the form without ajax? Or maybe do what I need in any other way? Thanks in advance!


title: WPML icl_register_string() throws fatal error but works

text: I'm helping someone with a custom plugin and they need it to be WPML compatible. Using the method from WPML I was able to register a string in WPML and output it on the other end. However, when the plugin was initially activated I got a **Call to undefined function icl_register_string()** error. It worked, but threw a fatal error. Any idea why this could be? Source: http://wpml.org/documentation/support/translation-for-texts-by-other-plugins- and-themes/ Here's my code:               //Register Settings with WPML     icl_register_string( 'Match Previous Order' , 'match_order', 'Do you want these items to match a previous order from Direct Linen? If yes, use "Additional Notes" to explain.' );


title: How to display a message about updates in the plugin list

text: I am trying to use the hook `in_plugin_update_message` in order to display a one line message below the name of my plugin in the admin plugin list section. However, the function called in the hook does not seem to be triggerd: no message is displayed. I can't figure out what I am doing wrong. **Building the hook**               global $pagenow;     if ( 'plugins.php' === $pagenow )     {         $file   = basename( __FILE__ );         $folder = basename( dirname( __FILE__ ) );         $hook = "in_plugin_update_message-{$folder}/{$file}";         add_action( $hook, 'your_update_message_cb');     }      **Callback function**               function your_update_message_cb( $plugin_data, $r )     {         echo 'Hello World';         $output = 'Hello World';         return print $output;     }      Should I use another hook or is there an error in my code? thanks for your help


title: How to disable JS? info windows from WP-FirePHP

text: I'm using current ver of WP and WP-FirePHP. When I load the WP dashboard, firebug's Console window shows the FirePHP data. That's all good. As expected, the main browser window shows the WP Dashboard page itself. **But,** the upper left corner of the browser window shows an iframe with textual debugging info. It appears to be the names of all of the WP scripts that were used to create the Dashboard page. And the upper right has another debugging iframe that tracks the mouse position. **How do I get rid of, or move** those extra debugging iframes? And what exactly is being shown in them? The upper left one hides needed parts of the page. **ps** I don't have rep to create a FirePHP tag.


title: Registering a static menu?

text: I have a website with a very large sidebar menu that uses an accordion plugin to keep everything compact and organized. Unfortunately, my menu has grown so big that I am unable to save any new entries; my research shows that this is a known problem. Is there any way that I can create a static menu and register it so that it is recognized as a WordPress custom menu? I've been digging though codex, but haven't found what I'm looking for.


title: Is there a standard public URL convention used on a Wordpress site directly to a page listing all of a user's public content?

text: Is there a standard convention for a full direct public URL address that, when visited/clicked on, will show a page list all of user account's public content uploaded on that site. Background: I have an account with getmedia.org.uk Podcasting site and here is my home page/user profile page: http://www.getmedia.org.uk/members/therobyouknow/ However it only lists _'recent content'_ but I know I have earlier content not shown on that page. I have recently contacted the site admins but haven't heard back from them yet and not sure if they are in a position to resolve my query so I thought I would ask here. To further illustrate my point I'm looking for something like: getmedia.org.uk/members/therobyouknow/content or getmedia.org.uk/members/therobyouknow/all or getmedia.org.uk/members/therobyouknow/uploads to list _ALL_ of my content **Update:**   * I don't want an answer based on search engine results - because:     1. I want a URL of the site because it's direct and part of the site      2. The Google URL is messy      3. The google URL could change as they develop their search      4. The google URL may include other sites the refer both to the site and me     5. The google search results have superfluous and unrelated information (ads, links optiond etc) making it harder to read, if messy for such a    * Just to pre-empt any other unhelpful contribution: This question is _not_ a self-promotion of myself or my content by stealth to readers of wordpress.stackexchange.com. It is a genuine query. That said, I would like to use the URL on profiles of myself but know that others would find a similar solution useful for their posted wordpress content, so it's for me _and_ others.


title: Using wp-postratings to rate user on profile pages

text: I'm using wp-postratings on my site and I want to include it on the buddypress profiles of my members so other users can rate them. I place the function on the profile page but it doesn't do anything when a rating is clicked. Any ideas on what I can add to make it work?


title: add sidebar area to header of child theme

text:
How can I add some extra sidebar locations for widgets in a child theme. The difficulty I'm having is because the parent theme uses some pretty gnarly setup to define the current sidebars. I would like to add a sidebar area to my site's header and another sidebar area to the home template. The parent theme's functions.php file starts off with:               <?php           add_action( 'after_setup_theme', 'et_setup_theme' );     if ( ! function_exists( 'et_setup_theme' ) ){         function et_setup_theme(){             global $themename, $shortname;             $themename = "Chameleon";             $shortname = "chameleon";                  require_once(TEMPLATEPATH . '/epanel/custom_functions.php');                   require_once(TEMPLATEPATH . '/includes/functions/comments.php');                   require_once(TEMPLATEPATH . '/includes/functions/sidebars.php');                   load_theme_textdomain('Chameleon',get_template_directory().'/lang');                  require_once(TEMPLATEPATH . '/epanel/options_chameleon.php');                  require_once(TEMPLATEPATH . '/epanel/core_functions.php');                   require_once(TEMPLATEPATH . '/epanel/post_thumbnails_chameleon.php');                  include(TEMPLATEPATH . '/includes/widgets.php');                  add_action( 'wp_enqueue_scripts', 'et_add_responsive_shortcodes_css', 11 );                  add_action( 'pre_get_posts', 'et_home_posts_query' );                  add_action( 'et_epanel_changing_options', 'et_delete_featured_ids_cache' );             add_action( 'delete_post', 'et_delete_featured_ids_cache' );                 add_action( 'save_post', 'et_delete_featured_ids_cache' );         }     }      Where "require_once(TEMPLATEPATH . '/includes/functions/sidebars.php');" is the only reference to sidebars in this file. So the sidebars.php file in the includes directory contains the following:               <?php     if ( function_exists('register_sidebar') ) {         register_sidebar(array(             'name' => 'Sidebar',             'before_widget' => '
',             'after_widget' => '
 ',             'before_title' => '
',             'after_title' => '
',         ));              register_sidebar(array(             'name' => 'Footer',             'before_widget' => '
',             'after_widget' => '
 ',             'before_title' => '
',             'after_title' => '
',         ));              register_sidebar(array(             'name' => 'Homepage',             'before_widget' => '
',             'after_widget' => '
 ',             'before_title' => '
',             'after_title' => '
',         ));     }      ?>      There is a sidebar.php file in the theme's root directory that contains the following:
         <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar') ) : ?>          <?php endif; ?>
       So, let's (for now) work with adding a new sidebar area to the home template... The home.php template (which I have a modified copy of in my child theme folder) contains the following references to sidebars:               <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Homepage') ) : ?>                  <?php endif; ?>      and just before the end of the code for this template...               <?php get_sidebar(); ?>      My themes folder directory structure appears as so: mywebsiteroot > wp-content > themes > Chameleon > includes | home.php   mywebsiteroot > wp-content > themes > Chameleon > includes | functions.php   mywebsiteroot > wp-content > themes > Chameleon > includes | sidebar.php   mywebsiteroot > wp-content > themes > Chameleon > includes | style.css   mywebsiteroot > wp-content > themes > Chameleon > includes > functions > sidebar.php   mywebsiteroot > wp-content > themes > Chameleon > includes > css > other stylesheets... mywebsiteroot > wp-content > themes > lppscustom | home.php   mywebsiteroot > wp-content > themes > lppscustom | header.php   mywebsiteroot > wp-content > themes > lppscustom | footer.php   mywebsiteroot > wp-content > themes > lppscustom | style.css And... this is where I'm stuck. I know you can have your own custom functions.php and sidebar.php files in the child theme folder, but how do I structure them? Do I have to include all code from the parent theme's files? If so, how do I modify the code so any reference to sub-directories are relative? If not, how do I make it load the parent theme's function file and sidebar file as well as my custom ones? Any help would be greatly appreciated.


title: Exclude categories from homepage not longer working

text: I was using query for excluding categories from my homepage without problems until this week. I'd like to know the reason of the change and a better way to get this. I was trying also diverse solutions that I found here, no success.               function excludeCat($query) {       if ( $query->is_home() ) {         $query->set('cat', '-99, -263, -255, -268, -105');       }       return $query;     }     add_filter('pre_get_posts', 'excludeCat');      I also tried this in the index. No results.               if ( is_home() ) {     query_posts( 'cat=-99, -263, -255, -268, -105' );     }      updated: [the loop in the index: homepage.php]               <?php query_posts( array( 'posts_per_page' => $homePortfolioShow ) );      rewind_posts();     if (have_posts()) :     while (have_posts()) : the_post();     if(!get_post_format()) {     get_template_part('format', 'standard');     } else {     get_template_part('format', get_post_format());     }     endwhile;     endif;     ?>


title: Custom Post Type Root Template

text: I've created a custom post type for this project I'm working on. I've defined the URL slug to be 'vendors'. So now when I browse to www.mysite.com/vendors, it shows all of my Custom Post Type posts. I don't want the root slug to be a listing of all my posts. Is there a way to have a custom template defined for the /vendors/ slug?


title: How to import a Typo3 database to a wordpress site?

text: I have a SQL database export from a Typo3 site. Does anyone know know or have any experience of dealing with these cases?


title: Parent Page > Child Page Menu

text: I am trying to create a collapsible menu using Bootstrap. The problem I am having is getting the correct Wordpress PHP code to call the right pages. Also this menu will be displayed on these child pages. I would like the menu hierarchy to look like this: Specific Page 1 --- Child Page One --- Child Page Two Specific Page 2 --- Child Page One --- Child Page Two


title: How to create custom taxonomy URLs without taxonomy name?

text: I have a website that lists businesses in different cities (this is a niche site, so all businesses have the same "classification"). For starters I created a CPT for locations and a taxonomy called "Cities," which 150 or so cities as terms. All 300+ locations have been tagged with a city. I was able to modify the CPT links so that they appear like so: example.com/cityname/business-name What I'd love to have (and not been able to accomplish yet) are urls like example.com/cityname which would list all businesses from that city. My understanding is that by default WP attempts to find a page with "cityname" as the name. What would be the easiest way to reroute this request to use a taxonomy template? Or as an alternative, what would the easiest way be to have the page template detect the city name and pull posts tagged with that taxonomy term? I suppose I could create rewrite rules in htaccess for all cities, but I'd prefer where the redirects were automatically added when a new city name is added to the taxonomy.


title: Can I move WordPress to another folder?

text: My client has a very bare bones host who would not allow installation of WP. They insisted on doing it and in that process installed the files in a subfolder rather than at the top level. The question is, can I simply move the file to the top level and expect WP to run, or is there pathway information in the database?


title: Complex Search functionality. Advice needed

text: I have a pretty complex search feature I would like some advice on. I need to build a pretty advanced custom search in Wordpress and would like to get your opinion on how I can achieve it. I've made a lot searches for current plugins but nothing that really caters for this. I've also looked at creating custom functions (function.php) It works like this:   * Input keywords into a text field,    * these can then be added to a keyword 'bank'.    * you can then select from drop down the industry to search in (post category maybe).    * Then another drop down for country    * and a final one listing the months published (september 2012, october 2012 etc) Once the search button is hit, I need to display results based on relevance.   * So the top result would say 'Matched 4 filters: keyword, industry, country & date'.    * After there are no more results matching all 4 search options it displays any that match 3,    * then 2    * and eventually just displaying keyword searches.  So the search is essentially   * a text field to hold all keywords,    * 3 drop down select fields    * and then the search button.  I'm not convinced this is the best method to store a list of keywords given by the user before launching the search. May need to think alternatives. Hope it makes sense so far. ![http://tinypic.com/r/33dwner/6](http://i.stack.imgur.com/bCPud.png) My knowledge of customizing wordpress is pretty good but I've never created a search before. I would like to ask for opinions for tackling this as a solution. Hope you can help. Thanks


title: Any way to insert text on page from a query results?

text: I'm using Woocommerce and its atributes (custom taxonomies). I have some pages which I query this way: > http://example.com/?tax1=term1&tax2=term2 This query gives me the posts from taxonomy 1 and taxonomy 2 that matches term1 and term2. I'd like to insert some text on these pages. Any way to accomplish this? Thank you


title: What is the difference between "manage_{$post_type}_posts_columns" and "manage_edit-{$post_type}_columns"?

text: What is the difference between **`manage_{$post_type}_posts_columns`** and **`manage_edit-{$post_type}_columns`**? Could somebody explain what is the difference between these two approaches?


title: Function to list posts from current post's category fails in WP 3.8

text:
**I have this function in my child theme's functions.php** , whose simple aim is to list a number of posts, only from the category of the current post, but not the current post itself. It was working fine until tonight, when **it started listing posts from _all_ categories**, not just the current post's category. The _only_ change I had made to my site was to update it to WordPress version 3.8. I'm not sure if that has anything to do with it, but I thought it might, since I have a "cloned" site which is still running WordPress 3.7.1, and the _exact_ same function on that site works, doing exactly what I want it to, i.e., it lists a number of posts, _only_ from the category of the current post, but not the current post itself. Here's the function:               <?php     function list_posts_from_current_category() {     if(is_single()){     $cat_ID = get_the_category($post->ID);     $cat_ID = $cat_ID[0]->cat_ID;     $this_post = get_the_ID();     $PostsPerPage = 5;     query_posts(array('cat' => $cat_ID, 'post__not_in' => array($this_post), 'posts_per_page' => $PostsPerPage, 'orderby' => 'rand'));     while ( have_posts() ) : the_post();     $ThisPermalink = get_permalink();     $ThisTitle = get_the_title();     echo ''.$ThisTitle.'
';     endwhile;     wp_reset_query();     }     }     add_action('do_my_list', 'list_posts_from_current_category');     ?>      It's added to the child theme's content.php in the usual manner:               <?php do_action('do_my_list'); ?>      Like I say, it all works as intended in WP 3.7.1, but has somehow come a cropper in WP version 3.8, listing posts from _all_ categories. Does anyone know what can be wrong with it?


title: Need an idea of how to realize filling of accordion by editors

text: I have and accordion (something like this one but smaller). I already made one. OK. But I can fill it only using WordPress built-in theme editor (just changing php). My customer don't like this method, cause this accordion would be filled every day by editors. I can't give right to edit theme to some unknown editor. In accordion would be some text and pictures, which are links to some pages. So, I thought a little and have 2 ideas. * * * **1st:** realize it like pages. One accordion tab = one page. From page we parse content and paste it to accordion tab.   _Limitations:_ Too many pages. It is easy to get confused. **2nd:** using new sidebar. Tabs would be like an simple Text Widget with text, imgs, links and etc. Links would be to some pages and all is cool.   _Limitations:_ With this construction I will have a sidebar into a widget (cause the accordion is already in a widget). And I need to give rights for widgets edit.


title: How to display BBpress statistics?

text: This seems like a fairly simple question, and I'm sure I'm overlooking something, but how does one display forum statistics (registered users, posts, etc.)? I see there is a template in the theme compatibility folder called `page-forum-statistics.php` which seems to display some of this info but I'd like it to display in the footer on the homepage. Is there something I'm missing? Or do they have to be called manually?


title: Wordpress image resizing on home page (product category)

text: I have been working on resizing the images on my wordpress website, the images are not appearing on equal sizes or not aligning properly. But inside the product pages it looks normal size but in the shop/home page (products page) all images are appearing in bigger size. how to fix the image size in wordpress i have not idea. Please refer my website **(www-dot-carolinegoodwin- dot-com** and suggest me what to do and how to fix this issue. Thanks much in advance for your help.


title: Word Press Permalink Change

text: I had the following permalink structure in my WordPress blog:               /%category%/%post-name%/      I changed it to:               /%post-name%/      Everything is fine as I am using the permalink finder plugin, which redirects the posts to new address. But, the issue is that Google Webmaster Tools shows too many duplicate meta descriptions as follows:   * /category1/postid/   * /postid/ Can anyone help me how to solve this issue?


title: How to implement bulk actions in my plugin?

text: I am developing a WordPress plugin. This plugin displays a list of courses. Now I want to implement the bulk actions just like in other plugins. From where I can apply the delete and edit actions to the list. How will I do this. Is there any built-in function for implementing bulk actions in WordPress? Any help?


title: RSS2 Feed with two CDATA sections

text:
**Why my feed description is breaking like this?** It occurs only on some posts, but the others are echoed perfectly in _like_ a single `<p>`. ![broken feed description](http://i.stack.imgur.com/GoDZp.png) The code for my feed is that simple:               <description><![CDATA[<?php the_content(); ?>]]></description>      And I inspected the particular post and found nothing:
হেফাজতে ইসলামী বাংলাদেশ’র সমাবেশে বিভিন্ন এলাকা থেকে দলে দলে কর্মী-সমর্থকরা এসে যোগ দিচ্ছে। আর ক্ষুধার্ত-তৃষ্ণার্র্ত কর্মী-সমর্থকদের জন্য সমাবেশে কিছুক্ষণ পর পর পানি, ক্ষীরা, তরমুজ, কমলা, আপেল থেকে শুরু করে বিরিয়ানি পর্যন্ত আসছে।
      It's broken on the second line where the glyph "ক্ষুধার্ত-তৃষ্ণার্র্ত" presents. For a critical scrutiny, I guess, 'ক্ষ' is a joint-glyph ( _যুক্তাক্ষর_ ) in Bangla a mixture of two character - that may cause a break there. But I inspected other similar post where I found plain character. ![broken feed description 2](http://i.stack.imgur.com/4Zydo.png) The line was broken here within: "চট্টগ্রাম থেকে ঢাকা অভিমুখে লংমার্চে". As though they are broken, it's producing two `<![CDATA[ texts here ]]>` within a single `<description>` tag. It's not good for an apps developer to fetch the whole description dynamically. I found nothing in between the broken words, or characters. And in the first example the line is broken within a single word, but in second one it's broken after a complete word. What am I missing?


title: how to use the_excerpt for two post queries?

text: I am new to Genesis, i created a child theme it has two post types, one for the THEMES i want to display and other for the PORTFOLIO. both of these are having the_excerpt in their loop, I want to add "View Theme" and "View Project" separately. I also want to control the limit of the excerpt for each one will have more excerpt to show and other will have less. the same filter is applied on both of the post types.


title: How to make woocommerce a private catalog

text: Are there any tutorials/functions/custom code that I could utilize to make my entire shop pages completely private to users? I need a private shopping experience for logged in users only. My client sells items to only a few local brick and mortar stores. Only these customers will have access to the shopping cart. But I still want to make other pages on the site viewable publicly such as the Home Page, About, Us, Contact, Etc... What would be the best way to make my shopping cart private?


title: $wpdb->prepare - supporting multiple search terms

text: I am trying to write an escaped SQL statement, for example:               $sql = 'SELECT * from TABLE where column LIKE %searchterm% AND column LIKE %searchterm2%';      Except I don't know how to handle it, as I do not know the number of searchterms the user has entered. How would I prepare this?               $wpdb->prepare( $sql, $searchterm, $searchterm2 );      If the user enters 3 search terms it won't be utilised?


title: Advanced Custom Fields (ACF) Plugin - Random Image in Sidebar

text: I’ve created a Custom Post Type, “Slide”, and I’m attempting to load a random slide image, with title and caption, in my sidebar. I’m using the Advanced Custom Fields Plugin for the post/slide creation. The code below is what I have in my sidebar.php – I do get a random post loaded in the sidebar (showing title and caption) but the image URL does not output/echo, just `<img src="" />` Can anyone tell if I have ACF code wrong or maybe using the WP_Query wrong?                   <?php $args = array(              'post_type' => 'slide',              'posts_per_page' => 1,              'orderby' => rand         );         $attachment_id = get_field('slide_photo');         $size = "medium"; // (thumbnail, medium, large, full or custom size)         $image = wp_get_attachment_image_src( $attachment_id, $size );         // url = $image[0];         // width = $image[1];         // height = $image[2];              $loop = new WP_Query( $args );         while ( $loop->have_posts() ) : $loop->the_post();                  echo '<img src="';             echo $image[0];             echo '" />';             the_title();             the_field('slide_credit');              endwhile; ?>


title: Add information above a custom post type listing of all posts page

text: Ok, that sounds like a rather confusing title, let me explain. I have created a custom post type (CPT) and I want to add some summary information about the posts of that post type above their listing (where the filter and bulk action buttons are), the page in question would be:               http://www.example.com/wp-admin/edit.php?post_type={cpt}      Is there a hook for this ? Since I don’t really know what to call this area, i am not finding anything doing any further searches.


title: Issue when uploading past 8MB?

text: So I downloaded a plugin that sets your max_file_upload to 250 MB and I set my php.ini to the same. I own server so it is not a server issue - I have many apps that upload very large video files. When I am trying to upload a file, no matter how large (up to 200MB tested), it shows that the file uploads in the progress bar. If it were going over the upload limit I get an error telling me file is too big - but this is not the case. Instead a second or two after hitting 100% on progress bar it times out with "http error". Seems like a memory issue with WP so I added define('WP_MEMORY_LIMIT', '250MB'); Doesn't work. Let me know what else I can do. It is not an issue with server. When I do phpinfo it shows 250M and I have upload many files larger than 8M on other apps on same server. Name of the plugin is PBP Increase upload limit. Also when I do not have the plugin on I cannot download big files at all. With the plugin I can download the file - but when it gets to the "crunching" progression it faults out with the http error.


title: Posts with Tag on Bottom of Page

text: I have a plugin request that I cannot find by a Google search because I can't think of what it would be called: I need a plugin that will, on a page-by-page basis, allow me to define a list of tags (probably via a Custom Field), and should show the most recent 5 (or any number) posts that have that tag on the bottom of the page. Thanks!


title: How to remove text "Log In" from login page

text: I am using Theme My Login and have noticed that, even though I am customising my own `login-form.php` template and simply including the appropriate form on a blank page with `theme_my_login();`, the text `Log In` is always appearing and is _not even in a selectable DOM element_ :               Log In     <div class="login" id="theme-my-login1">       <form name="loginform" id="loginform1" action="http://domain/login/" method="post" target="_blank">       ...      I'm wondering if there is any way to remove this 'Log In' text? I'm not sure where it is coming from. I've also tried hooking `login_headertitle` as in this Codex Article.


title: How to get a meta value from all post

text: I searched for a while but I didn't find any solution. I used the functions listed here. It outputs something like this:               Array     (         [0] => 15         [1] => 30         [2] => 50     )      But I want something like this:               Array     (         [post_id_1] => 15         [post_id_2] => 30         [post_id_3] => 50     )      And this is the $wp query that is used in the function:               function get_meta_values( $key = '', $type = 'post', $status = 'publish' ) {         global $wpdb;         if( empty( $key ) )             return;         $r = $wpdb->get_col( $wpdb->prepare( "             SELECT pm.meta_value FROM {$wpdb->postmeta} pm             LEFT JOIN {$wpdb->posts} p ON p.ID = pm.post_id             WHERE pm.meta_key = '%s'              AND p.post_status = '%s'              AND p.post_type = '%s'         ", $key, $status, $type ) );         return $r;     }


title: Display direct children of the current custom taxonomy in taxonomy.php template

text: Let’s say i have custom taxonomy named “Location” with hierarchial structure like the following : >   * ASIA > >     * CHINA >     * INDIA >     * JAPAN > >       * Fukuoka >       * Hokkaido >       * Okinawa >       * Tokyo > >         * Akishima >         * Machida >         * Tachikawa >         * ... >   * AFRICA > >   * AMERICA > >   * EUROPE > >   * ... > > On the taxonomy archive template (taxonomy.php) , i want to display links to all DIRECT CHILD of the current taxonomy being viewed. So for example, if someone view the “ASIA” archive page they will see link to CHINA, INDIA, and JAPAN archive page only and exclude the “grandchildren” taxonomy. Then if someone view the JAPAN archive page they will see a link to FUKUOKA, HOKKAIDO, OKINAWA, and TOKYO only . Same behavior until it reach the taxonomy with no children and obviously nothing will be displayed Please help me what to do, i’ve tried several method but none of them work. Most of the solution i found only manage to display ALL the children taxonomy including the grandchildren. So instead work like i explained above, the “ASIA” archive page will display all link to CHINA, INDIA, JAPAN, Fukooka, Hokkaido, Tokyo, Akishima, ..... I want to display ONLY the direct children of the current taxonomy and exclude the grandchildren.


title: Within the database, where is the flag which says that a user has Super Admin rights?

text: I have an user in a Wordpress Multisite installation and have access to the Mysql database, I would like to give myself super-admin rights to access the wp-admin/network page. Where can I do it on Mysql? I looked the database and I think the wp_usersmeta table is the one, but I have no idea how Wordpress manages the roles within the database. Any help?


title: A hook that runs only when the theme is previewed

text: Is there a function or a hook that runs only when a theme is previewed? I'm referring to the preview feature that you get on the Appearance->Themes page. The reason for this is that I want to **change specific design aspects on the theme but only when the user is previewing it**.


title: How to add super admin to all sites

text: Is there a way to add super admins to ALL sites without having to add them to each site individually? My group of super admins needs access to all sites.