Title: How to create a front facing user sign up, log in and profile pages like FoodGawker.Com Body: Hey everyone! I'll be as direct and detailed as possible. :) I want to be able to sign up users and have them have access to their profiles and function/look very much like http://www.foodgawker.com I need to have a front facing using registration processor with the fields that I predetermine, login & logout fields, and have access to their profile which I need to contain two very basic capabilities:   1. View & change their profile. And…   1. View & delete their bookmarked posts in a grid like format.  That's it for now. Right now I'm using the following plugin to easily achieve being able to: User Bookmarks For Wordpress. For the purpose of this question I've created a mock account on http://www.foodgawker.com so that you can see visually see what I'm trying to achieve (sorry food gawker!). The login details are: Username: mockstack Password: stackoverflow email: mockupemail@email.com So the question is how to approach this problem and solve it? I'm a little lost right now and don't really know what to start or what fully needs to be done to achieve this. I've been around wordpress for while and can program in PHP at a beginner/intermediate level (increasing though). CSS and HTML I'm very strong in and are not a problem. Thanks for all the help in advance ladies & gents!!


title: meta_compare seems to be treating values as strings instead of integers as expected

text: Trying to use meta_compare as suggested in the codex:               query_posts('meta_key=miles&meta_compare=<=&meta_value=22');      Here is my code:               global $wp_query;     query_posts(     array_merge(         array(             'category__and' => $mycatsarray,             'meta_key' => 'price',             'meta_compare' => '>=',             'meta_value' => 8500000,             'orderby' => meta_value_num,             'order'=>DESC         ),         $wp_query->query     )      ); I'm using array_merge to persist the original query. So I couldn't quite figure out how to use the suggested syntax ('&name=value') for meta_compare and meta_value. Anyways, in my code the meta_value seems to be treated like a string and not an integer as expected. Here is an example of some typical price custom fields from my custom posts:   * 8500000   * 600   * 15000   * 900   * 750   * 9000000 If it's not a string issue, it could be that WordPress is ordering (DESC) these custom fields as follows:   1. 9000000   2. 900   3. 8500000   4. 750   5. 600   6. 15000 I would like them to be ordered (DESC) as follows:   1. 9000000   2. 8500000   3. 15000   4. 900   5. 750   6. 600 Am I doing something wrong here?


title: wp_insert_post alternatives for faster process

text: I'm using `wp_insert_post` to generate posts for my site. Initially, everything works fine and it was very fast. When the number of posts accummulated to about 3000, it became very slow and now i almost cannot insert post anymore using that command. I tested the same script on another newly created database on the same server, everything runs very fast. I have deactivated all plugins and turn off pinging service, but there is no improvement. i used `$id = wp_insert_post($array)` to retrieve the post_id also. Anyone know how to resolve my problem? Is any other method to generate posts and get the post_id Thanks for any help


title: Why is WordPress WYSIWYMG and how do I make it WYSIWYG?

text: WordPress may have a text editor that appears to be WYSIWYG, but upon using it I discovered that it is actually WYSIWYMG- What You See Is What You _Might_ Get (once it's done screwing with the HTML). Isn't there a way to tell it to **do nothing** with the text you put into it? Just leave it as it is. No optimizations, no trying to guess what I meant, no correcting my HTML, no converting whitespace into nbsp's that for some reason cause line breaks, no changing the formatting or the spacing between embedded objects after you edit it to fix one typo... I did try searching the settings area but found only one HTML related option (regarding matching closing tags).


title: WordPress 3 Multisite using subdomains.- DNS on Cpanel question

text: using google to search for answers to how to setup a cpanel"based" domain to use with WordPress 3 Multisite using subdomains (subdomain1.domain.com, subdomain2.domain.com etc.) answer: "just go to subdomains in Cpanel, use * and point it to public_html".... that works, but (and here's the question): now the good old webmail.domainname.com, cpanel.domainname.com, whm.domainname.com etc. doesn't work anymore So, question: how to do it 100% properly, so all normal functionality remains and still enable the subdomain possibility with WP Multisite ?


title: Making the Post/Page Content Editor Box Bigger?

text: I'm having difficulty in creating a big post since the editor box is quite small. I want to make it bigger. Can I?


title: Replacing the List table of a Post Type

text: Is there a way to replace the WP_List_Table object of a post type to display said post type differently on the Admin edit.php page?


title: Changing attachment urls?

text: How can I change the format of attachment page urls from `/[post- url]/[attachment-name]/` to `/media/[attachment-name]/`? I understand that I can override the output of `get_attachment_link` via the `attachment_link` filter, but I guess I need to change the redirect structure so WordPress knows how to handle these urls?


title: Why does this echo values in the wrong order?

text: I'm sure there is a simple reason/answer for this: Why does `echo 'Archive for '. the_time('Y');` give me `2010Archive for`? I had expected it would give me `Archive for 2010`


title: How to trigger a login form notice message?

text: How can I trigger a message box to appear on the login form? I'l trying to get the little yellow notice bar to appear above the login form conditionally. The below code only print the content on the page (duh, I know).               add_action('login_head', 'login_form_message');     function login_form_message() {         echo 'Custom Login Form Message';     }


title: WP_query posts closest to todays date

text: I have written an wp query which I would like to order in a bit of a complicated way. Some posts have a meta value 'the_date' which is an end date for the post. I would like to order posts in date and time order where if there is an end date this would be the reference how ever is there is no end date the publish date would be the reference. With this information I need to order posts by the closest to the current date and time. For example: posts:               ID          Name         Publish_date        Meta_end_date     1           Post 1       15/05/2013 10:00        2           Post 2       15/05/2013 09:00    17/05/2013 14:20     3           Post 3       16/05/2013 13:00    20/05/2013 08:00     4           Post 4       17/05/2013 13:50      current time: 17/05/2013 14:00 Result order:               Post 4 (17/05/2013 13:50),      Post 2 (17/05/2013 14:20),      Post 1 (15/05/2013 10:00),     Post 3 (20/05/2013 08:00)      Here is my current query:               $args = array(         'post_type' => 'post',         'numberposts' => '30',         'meta_query' => array(             'relation' => 'OR',             array(                 'key' => 'the_date',                 'value' => $today,                 'compare' => '>',                 'type'=> 'DATETIME'              ),             array(                 'key' => 'the_date',                 'value' => '',                 'compare' => '=',             )         ),         'orderby' => 'post_date',         'order' => 'ASC',         'orderby' => 'meta_value_num',         'order' => 'DESC'     );      Any help is very welcome :)


title: Custom Form not generating URL

text:
CReating a template to load content in an iframe on the same page - I have not even got as far as using ajax to avoid reloading the whole page as the form submit is not working. The submit button returns an empty URL with no query string:( Any thoughts               <?php     /*         Template Name: Options Page     */     get_header();     ?>     <?php     $options= $_GET['options']? $_GET['options'] : "option1";     $options = ucfirst($options);     ?>

<hgroup class="post-title fix">
<?php echo $options; ?>
     </hgroup>

     <form id="oselector" method="GET" action="<?php the_permalink(); ?>">          <select name="options">             <option <?php if ($_GET['options'] == 0) { ?>selected="true" <?php }; ?> value="0">Select Option</option>             <option <?php if ($_GET['options'] == "option1") { ?>selected="true" <?php }; ?> value="option1">Option 1</option>             <option <?php if ($_GET['options'] == "option2") { ?>selected="true" <?php }; ?> value="option2">Option 2</option>         </select>         <input type="submit" value="Submit">     </form>

     <iframe id="theme" src="http://www.example.com/<?php echo $options; ?>/" seamless style="border-radius: 7px; border: 1px solid rgb(218,218,219);margin: 0 auto;width: 95%; height: 100%; overflow-x: auto; min-height:800px" >
Your browser does not support iframes.
          <?php     get_footer();


title: Modify custom field from front end

text: If I need to manage a custom field under wordpress, but not from the admin area. In other words, I need that users modify the content of post custom fields from front end. What is the way to do so? As instance, please to imagine Stackexchange.com as a wordpress site. Under this site, the the accept state is my post custom field. How can I make the front end user modify its value in WP database? Please If you have another better approach to create accept system, using wordpress, it will be highly appreciated. But if my approach (using post custom field) is okey, please to guide me find documentation from web or codex to achieve my goal. Thank you for your usual help.


title: Child Theme for Mobile Browsers

text: Is it possible to use a child theme for mobile browsers? I have tried various plugins but the mobile browser only displays the main theme, the theme that is meant for viewing the website on the desktop. My child theme inlcudes php as well as css files. Whenever I switch to a different theme for mobile browsers it works but the custom post types, cats etc are missing in action. I am kind of lost. Any ideas there? Thank you P.S. I think the problem is that the browser detector doesn't recognize the child theme as a theme. It grabs the parent files instead of the child theme files.


title: Need resource on available functions and objects

text: I am a programmer, and love jQuery. Visual jQuery and other resources is THE best place to get all the code/function et get your hand dirty... But when it come to WordPress.. the code is too thin or too abstract... i nee more like a dictionary of term, function, and possibility What i need is like the ULTIMATE cheat sheet, made in a bible.. i don't care if it 20 pages, i need an HOW TO book of the function possible... like :   1. wp_list_categories.. where it is and what are the the return values   2. this snippet i copy from the web : `<?php foreach (get_the_category() as $cat){ echo "[" . $cat->cat_name . "] ";} ?>` the method cat_name HOW SHOULD I KNOW THAT ???? where to find the reference ?? please enlight me !


title: My Query is getting the wrong data

text:
I am trying to populate a select box to get the categories created in my ACF post type, when clicked these will filter available jobs via their category. The post type can be seen here - Post Type Currently my query returns the 4 categories to the select box which correspond with the posts rendered later on in my code, rather than rendering all of my categories. My category query can be seen here -                   <?php          $the_args = array (             'post_type' => 'jobs',             the_field('job_category')          );              $option_query = new WP_Query( $the_args );     ?>              <form action="">             <select name="job_cats">                 <?php if (have_posts()) : while ( $option_query->have_posts()) : $option_query->the_post(); ?>                     <option value="<?php the_field('job_category'); ?>"><?php the_field('job_category'); ?></option>                 <?php endwhile; endif; ?>             </select>         </form>              <?php wp_reset_query(); ?>      I tried to add the reset_query function before running this function below, but the same results persist to render to the select box.               <?php          $cat_filter = '';         $node_id = 0;         $node_count = 0;              $args = array(             'post_type' => 'jobs',             'meta_key' => 'job_category',             'meta_value' => $cat_filter         );              $the_query = new WP_Query( $args );     ?>         <?php if (have_posts()) : while ( $the_query->have_posts()) : $the_query->the_post(); $node_id++ ?>             <div class="search-node node<?php echo $node_id ?>">                   <?php get_template_part( 'post' , 'jobs') ?>
             <hr id="divider<?php echo $node_id ?>" class="search-divider">         <?php endwhile; else: ?>
Sorry, we currently have no jobs available, keep watching this space!
         <?php endif; ?>      Any pointers would be appreciated, I am relatively new to wordpress so I am sure I have made a small mistake! Alex.


title: latency problems with wordpress install (from SQL import)

text: I develop wordpress sites for a living, and today I am experiencing something that I haven't yet come across: Extremely slow load times / latency problems. You can view the site here: http://ziprecords.com.previewdns.com/ Here are the steps I took:   1. Developed a theme on localhost, everything worked perfectly.   2. Exported data from within wordpress backend   3. Opened up Godaddy account and set up new shared hosting account, and installed Wordpress using their self-installer. I am testing this site using their 'preview DNS', which enables you to view the site live before connecting a domain. Godaddy assured me, this works fine with WP installs.   4. I then attempted to import the data from the local install. There was errors on the media uploads (failed to import media).   5. I manually uploaded media files, and relinked the pictures to all my posts (from this point on, I knew something was fishy)   6. I went to my local phpMyAdmin and exported the entire database in SQL. (keep in mind, I am using a plugin called shopp, which powers the ecommerce section of the site. These tables were included in the export)   7. In a text editor, I replaced all of the local host references to the new domain URL.   8. I went to my Godaddy phpMyAdmin and dropped all of the pre-existing wordpress tables. I then imported the SQL database.   9. I then went to the site and looked at it. It was pretty darn slow.   10. It seemed like as I entered more products into the shop and more content on the site, it became slower and slower, but perhaps that is a coincidental. I am experiencing some SEVERE latency/speed problems.    11. I called Godaddy, and after some tests, they said everything is fine on their end.    12. I then tried testing this out on ANOTHER server using the exact sames steps as above. When I tried uploading the XML backup, EVERYTHING failed to import, even post types and post content. When I tried importing the SQL, everything works fine. The new site is working as I wish as far as speed, however, all of the content is completely missing, due to the failed import. So now I am stuck in a situation where I am unable to target the cause of this problem, and I don't have a working test environment because the Wordpress import fails every time. The latency problems could be on Godaddys end; however, I am sure that something is screwed on on the WP DB, as indicated by the failed media imports/ exports, as well as the extremely slow latency. Any ideas?


title: Assign "The Events Calendar" to Subpage

text: for a small project i need to assign the The Events Calendar Plugin to an subpage but i've found no solution in the documentation. Does anyone know if this is possible or has an idea to get it done? Regards


title: How to prevent text modified using gettext filter being stomped (presumably) by updateText() js function within a CPT's edit screen

text: First a teeny bit of background... I have a custom post type where I'd like to use custom post statuses. Since custom post statuses (stati/status/whatever), have not been fully implemented within the core, I've decided to use the gettetext filters to change the names of certain things. For example, I've changed the text "Publish" on the publish button to say "Save". I went with something like Rarst's approach here. A summary of my code is below. I'm really not going for anything drastic here as far as changing what each status does/is. Anyway, the translation works just fine as far as PHP is concerned. However, while testing, I realized that if I click the Edit link within the misc publishing actions div, then click the cancel link that subsequently appears, my translated "Save" button will revert to a "Publish" button. This seems to happen as a result of the javascript function `updateText()` found in `/wp-admin/js/post.dev.js`. I'm looking for a way to keep the JS from stomping my translation. I'd prefer not to just mess with it using DOM manipulation, but if that's my only option, I'll go for it. I'm running 3.1, btw.               <?php     class MyClass {                  function __contsruct() {                 add_action( 'admin_head', array ( &$this, 'load_gettext_filters' ) );             }                  function load_gettext_filters() {                 add_filter( 'gettext', array ( &$this, 'change_publishing_text' ), 10, 2 );             }                  function change_publishing_text( $translation, $text ) {                 global $post;                      if ( ! isset ( $post->post_type ) ) {                     return $translation;                 }                      if ( 'mypost' === $post->post_type ) {                     if ( ( 'Publish' === $text ) ) {                         return 'Save';                     }                 }                 return $translation;             }              }


title: Post Navigation Not Working In Blog Template - Redirecting to same page with correct URI

text:
I have the following code:               <?php     /*     Template Name: blog     */     ?>       <?php get_header(); ?>

           <?php query_posts('cat=-4,-11');?>           <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<a href="<?php the_permalink(); ?>"><?php the_title(); ?>
               <?php the_time('F jS, Y'); ?>
                 <?php the_content(''); ?>
               posted by: <?php the_author(); ?> in <?php the_category(', '); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>
           <?php endwhile; endif; ?>           <?php posts_nav_link(' · ', '« previous page  ', '
next page » '); ?>
               <?php get_sidebar(); ?>
       <?php get_footer(); ?>      The page navigation is only needed in this template.


title: Rollover Image jQuery help

text: I basically want to have a small thumbnail of an image, and when the user puts the mouse over the image I want a larger version to pop-up. I've been doing some Google and I found this tutorial. I cant make sense of the code. Which file should I put it in?               jQuery(function($) {                    <--This is the enclosing function     $(document).ready(function(){       <--This is the overall jQuery function              $("#content #quote img").each(function () {    <--This function determines img src             rollsrc = $(this).attr("src");             rollON = rollsrc.replace(/.png$/gi, "-hover.png");             $("<img>").attr("src", rollON);         });              $("#content #quote a").mouseover(function () {  <--This displays the -hover image             imgsrc = $(this).children("img").attr("src");             matches = imgsrc.match(/-hover/);             if (!matches) {                 imgsrcON = imgsrc.replace(/.png$/gi, "-hover.png");                 $(this).children("img").attr("src", imgsrcON);             }         });              $("#content #quote a").mouseout(function () {  <--This returns the image to normal             $(this).children("img").attr("src", imgsrc);         });          });     });      Is there a plugin that already does this, or is there an easier way to do this? Thank you in advance for the help.


title: How do I add JavaScript that will execute on all my sites in Multisite?

text: We are creating an internal network of sites using MU and there are some small things we would like to have globally on all the sites without having to add them individually for each site. I would like to add a block of JavaScript and CSS that will execute on every site. What's the best way of going about this?


title: WP installed is asking to install if typed domain.com

text: I got a problem trying to access the landing page typing domain.com instead www.domain.com If I type domain.com/rus the WP goes to domain.com/rus/wp- admin/install.php but if I type www.domain.com/rus the landing page is loaded correctly if I type any address of known pages or post without the www the pages and post are loaded correctly, the main problem is the home page. **Settings:**   reading : last post - taken from index.php   WP URL: http://www.domain.es/rus   Site URL: http://www.domain.es/rus   I have other site with same information http://www.domain.es/eng and this is working perfectly, now I´m planing to have a site in rusian :) but I got this error and I don´t want to transfer 400M of images again. **NOTES:**   There aren´t blank spaces in wp-config.php ( i´ve solved this issues since 4 years ago) the .htaccess shows this code same as site eng (obviusly its own /eng and /rus folder) RewriteBase /rus/   RewriteRule . /rus/index.php [L]


title: How can I check if the admin bar is visible to the current user?

text: I'm new to WordPress. I would like to know   * Is the admin bar visible to all users and roles?    * If not, how can I check it is visible to the current user?


title: 2 Different Custom Post Types in Submenu

text: i have register 2 custom post types within my plugin one of them is shown in the left admin bar, the second i wouldn't show so i have set the "show_ui" to false. Is it possible to add the second post type to the menu of the first post type? **first post type:**               $args = array(       'labels' => $labels,       'public' => true,       'has_archive' => false,       'menu_position' => 100,       'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' ),       'menu_icon' => plugins_url( 'assets/img/small1.png', __FILE__ ),       'rewrite' => array('slug' => 'screenshots', 'with_front' => true)     );          register_post_type( 'screenshots', $args );      **second post type:**               $args = array(       'show_ui' => false,       'labels' => $labels,       'public' => true,       'has_archive' => false,       //'menu_position' => 100,       'supports' => array( 'title', 'editor', 'custom-fields', 'thumbnail' ),       //'menu_icon' => plugins_url( 'assets/img/small2.png', __FILE__ ),       'rewrite' => array('slug' => 'deal', 'with_front' => true)     );          register_post_type( 'deals', $args );      **I try to add the second post type with:**               add_submenu_page( 'edit.php?post_type=deals', __('Deal', $this->var_sTextdomain), __('Deal', $this->var_sTextdomain), 'manage_options', 'my-deal', array(&$this, 'deal_page') );      What can i do to add it to the first post type at the end? regards


title: Exclude function from running on a certain page

text: I'm working on modifying the Keyboard Shortcut Navigation plugin to fit my site. Here's the plugin: http://wordpress.org/extend/plugins/easy-keyboard- shortcut-navigation/ I don't want this plugin to run on page 2020. I've tried `&& !is_page('2020')` and `|| !is_page('2020')` in the `elseif` below, but it keeps running the function. Any ideas? **Edit update** : As requested, I'm removing the snippet and including the full code from the plugin located at the above URL.               add_action('wp_footer','keyboard_shortcut_navigation');     function keyboard_shortcut_navigation(){         global $paged, $wp_query;         if ( !$max_page )             $max_page = $wp_query->max_num_pages;         if ( !$paged )             $paged = 1;         $nextpage = intval($paged) + 1;     ?>     <?php if( is_single() ) : ?>     <script type="text/javascript">         document.onkeydown = chang_page;function chang_page(e) {         var e = e || event,         keycode = e.which || e.keyCode;         var obj = e.target || e.srcElement;         if(obj.tagName.toLowerCase()=="textarea"){return;}         if(obj.tagName.toLowerCase()=="input"){return;}         if (keycode == 33 || keycode == 37) location = '<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>';         if (keycode == 34 || keycode == 39) location = '<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>';         }     </script>     <?php elseif( is_home() || is_category() ) : ?>     <script type="text/javascript">         document.onkeydown = chang_page;function chang_page(e) {             var e = e || event,             keycode = e.which || e.keyCode;             var obj = e.target || e.srcElement;             if(obj.tagName.toLowerCase()=="textarea"){return;}             if(obj.tagName.toLowerCase()=="input"){return;}             if (keycode == 33 || keycode == 37) location = '<?php echo get_previous_posts_page_link(); ?>';             if (keycode == 34 || keycode == 39)              <?php if ( $nextpage <= $max_page ) : ?>                 location = '<?php echo get_next_posts_page_link(); ?>';             <?php else : ?>                 location = '<?php echo get_pagenum_link( $max_page ); ?>';               <?php endif; ?>         }     </script>     <?php endif; ?>     <?php     }


title: How can i display the content in plaintext

text: i want to display my excerpt in plaintext. How can i do this? This is my Snippet where i display the content:               <?php the_content(__( 'Weiterlesen ›','okay')); ?>      How i change the snippet to display the content in plain? greets, niklas


title: Update some database fields when post is saved

text: I have a class that will count the Lines of Code, Source Lines of Code, and the Code disk space used. I would like to save these values into the database so that these values can be calculated only when a new post is saved or updated instead of running the code on every page view So my question is, what is the best way to make sure these are added/updated everytime a new post is made and everytime that post is updated/edited. Also where should I store these, in a custom meta field? If so, how can I make sure that the meta box does not show up on the page, it should all be done behind the scenes


title: 3.3: How do you hide the new dashboard welcome panel?

text: I have tried various versions of this here:               unset($wp_meta_boxes['dashboard']['normal']['high']['dashboard_wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['wp_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_welcome_panel']);     unset($wp_meta_boxes['dashboard']['normal']['core']['welcome_panel']);      I have tried looking this up but as there is not much documentation (there is but there isn't ) on it yet it is kind of hard. I was wondering if someone could please help me out. I would really appreciate it. Thanks. :)


title: WordPress Admin back-end - advanced options page?

text: Am I losing my mind? I seem to recall that somewhere in the Admin back-end there was a page that basically listed out all the fields within wp_options. Does this ring a bell to anyone else? I thought maybe it was a MU thing but it's not there either. At one point I seem to recall running into a page where you could edit the options directly (without using a DB client). No big deal if there isn't but I swear I've seen such a beast, and I don't think it was through a plugin...


title: What does the term "bundled-theme" mean?

text: I have occasionally heard the term "bundled-theme". I know what a WordPress theme is, but I don't know what a "bundled-theme" is. I came across that term recently when reviewing the WordPress documentation: > "...For core (and bundled themes), this is always > WordPress."(http://make.wordpress.org/core/handbook/inline-documentation- > standards/php-documentation-standards/)


title: Dealing with Many Meta Values, 30+

text: I have a "Listing" post type with 30+ meta keys which I feel like can cause a strain on the database when there's 100+ posts. Usually what I do is save each meta value 1 by 1 like so:               if(isset($_POST['_item_stock']) && !empty($_POST['_item_stock']))         update_post_meta($post_id, '_item_stock', sanitize_text_field($_POST['_item_stock']));     else         delete_post_meta($post_id, '_item_stock');      I do this because if I need more control over validation, I have it. It's organized and nice looking in the code. **The Drawback** being that it's lengthy and it saves each meta individually in the database. My other option is to standardize all my meta into an array then serialize it. **The Drawback** to this method is that I can't run any meta queries on serialized data, so filtering searches or post ordering is out the window. The final option is to do half and half, serialize what I don't need for queries and everything else I save individually. While it may be save some overhead I don't want it to look messy in my code or have any kind of disconnect. My question is - How do you normally handle posts that have many meta keys? Is the database overhead as bad as I imagine when I save each meta key individually? Which method do you think is the best and why?


title: A good way to include snippets of code in both posts, pages and Event Manager Template files?

text: (I am not sure if I am phrasing this correctly, so please bear with me and be kind. ) I have a setup where the same information need to be included in both **pages** , and **individual Events** ( **Custom post type** from Event Manager) AND in the **email template** for Event Manager. Is there a good way to include this from a central location, like post snippets? I tried with the plugin Post Snippets, but of course that only works on posts. Is it possible to put the information in the functions.php file and then call the variable in all these different places? _Or is there a better way to do it that would still allow for the site administrator to edit the text with a WYSIWYG-editor?_ Thanks for you help and patience.


title: Query Distinct Taxonomies of Custom Post Type

text: I have a custom post type called "coupons". These coupons can then be drilled down by "city". City is a custom field that is defined for each individual "coupon". I am then trying to modify a sidebar widget so it will only show the distinct categories related to the specific queried cities result set, as opposed to all coupon categories. I would then need to display a count that would show how many of the returned coupons belong to the specific category. So far the query returns all coupon categories (and the coupon count), not just the ones that belong to the specific coupon category.               SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('coupon_category', 'coupon_tag', 'stores', 'coupon_type') AND tr.object_id IN (430, 618) ORDER BY t.name ASC      Any help would be greatly appreciated.


title: Why won't child theme's style.css override plugin's css

text: I am using my own child theme for twentyeleven, and I've made some changes to some plugin's css classes in my child style.css. The problem I'm having is that if I add a new css attribute to a class from the plugin's css, then it will make the change. But, if the attribute is already declared in the plugin's css, it relies on that. How can I make my child theme's style.css take precedence over the plugin's css files? Here's an example of what happens from firebug (the first css file is from the plugin, the second is from my child theme): ![enter image description here](http://i.stack.imgur.com/W6WLM.png)


title: Always generate thumbnail after sideloading image

text: I'm sideloading an image into wordpress from youtube. it works fine and the key part of the code is:               // sideload it into wordpress (generates various sizes)     $thumbid = media_handle_sideload( $file_array, $post->ID );     if ( is_wp_error($thumbid) ) { // deal with error here }          // kill existing attachment first, if any     wp_delete_attachment(get_post_thumbnail_id($post->ID), true);          // and finally associate post with new thumbnail     set_post_thumbnail( $post, $thumbid );      Here's the problem. I have registered 5 image sizes with `add_image_size` in my Wordpress functions file. When I sideload per the code above, WP generates all the thumbs for the image in all the sizes _except one,_ 640x400. I believe it's skipping this thumb since 640x400 is actually larger than the image that is returned from YouTube. However, I need to get that thumbnail no matter what-- I want to force Wordpress to generate that thumbnail. How can I do that? I register the image size just like all others:                add_image_size( 'static-head', 640, 400, true );      So I'm looking for function sort of like `wp_generate_thumbnail($thumbid, 'static-head')`, that will leave the right 640x400 image in the uploads folder. Thank you--


title: php within a shortcode within php

text: I've been trying for ages to get this work, but to no avail! Any help would be greatly appreciated.               <?php echo do_shortcode("[thumb]'".bp_profile_field_data('field=3')"'[/thumb]"); ?>      Basically I the centre part (enclosed by the 1st closing and second opening square brackets are causing the trouble. Thanks


title: Echo page path suffix only - not the title, path or permalink

text: Is it possible to echo a page path suffix only? ie: if the path/permalink is example.com/about, echo just "about"? My page paths are different than my page titles (ie: page title for example.com/about is "About ACME Co.") so I cannot use `the_title()` I am trying to echo just the suffix so it is the same name as an icon image for each page, so if the page is "about", the icon is `icon_page-about.png`, like this (wpse_page_suffix is where I need the help): `<img src="<?php bloginfo('template_directory'); ?>/_img/icon_page-<?php wpse_page_suffix();?>.png" alt="Icon - <?php the_title();?>" />`


title: How do I force wp_enqueue_scripts to load at the END of <head>?

text: I am loading scripts via wp_enqueue_scripts in my child theme. The only problem is that my style.css script get loaded BEFORE plugin scripts, yet I need to override the css in the plugins with my style.css, meaning it has to load AFTER plugin scripts. I don't want to add "!important" too all of my css styles because that is tedious and could break some of my styling. I tried adding a priority but it did not effect the loading order at all.                   add_action('wp_enqueue_scripts', 'scripts', 9999);      I would simply like to wp_enqueue_scripts at the very end of the header, just before < /head >. How can it be done? Thanks :-) **UPDATE:** Yay I figured it out! Simply register the filter with:                   add_action('wp_print_styles', 'scripts');      wp_print_styles loads with a priority of 8, and it still places them in the header because it's a part of wp_head. I figured this out by looking in wp-includes/default-filters.php, so thanks for the tip! :-)


title: How do I display a greyed out next_post_link when there is no next post

text: Wordpress hides the next and previous post links if there are none, but for the sake of visual consistency I'd like to serve up a greyed out version of the link when there is no next or previous post. I'm assuming a simple if else statement will do, but I don't really do PHP. Any thoughts?


title: How to Add a Custom Colum on Thickbox Media Gallery Tab?

text: On searching for a solution, I found the following codes to add col on media page:               add_filter ( "manage_upload_columns",  'upload_columns' );     add_action ( "manage_media_custom_column", 'media_custom_columns' , 0, 2 );      The result is close to what I want, but I need to implement it on thickbox gallery tab-- I want to add an "Include" checkbox column for the media items. How can I achieve this? **[update]**   This checkbox would serve as the _include_ part in the gallery shortcode `[gallery include="23,39,45"]`. _But_ , the shortcode is not written in the post content. The gallery is added for each post by a theme template. **[update]** To save the ids we get from brasofilo's scripts, I added name="include_ids" in the shortcode line and added this:               add_action( 'edit_attachment',  array ($this,'save_to_parent_meta' ));          function save_to_parent_meta(){     if ( isset($_POST['include_ids']) && !empty($_POST['include_ids']) ) {     check_admin_referer('media-form');     update_post_meta( $_REQUEST['post_id'],'include_ids',$_POST['include_ids']);     }     }      This will save the ids to parent post's meta if 'includes_ids' filed is not empty. Nearly perfect. But, when the tab is loaded, the include_ids field is empty, and all checkbox is unchecked. Users might think they need to check again even if they don't want to make change.


title: How to modify the attachment info text on gallery tab or media page?

text: when show/edit an image/file, on the right side of the image/file, there are some text info-- File name, File Type, Upload date, Demention... How to modify those text?


title: Custom Taxonomy Tag Search

text: I have an existing WordPress search function, what I'd like to be able to do is extend the search to the tags from my custom taxonomy...how do I do that?               <form method="get" id="searchform" action="<?php echo home_url(); ?>">         <input type="text" value="Product Search..." name="s" id="s" />         <input type="image" src="<?php bloginfo('template_directory') ?>/images/icosearch.png" id="searchsubmit" value="" />     </form>      I tried to use the "Search Everything" plugin, but that functionality doesn't seem to extend to custom taxonomies. I'm not sure if there is a different plugin or some kind of filter that would get the job done. Thanks in advance!   Josh


title: What hooks, actions or filters i can use to customize wordpress registration page and form?

text: i would like to customize the design of the registration page of wordpress and also the registration form. Can i create a registration page template? or maybe tell wordpress to use a custom registration page i create.


title: If else with shortcodes

text: I only want one of these shortcodes to display if the custom field value is true. I'm not understanding the logic to do this. So basically, if there is a twitch video and a own3d video I only want the top video (twitch) to display. So on and so forth. Is this beyond the if else statement? I'm adding this code of course to my template.php file. My second question is would this code be better off using the switch method?               <?php     $twitch = get_post_meta( $post->ID, 'twitch', $single = true );     $own3d = get_post_meta( $post->ID, 'own3d', $single = true );     $livestream = get_post_meta( $post->ID, 'livestream', $single = true );     $ustream = get_post_meta( $post->ID, 'ustream', $single = true );     $justin = get_post_meta( $post->ID, 'justin', $single = true );               if ($twitch == '') {     }     else {      echo do_shortcode('[livestream type="twitch" channel="' . $twitch . '"]');     }          if ($own3d == '') {     }     else {      echo do_shortcode('[livestream type="own3d" channel="' . $own3d . '"]');     }     if ($livestream == '') {     }      else { echo do_shortcode('[livestream type="livestream" channel="' . $livestream . '"]'); }               if ($ustream == '') {     }     else {     echo do_shortcode('[livestream type="ustream" channel="' . $ustream . '"]');     }          if ($justin == '') {     }     else {     echo do_shortcode('[livestream type="justin" channel="' . $justin . '"]');     }     ?>


title: Creating a subdomain network in a subdomain

text: I've installed Wordpress on subdomain.domain.com. I've enabled the Wordpress Network on this installation, choosing a subdomain install. I've created a wildcard subdomain in cpanel, which is *.subdomain(.domain.com), which points to /public_html/subdomain I've created a site: site.subdomain.domain.com, but I cannot visit the dashboard of this site, nor does it show under the My Sites dropdown menu after creating it - I get an ISP Site Not Found page. Is this situation not workable: creating a subdomain network in a subdomain?


title: Error establishing a database connection when installing multiple sites locally

text: 1. Initially I was using MAMP and had only 1 wordpress site running locally on my Mac. I've set: document root to: documents/mywebsites/mysite1 In phpMyAdmin I created a DB called: mysite1 wp-config file: mysite1/root/root/localhost   2. Since I would like to develop another website, I have upgraded to MAMP Pro. In MAMP Pro Hosts tab, I can see the previous server: mysite1 I have added another server name: mysite2 and set it's document root to: documents/mywebsites/mysite2 In phpMyAdmin I created a DB called: mysite2 wp- config file: mysite2/root/root/localhost   1. When going to localhost/mysite1, I can see the website I already have created a while ago. I can also get to the localhost/mysite1/wp-admin. However, when going to localhost/mysite2, I am getting: > "Error establishing a database connection" I get the same error in: localhost/mysite2/wp-admin.   1. I tried to change the wp-config to point to `127.0.0.1:3306`. now mysite1 does not work (the browser shows a blank white page) And also mysite2 gives same results   2. Using Sequel Pro, I noticed that the db mysite1 contains a few table, but the db mysite2 does not contain any table.   3. MAMP is configured with: Apache on port `80`. And MySQL on `3306` I've googled a few pages which provided solutions that did not help. Perhaps anyone can advise?


title: Multisite development environment

text: I have a domain-based multisite with domain mapping. Until now I've been developing locally with   * my hosts file setup to handle all sites through localhost    * a flag in my wp-config.php, indicating whether to use the local or live db This makes development very pleasant, because development and production environment are very similar and all paths are always identical. Now I need to develop on a public / non-localhost address. What's the best way to accomplish that - or what options exist in general.


title: Custom wordpress SQL statement for a website

text: I'm trying to link specific columns from a few standard tables in a wordpress database. I specifically want to see a view/table that includes:               post title     post content     guid     meta value = image url      This kind of works but I have 3 rows per item returned. I just want one, then to be able to select the newest item from all categories except 2, 4 and 7 for example.               SELECT wp_posts.post_title, wp_posts.`guid`, wp_postmeta.meta_value     FROM wp_posts, wp_postmeta     WHERE wp_posts.post_type = 'post'     AND wp_postmeta.meta_key = 'image_url'     AND wp_posts.post_status = 'publish'      I've been on this task for 3 days and searched hi and lo, watched videos, followed tuts and am about to pull my hair out.


title: How can I increase the font sizes used by the WordPress visual and HTML post editors?

text: When I'm editing a post, the text looks too small. I want larger text **while editing**. Note that I'm **not** referring to increasing the text in the resulting post ... I mean the text _as it is displayed while I am editing_ , only. I've looked at Settings under "Writing" and I see I can change the _number of lines_ in the editor to make the edit area larger to fill more of my screen, but how can I make each of those lines render in a larger font?


title: Create custom fields as image uploads

text: How can I define a custom field that works as an image upload? Should be fairly basic but I can't seem to find the solution. Let's say you create the post type 'book' and want to create 3 fields: cover, back, index... I don't know... I've done similar stuff in the past with flutter/magic fields but they don't seem to be updated or support native WP3 custom post types. Alternatives anyone? Thanks in advance


title: Meta query - How to display a null meta key

text: At the base I have this query wich displays 9 randoms custom post type :               $args= array(         'post_type' => 'adverts',         'orderby' => 'rand',         'posts_per_page' => 9,         'tax_query' => array(             array(                 'taxonomy' => 'type',                 'field'    => 'slug',                 'terms'    => $term             )         )     );      Now I would like to display 9 adverts (CPT) which have a votes average (meta_key) lower than 6. So I add this :               $args= array(         'post_type' => 'adverts',         'orderby' => 'rand',         'posts_per_page' => 9,         'meta_query' => array(             array(                'key' => 'votes_average',                'value' => '6',                'compare' => '<',                'type'    => 'NUMERIC',             )         )     );      When I don't add this meta_query, my first query works. I mean it diplays random posts even those who have a "votes_average" equal to 0. But the secondary query doesn't display the adverts with a "votes_average" equal to 0. Did I forget something ?


title: How to make a list of posts displaying them 5 by 5 with a "next posts" link?

text: I have been googling for the past 2 hours and haven't been able to figure this out, mainly because I am missing the right terminology, in other words, I don't know what I want in "wordpress words". What I want is a custom ¿page? that will display the header (get_header()) and below it it will be a list of the last 5 **published** posts and it should go like this: > Title of the post >   >   >     Text of the post >   Times five for the last five. Underneath it there should be a link to "Older posts" that links to the next five (older) posts. I'm told this is an archive but the documentation on Archive doesn't help to accomplish this, neither do the tutorials I've found. What is the easiest way to do this?


title: Display latest 12 images from media library

text:
I was looking for almost a week for such solution - without success. What I want to achieve is have a kind of 'photos cloud' on my wordpress homepage. What I need to do is to display latest 12 photos added to media library (so not from specific posts, but in general). thumbs should appear in a square - 3 cols, 4 rows (but of course this part I can get via css). I have no brightest idea how to make it.. I've found such piece of code:               $args = array(         'post_type' => 'attachment',         'post_status' => 'published',         'posts_per_page' =>25,         'post_parent' => 210, // Post-> ID;         'numberposts' => null,     );          $attachments = get_posts($args);          $post_count = count ($attachments);          if ($attachments) {         foreach ($attachments as $attachment) {         echo "
";             $url = get_attachment_link($attachment->ID);// extraigo la _posturl del attachmnet                   $img = wp_get_attachment_url($attachment->ID);             $title = get_the_title($attachment->post_parent);//extraigo titulo             echo '';             echo "
";         }        }      But I don't know how to finalize it - without pointing to specific post. Any ideas?:) thank u!


title: Change the_title() of a page dynamically

text: I'm developing a plugin that doesn't use a custom post type, but separate database tables. It's a plugin that displays a list of courses with links that lead to the different course detail pages, where the user then can subscribe for a course. In the current state, I'm using a shortcode to get the plugins data into a page with a custom page template (page-courses.php). I now want to change `the_title()` dynamically, according to the page that the plugin shows (list of courses, course details page with forms, form submission success page). But whenever I do that with the following filter, the links to other pages in the footer also change:               <?php          add_filter('the_title', 'custom_page_title');     function custom_page_title() {         return 'Custom Title';     }      ## Edit In the footer.php I have a function that includes footer links with `wp_nav_menu()` so I can define them in Appearance > Menus. But with the filter above, all the links in the footer also change to 'Custom Title'. But I just want to change the title of the page, not affecting menu links in the footer. Trying to add a conditional tag `in_the_loop()` the footer links are still affected, although they are not in the loop.               <?php          add_action( 'loop_start', 'set_custom_title' );     function set_custom_title() {         if ( in_the_loop() ) {             add_filter( 'the_title', 'custom_page_title' );         }     }          function custom_page_title() {         return 'Custom Title';     }      It’s similar to this question: filter the_title problem in nav, just that the links affected are in the footer and `in_the_loop()` doesn't work. How I can I change `the_title()` while only affecting the title of the current page being shown _not affecting links in the footer_? ## Edit 2 - Solution So I finally got it working:               <?php          add_action( 'loop_start', 'set_custom_title' );     function set_custom_title() {         add_filter( 'the_title', 'wpse83525_filter_the_title', 10, 2 );     }          function wpse83525_filter_the_title( $title, $id ) {         if ( 'page-listcourses.php' == get_post_meta( $id, '_wp_page_template', true ) ) {             return 'Custom Title';         }         return $title;     }      The file page-listcourses.php is a Custom Post Template that I assigned to the static page named 'Courses'. I assume it didn't work before because the name of the static page and filename of the Custom Post Template were the same.


title: Why does this query not SELECT post IDs like a normal query would?

text: 1. I have a page template, call it page-myblog.php, that I want to display an ordinary loop on.    2. I have created a page 'myblog' in the admin area and it crops up as normal on the front end.   3. I want to show all my blog posts in the loop on that page template. I refuse to instantiate a new WP_Query on the page and I want to edit the main query instead. This appraoch has not worked thanks to the following behaviour:               add_action( 'pre_get_posts', function( $query ) {         if( $query->query['pagename'] === 'myblog' ) {             $query->set( 'pagename', null );             $query->set( 'post_type', 'post' );         }     });      results in the following SQL being generated.               SELECT   wp_posts.* FROM wp_posts  WHERE 1=1  AND wp_posts.post_type = 'post'  ORDER BY wp_posts.post_date DESC       This query works, which is to say, it does find posts if you run it in an SQL console, but because it doesn't explicitly select IDs (I think?) there's nothing in my $query->posts array. Why does this happen? And can I fix it?


title: Echo all category names, apart from one

text:
I've got this simple code, that creates breadcrumbs:               function the_breadcrumb() {         if (!is_home()) {             echo '';             echo 'home';             echo " / ";             if (is_category() || is_single()) {                 the_category(' / ');                 if (is_single()) {                     echo " / " . '' . get_the_title() . '';                 }             } elseif (is_page()) {                 echo " / " . '' . get_the_title()  . '';             }         }     }      And this echoes out:
         home /          Fashion /          Top /          This is in the fashion category.
      However, it do not want it to show the `a href` tag that links to the `top` category. Is there a way to include a str_replace, or just prevent the_category from calling `top` (I still need the post, I just don't want to link to `top` in the breadcrumbs)?


title: Prevent simultaneous logins

text: I have been searching the internet for a long time but couldn't find a suitable solution. I am using wordpress for a online service via subscriptions (woocommerce subscriptions). I want to prevent simultaneous logins. There are many plugins that will logout the user who logged first but this is not a solution to me. I need the user to be unable to login if his account is already logged in and display an error message like "your account is already in use". Is this possible? Thanks in advance.


title: What hooks should I use for pre-login and pre-registration actions?

text: I am adding cookie on login page using 'init' action-hook. And than after login I check if this cookie exist in 'login_init' action-hook. And also after user registration I check if this cookie exist in 'registration_errors' filter-hook. **Do I use proper hooks for pre-login and pre-registration actions?** code:               <?php          $securityprotection_send_brute_force_log_to_admin = true; // if true, than info about blocked brute-force attacks will be sent to admin email          $securityprotection_login_cookie_check = true; // if true, than cookie will be set on login screen and checked before login          $securityprotection_registration_cookie_check = true; // if true, than cookie will be set on registration screen and checked before registration                    if ( ! function_exists( 'securityprotection_hooks' ) ) :              function securityprotection_hooks() {             add_action( 'init', 'securityprotection_set_login_cookie' );             add_action( 'login_init', 'securityprotection_login' );             add_filter( 'registration_errors', 'securityprotection_registration', 10, 3 );         }              securityprotection_hooks();                   function securityprotection_set_login_cookie() {             global $securityprotection_login_cookie_check;             if( $securityprotection_login_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD']) == 'GET' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                     setcookie( 'wordpress_secprot_cookie', '1', time()+60*60*24*30, COOKIEPATH, COOKIE_DOMAIN ); // set cookie for a month                     $_COOKIE['wordpress_secprot_cookie'] = '1';                 }             }         }                   function securityprotection_login() {             global $securityprotection_send_brute_force_log_to_admin, $securityprotection_login_cookie_check;                  if( $securityprotection_login_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                          if ( $securityprotection_send_brute_force_log_to_admin ) { // if sending email to admin is enabled                         $securityprotection_admin_email = get_option('admin_email');  // admin email                              if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet                             $ip = $_SERVER['HTTP_CLIENT_IP'];                         } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // to check ip is pass from proxy, also could be used ['HTTP_X_REAL_IP ']                             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];                         } else {                             $ip = $_SERVER['REMOTE_ADDR'];                         }                              $securityprotection_message_brute_force_info = '';                         $securityprotection_message_brute_force_info .= 'IP : ' . $ip . "\r\n";                              $securityprotection_message_brute_force_info .= 'HTTP_USER_AGENT : ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'REQUEST_URI : ' . $_SERVER['REQUEST_URI'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'HTTP_REFERER : ' . $_SERVER['HTTP_REFERER'] . "\r\n\r\n";                         //$securityprotection_message_brute_force_info .= 'SERVER_PROTOCOL : ' . $_SERVER['SERVER_PROTOCOL'] . "\r\n";                         //$securityprotection_message_brute_force_info .= 'REDIRECT_STATUS : ' . $_SERVER['REDIRECT_STATUS'] . "\r\n\r\n";                                   $securityprotection_message_brute_force_info .= 'POST vars:'."\r\n"; // lets see what POST vars brute-forcers try to submit                         foreach ( $_POST as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_POST['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                                        $securityprotection_message = '';                              $securityprotection_message .= $securityprotection_message_brute_force_info; // post, cookie and other data                              $securityprotection_message .= $securityprotection_message_append;                                   $securityprotection_subject = 'Login brute-force on site ['.get_bloginfo( 'name' ).']'; // email subject                         @wp_mail( $securityprotection_admin_email, $securityprotection_subject, $securityprotection_message ); // send log info to admin email                          }                          // many brute-force attacks are waiting for redirect or WordPress login cookies                     // if we will fake redirect and login cookies than many brute-forcers will stop their attacks                          securityprotection_set_fake_login_cookies(); // set fake login cookies                          securityprotection_fake_redirect(); // fake admin dashboard redirect                      }                  }              }              function securityprotection_registration($errors, $sanitized_user_login, $user_email) {             global $securityprotection_send_brute_force_log_to_admin, $securityprotection_registration_cookie_check;                  if( $securityprotection_registration_cookie_check ) {                 if( strtoupper( $_SERVER['REQUEST_METHOD'] ) == 'POST' and !isset( $_COOKIE['wordpress_secprot_cookie'] ) ) {                          if ( $securityprotection_send_brute_force_log_to_admin ) { // if sending email to admin is enabled                         $securityprotection_admin_email = get_option('admin_email');  // admin email                              if ( !empty( $_SERVER['HTTP_CLIENT_IP'] ) ) { //check ip from share internet                             $ip = $_SERVER['HTTP_CLIENT_IP'];                         } elseif ( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) { // to check ip is pass from proxy, also could be used ['HTTP_X_REAL_IP ']                             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];                         } else {                             $ip = $_SERVER['REMOTE_ADDR'];                         }                              $securityprotection_message_brute_force_info = '';                         $securityprotection_message_brute_force_info .= 'IP : ' . $ip . "\r\n";                              $securityprotection_message_brute_force_info .= 'HTTP_USER_AGENT : ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'REQUEST_URI : ' . $_SERVER['REQUEST_URI'] . "\r\n";                         $securityprotection_message_brute_force_info .= 'HTTP_REFERER : ' . $_SERVER['HTTP_REFERER'] . "\r\n\r\n";                              $securityprotection_message_brute_force_info .= 'POST vars:'."\r\n"; // lets see what POST vars brute-forcers try to submit                         foreach ( $_POST as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_POST['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                              $securityprotection_message_brute_force_info .= 'COOKIE vars:'."\r\n"; // lets see what COOKIE vars brute-forcers try to submit                         foreach ( $_COOKIE as $key => $value ) {                             $securityprotection_message_brute_force_info .= '$_COOKIE['.$key. '] = '.$value."\r\n"; // .chr(13).chr(10)                         }                         $securityprotection_message_brute_force_info .= "\r\n\r\n";                                   $securityprotection_message = '';                              $securityprotection_message .= $securityprotection_message_brute_force_info; // post, cookie and other data                              $securityprotection_message .= $securityprotection_message_append;                                   $securityprotection_subject = 'Registration brute-force on site ['.get_bloginfo( 'name' ).']'; // email subject                         @wp_mail( $securityprotection_admin_email, $securityprotection_subject, $securityprotection_message ); // send log info to admin email                              $errors = new WP_Error();                         $errors->add( 'security_protection_error', 'ERROR: Security-protection registration error.' );                              //securityprotection_set_fake_login_cookies(); // set fake login cookies                         //securityprotection_fake_redirect(); // fake admin dashboard redirect                          }                 }             }             return $errors;              }               endif; // end of securityprotection_hooks()               if ( ! function_exists( 'securityprotection_plugin_meta' ) ) :         function securityprotection_plugin_meta( $links, $file ) { // add 'Plugin page' and 'Donate' links to plugin meta row             if ( strpos( $file, 'security-protection.php' ) !== false ) {                 $links = array_merge( $links, array( 'Security-protection' ) );                 $links = array_merge( $links, array( 'Donate' ) );             }             return $links;         }         add_filter( 'plugin_row_meta', 'securityprotection_plugin_meta', 10, 2 );     endif; // end of securityprotection_plugin_meta()                    if ( ! function_exists( 'securityprotection_random_string_generator' ) ) :         function securityprotection_random_string_generator( $readable = 0, $length = 32 ) {             $random_string = '';             if( $readable ){ // create readable random string like 'suzuki'                 $characters_b = 'bcdfghjklmnpqrstvwxz';                 $characters_a = 'aeiouy';                 $ab = 'b';                 for( $i = 0; $i < $length; $i++ ) {                     if( $ab == 'b' ){                         $random_string .= $characters_b[ rand( 0, strlen( $characters_b ) - 1 ) ];                         $ab = 'a';                     } else {                         $random_string .= $characters_a[ rand( 0, strlen( $characters_a ) - 1 ) ];                         $ab = 'b';                     }                 }             } else { // create fully random string like 'q3WLtN'                 $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';                 for( $i = 0; $i < $length; $i++ ) {                     $random_string .= $characters[ rand( 0, strlen( $characters ) - 1) ];                 }             }             return $random_string;         }     endif; // end of securityprotection_random_string_generator()               if ( ! function_exists( 'securityprotection_fake_redirect' ) ) :         function securityprotection_fake_redirect() { // fake admin dashboard redirect             //header("HTTP/1.0 403 Forbidden"); // correct redirect             $redirect_to = admin_url();             wp_safe_redirect($redirect_to); // redirect the brute-force bot to admin section to emulate that the password is cracked and some brute-forcers stop their attacks after such redirect :)             exit();         }     endif; // end of securityprotection_fake_redirect()               if ( ! function_exists( 'securityprotection_set_fake_login_cookies' ) ) :         function securityprotection_set_fake_login_cookies() { // set fake login cookies                  $expiration = time() + 14 * DAY_IN_SECONDS;             $expire = $expiration + ( 12 * HOUR_IN_SECONDS );             $secure = '';                  // login cookie names are located in wp-includes/default-constants.php:             // define('AUTH_COOKIE', 'wordpress_' . COOKIEHASH);             // define('LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH);                  $cookie_name_random = securityprotection_random_string_generator();             $cookie_value_random = securityprotection_random_string_generator();             $auth_cookie_fake = 'wordpress_'.$cookie_name_random;             $logged_in_cookie_fake = 'wordpress_logged_in_'.$cookie_name_random;                  setcookie($auth_cookie_fake, $cookie_value_random, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure, true);             setcookie($logged_in_cookie_fake, $cookie_value_random, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure, true);         }     endif; // end of securityprotection_set_fake_login_cookies()      Link to the plugin - https://dl.dropboxusercontent.com/u/1025327/share/security-protection-1.2.zip


title: How can I hide any submenu item from dashboard menu but still have access to it from direct url

text: I just want to hide a page but I want to access it by directly entering its url. But I am unable to access that page after remove_submenu_page() function. I get this error: You do not have sufficient permissions to access this page. Here is the code:               add_action("admin_menu", function(){             add_menu_page("PG", "PG", "manage_options", "epaper", function(){             echo "sdsds'";                 }, null, 3);         add_submenu_page("epaper", "dsds", "dsds", "manage_options", "x", function(){             echo "dds";         },null,3);          remove_submenu_page("epaper", "x");     });      I am unable to access /wp-admin/admin.php?page=x However if I remove the function remove_submenu_page then again it opens. But shows in admin dashboard menu. I just want to hide it from dashboard menu. Please tell me how can I hide any submenu item from dashboard menu but still have access to it from direct url.


title: Developing a childtheme, how to disable the parents templates?

text: I am developing a simple child theme based on twentyeleven. But i notice twentyeleven has a showcase and sidebar template when you add a new page. How can i disable these templates from functions.php? I want to show only the templates from the child theme regards


title: I cannot search users via user nicename

text: I use the following to build a users drop-down box:               echo'<select name="user">';     echo'<option value="0">' . __('ALL', 'wpzoom') . '</option>';     foreach( $users as $user ){         echo '<option value="'.$user->data->user_nicename.'">'.$user->data->display_name.'</option>';     }     echo'</select>';      but the WP_Query I use to trap the result returns empty resultset:               $user = $_GET["user"];          $args = array(                         'order' => 'DESC',                                             'orderby' => 'date',      'posts_per_page'=> 10,      'paged' => $paged     );          if ( '0' != $user ) {         $args['author_name'] = $user;      }          $lala = new WP_Query($args);      This is strange because WP_Query documentation says this is correct. Where am I wrong?


Can you add the visual editor to the description field for custom taxonomies? It would be nice to have this option available when you edit an entry for a taxonomy be it core or custom.


title: Adding page Title in a custom coded page

text: I have been coding a custom profile page for users in wordpress. its a hard coded file called "myprofile.php" I am unable to get the username to show up in the page title.. take a look : http://www.designzzz.com/user/ayazmalik/ k i tried a few filters to add title to this page but didn't helped me :( . lets say the username storing variable is $myusername . how can i do it.. im considering this title : `<title>user_name</title>` Help is appreciated :) cheers


title: Make wordpress generate a custom XML file(not a sitemap) that is updated only when new content is posted?

text: I'm not looking for a sitemap, I'm looking to create an xml file that I can have a flash menu access, but I don't want to generate the XML file each time someone visits a page, I want to have a static XML to refer to for speed. And I'd like to have wordpress update the file whenever new content is posted(not comments). Is there anything built into wordpress that would allow me to do this? Any plugins? Again, I don't want a sitemap. I want a specific list of items. Right now I've been using page templates with custom loops, but it takes to long to generate every time.


title: What's the easiest way to close comments on media/attachments?

text: I consistently get spam attempts on various and sundry media attachments on my primary WP blog. By default, media has open comments (for instance, http://literalbarrage.org/blog/archives/2009/03/18/daddywill-date- march-2009/dsc08760/), yet there is no native way to disable comments on media files. (e.g. https://skitch.com/zamoose/rhktp/attachmentedit) ![enter image description here](http://i.stack.imgur.com/VAkbz.png) So, two questions:   1. How do I disable all comments for future uploads by default?   2. How do I retroactively disable comments on all previous uploads? This will help a _ton_ in reducing my incoming spam...


title: Hosting alternatives to WordPress.com

text: I've been hosting my blog on WordPress.com for a few years now, but am starting to feel a bit constrained by some of the limitations. The most troublesome in priority order are inability to include JavaScript in my posts, the requirement to pay an ongoing fee for customized CSS, and inability to install my own WP plugins. I've thought about self-hosting, but the last thing I need is another side project of managing the blogging software. It's tough enough finding time to keep posting new content on the blog. I'm not interested in installing upgrades, doing backups, etc. Long story short, I am wondering if there is another Wordpress hosting provider out there that offers the benefits of the virtually maintenance free hosting of WordPress.com, but without the restriction on CSS and Javasscript. Any suggestions?


title: How would I got about calling a php file every time someone publishes a new post?

text: I've got a custom php file that I want to call every time someone publishes a new post. How would I go about doing that? Can I write it into the functions.php of my theme?


title: Theme development

text:
I am working on converting an HTML template to a WordPress theme. The index.html is as follows:               <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />     <title>Eternal Blossming</title>     <link href="css/style.css" rel="stylesheet" type="text/css" />

Connect us with

New User?Register here

Home

Eternal Sharing

Eternal Resource

Event Calender

Gallery

FAQ

Blog

Eternal Shoppe

Shree Man Madhawa Gaudeshwar

Vaishnavacharya Shree Abhishek Ji Goswami

Conscious Living is a program designed to re-align ourselves to the inner sources of our creativity, inspiration, purpose and strength. It is a highly interactive, experiential and joyful approach to learning the principles and practices of Conscious Living.

HADAYOLI is Transformational teachings shared in an atmosphere of trust, light-heartedness and joy. HADAYOLI stands for the Happiest Day Of Your Life!
     .

Engaging, quick-witted and having a fine Art, he is able to empathize with their emotions, challenges and aspirations. Understanding the stress, competition and peer pressure that they face, Nithya Shanti provides them with practical tools for self-understanding, self-acceptance, development and growth.

Engaging, quick-witted and having a fine to empathize with their emotions, challenges and aspirations. Understanding the stress, competition and peer pressure that they face, Nithya Shanti provides them with practical tools for self-understanding, self-acceptance, development and growth.

Feedback

Name
	         <input name="text" class="text_box" type="text" />

Email
	         <input name="text" class="text_box" type="text" />

Messege
	         <input name="text" class="text_box02" type="text" />

Newsletter

Email
	         <input name="text" class="text_box" type="text" />

Upcoming News

     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.     As you can see, once there's enough text in this box, the box will grow scroll bars... that's why we call it a scroll box! You could also place an image into the scroll box.

Home

Eternal Sharing

Eternal Resource

Event Calender

Gallery

FAQ

Blog

Eternal Shoppe

                    I cannot figure out how to include the banner in the loop. I have written the loop as follows:          <?php     if ( have_posts() ) :     while ( have_posts() ) :     the_post();     ?>     <a href="<?php the_permalink(); ?>"><?php the_title(); ?>
     <?php     /* the_content(); */ ?>     <?php if ( is_page) { ?>     <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/style.css" type="text/css" media="screen, projection" />          <?php } ?>     <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen, projection" />

     <?php the_content(); ?>
     <?php endwhile;      endif;     ?>      But the banner is not showing up. Please help. Regards


title: Wordpress "Add new tag" button is not working

text: I really dont know where else to look at :( When I try to create a new tag in wordpress from back end under post column, it wont save the tag. However when I tried to save a blank it prompts me an error as suppose to be..only major issue is- it is not SAVING AT ALL. Following are the things I tried with no luck -   * Deactivated all plugins(although I have only 3 plugin though) and then checked but no luck.   * Firebug it for JS errors but NO JS errors though.   * I freshly re-installed/updated Wordpress core files to look if it missed something previously but no luck.   * Tried by setting it to true for error but no luck define('WP_DEBUG', false); Let me know what else I can try apart from these things. **FYI** - I am testing the site on staging server so have URL something like this-               http://1XX.1XX.2XX.2XX:8XXX/      and this is what I set under WordPress Address (URL) & Site Address (URL) [although not very sure if this is actually has to do something with this or not]


title: Get post by Category in custom template

text:
I want get all categor and after that i want get 5 post per category. but my code not work! http://pastebin.com/vxDSGGZk               <?php         $categories=get_categories('');         foreach($categories as $category) {              echo '
Category: term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'
 ';             echo '
 Cat ID: '. $category->cat_ID. '
';                  // The Query             $id_cat = $category->cat_ID;}             $args = array(                 'cat' =>  $id_cat,                 'posts_per_page' => 5,             );             query_posts( $args );                  // The Loop             while ( have_posts() ) : the_post();                 echo '
';                 the_title();                 echo '
';             endwhile;         }              // Reset Query         wp_reset_query();     ?>      please help me! thanks! P/s:this is the first time i ask on here and i can't paste code in here. please check link pastebin.


title: What is the best way to revert to www version of domain name?

text: My site uses a bare domain, example.com. I want to use Google's Page Speed Service, which requires a www subdomain, like this www.example.com Google says the server must use a 301 redirect. What is the best way to do this? Can I simply change the WP General Settings and add the www there?


title: Does Jetpack store comments in local database also?

text: I want to implement JetPack comments plugin on my external WordPress site. I assume it stores the comments in the local database of the website also. Is it possible to disable that option so that it does not store comments in local database?


title: Global MySQL replacing of text patterns/matches

text: I'm familiar with this method...               update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);      The problem is, I'm trying to do this to all tables (or select tables), but need the replace to hit all columns for the table in question. Currently, the only way I've found for a table with 20 columns is to repeat this query 20 times. Once for each column. Is there any way to simply apply the search replace on the table rather than column?


title: Count of posts with meta_key filled in?

text:
Working on upcoming events list that returns posts fine in a custom query. In the custom post type 'event' there are multiple events within a date range. I want to display all upcoming events in order. This I can do but I also want to count the events for each day. Right now I am using found_posts to return the post count from the query but that misses posts that have two or more meta_keys filled in. How do I get an accurate count of events for both meta_keys - opening_time and artist_talk time? The goal is to publish one custom post for an event that has a permalink with all the information. Each custom post has meta boxes that can be filled it with the date range for the beginning and end of the event (usually runs for a month or two) as well as dates for activities that are one day only during the run of the event. Opening Night, Lectures, Films .... that have their own meta box fields. Not all events have all activities. I want to have the upcoming event list count the number of "activities" that happen on a certain day not count the CPT events. Each activity will list its type as an H2 and then the title that will link to the permalink of the Event with all the information. Thank you in advance.                     <?php           $today = date("Y-m-d");           $todaytext = date("l");                 for ($i=0; $i<7; $i++){           $thedate = strtotime ( '+'.$i.' day' , strtotime ( $today ) ) ;           $thedate = date ( 'Y-m-d' , $thedate );           $thedatetext = strtotime ( '+'.$i.' day' , strtotime ( $todaytext ) ) ;           $thedatetext = date ( 'l' , $thedatetext );            $event_query = new WP_Query(           array(              'post_type'   => 'event',             'meta_key'    => 'opening_time',             'orderby'     => 'meta_value',             'order'       => 'asc',             'meta_query'  => array(                array(                 'key'     => 'opening_time',                 'value'   => $thedate,                 'compare' => 'LIKE',                 'type'    => 'DATE'               ) // end array              ) // end 'meta_query' arrayx             ) // end array           ); // end top array             if ($event_query->have_posts()){            echo $event_query->found_posts;          $totalevents=$event_query->found_posts;            if ($totalevents>=2){       echo ' Events ';       } // end if ($totalevents>=2) function            if ($totalevents<2){        echo ' Event ';       }            if ($thedate==$today){echo 'Today';}       if ($thedate>$today){       echo $thedatetext;}       echo  '
';       }            if ($event_query->have_posts()) : while ($event_query->have_posts()) :  $event_query->the_post();            if (get_post_meta($post->ID,'opening_time', true)==$thedate)       {       ?>       <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('
', '
'); ?>
Opening Reception
       <?php            }            if (get_post_meta($post->ID,'artist_talk_time', true)==$thedate){ ?>       <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('
', '
'); ?>
 Artist Talk
            }             endwhile;       endif;       rewind_posts();            }       ?>


title: How can I wrap html around the output of the_time function?

text:
My current code in functions.php:               echo '
'.the_time('d', '
', '
').the_time('F', '
', '
').the_time('Y', '
', '
').'
';      But it only returns:               20April2011      No html around it, why? how can I fix this?


title: How to insert a column (part of theme) in the middle of the content body?

text: Was asked to simplify the question. Here we go: As you know, the "content" part of a WordPress posts all appears together. What I'm trying to recreate is how on several news sites, they'll have the title (and the rest of the "meta" stuff), followed by a photo or video, but then the body text is slightly indented either from the get-go (or shortly thereafter) to make room for a thin, left column that might display related stories, advertisements, additional meta data about the post itself, or even contain videos for the post itself. Examples:   http://www.cnn.com/2011/US/05/24/nasa.new.spacecraft/index.html?hpt=T1   - story highlights, related topics. Image and caption take up full width, but the highlights column indents body text.   http://www.chicagotribune.com/news/local/breaking/chibrknews-blagojevich-to- take-the-stand-20110524,0,6202649.story   - related articles, related topics, ads. Unlike the CNN example, the column actually starts partway through the body text. My dilemma is that since the photo or video that starts each post is part of the "content," I can't indent the text and put in the column unless I were to do that manually for each post. I've contemplated making a custom field for the image or video input to essentially "separate" it from the body text, but that might prove difficult, since I don't know how it would differentiate between an image URL and a YouTube URL or embed code. Anyone have any better ideas?


title: What templates/funtions needed in custom theme to allow comments the new 3.0 way

text: Hi: I have been using the comments.php, comments-popup.php, single.php and loop from the Kubrick theme to create my blog functionality in themes I build from scratch. But with WP 3.0 there's a new approach and I can't quite get it to work. From what I've gathered I have the loop in the index.php, loop with some additional code in the single.php, a category.php, and in the comments.php all there should be is one line of code: `<?php comment_form(); ?>` On the server there's a wp-comments.php page with what appears to be the various parameters that can be adjusted - though how to do that is another question. But my first question is: what exact templates and code are needed to get basic fully functioning comments? Do I have to add anything to the functions.php? I almost got there but I couldn't get comments to actually appear on a page. I had the ability to enter comments working, and the comments would come into the admin, and the live page itself would have a link: 1 comment. But clicking the link took me nowhere. I'm using the loops etc. from this article: http://www.onextrapixel.com/2011/03/08/how-to-code-a-wordpress-3-0-theme-from- scratch/ Can someone enumerate the specific steps to make the new approach work? I'm an HTML/CSS person who understands a little php but not a lot. I'm trying to grasp the relationship between all the pieces/parts needed to make the comments work with the new approach. Thank you for any help!


title: How to add custom options for plugin into the add post screen - like yoast seo

text: On Yoast seo, when you create a new page it gives you the ability to alter titles, etc. This is added by the yoast module. I am writing a plugin, that can have other things attaching to a post. How can I modify the admin panel to add these new option? Thanks John


title: Active DB queries in Wordpress?

text: I just make some researches regarding to wordpress DB queries and I just wonder if I miss something a normal `SELECT` query for example in Codeigniter with active records would look like if I assume I init my DB instance in both of the cases inside of a Class as `$this->db`               $data = $this->db->get('wp_mytable');     $data->result();      **Wordpress way**               $data = $this->db->get_results('SELECT * FROM wp_mytable');      and if I would use a condition than would look like               $this->db->select('*');     $this->db->from('wp_mytable');     $this->db->where('id', 1);     $this->db->result();      I find this handy if I would use more than one `WHERE` as array but I do not see this kind of query types in wordpress wiki or I do not search in the right place?


title: wp_delete_term or wp_delete_category?

text: Hi I need a simple piece of code to delete a category for a custom plugin, but I just found two function references that seems quite the same: ## Function Reference: wp_delete_term Description: Removes a term from the database. Usage: `<?php wp_delete_term( $term_id, $taxonomy, $args ) ?>` ## Function Reference: wp_delete_category Description: Deletes one existing category. Usage: `<?php wp_delete_category( $cat_ID ) ?>` My question is which one I should use (just for delete a category), and what is exactly the difference (or what makes one option better than the other). I'm thinking that the "category" is a "term" and that `wp_delete_category()` uses `wp_delete_term()` so I should use `wp_delete_term()` - I'm right on that or I'm missing something. Thanks


title: how to create a sub section in posts

text: i need to create multiple section in my post. for eg: i have a wordpress post called football with the perma: http://mysite.com/football football contains sub section like rules/schedule/players/stadiums Which should be like http://mysite.com/football/rules http://mysite.com/football/schedule http://mysite.com/football/players http://mysite.com/football/stadiums when i click the main post football, it should redirect to /rules and should have the other links to navigate. just like the one in wordpress plugins link, is their any plugins to do or any snippets would be handy for me..


title: WP Query - posts only by specific user

text:
I have problem. I need insert this wp query `$cust_loop = new WP_Query( 'author=123' );` But I cant remove the `$args` from $cust_loop = new WP_Query($args);` And i tried everything like`$cust_loop = new WP_Query($args, 'author=123');` I want show posts only by specific user, Thanks :) * * *               if($typecount>0) {         class con_latest_reviews extends WP_Widget {             function con_latest_reviews() {                 /* Widget settings. */                 $widget_ops = array( 'classname' => 'Continuum Latest Reviews', 'description' => 'Displays a single review type by most recent or highest rated. Add multiple widgets for each review type.' );                 /* Widget control settings. */                 $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'con_latest_reviews' );                 /* Create the widget. */                 $this->WP_Widget( 'con_latest_reviews', 'Continuum Latest Reviews', $widget_ops, $control_ops );             }                function widget( $args, $instance ) {                      extract( $args );                      /* User-selected settings. */                 $title = apply_filters('widget_title', $instance['title'] );                 $sort = $instance['sort'];                 $reviewtype = $instance['reviewtype'];                 $numreviews = $instance['numreviews'];                      //get review type for More link URL purpose                 $reviewtypeurl = $reviewtype;                 if($reviewtypeurl=="game") $reviewtypeurl="video-game";                      if($sort=="highest-rated") {                     $feedsort="meta_value";                     $metakey="&meta_key=Rating";                 } else {                     $feedsort="date";                     $metakey="";                 } ?>                      <div class="tabdiv reviews <?php echo $reviewtype; ?>">                          <?php                          /* Before widget (defined by themes). */                     echo $before_widget;                          /* Title of widget (before and after defined by themes). */                     if ( $title ) { ?>                                           <?php echo str_replace('
','
',$before_title); ?>                             <div class="icon <?php echo $reviewtype; ?>">
                             <?php echo $title; ?>                         <?php echo $after_title; ?>                     <?php }                           /* HTML output */                     ?>
                         <?php // setup the query                         $args='&posts_per_page='.$numreviews.'_reviews&order=DESC&orderby='.$feedsort.$metakey;                                                      $cust_loop = new WP_Query($args);                          if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;                             // if we're sorting by rating and this item does not have a rating, hide it                             $rating = get_post_meta(get_the_ID(), "Rating", $single = true);                              if(($rating && $feedsort=="meta_value") || ($feedsort!="meta_value")) {                                                                      $ratings = con_setup_rating($rating); //setup the ratings array                                  ?>
                                                                                <?php con_show_rating($ratings[0], $ratings[1], $ratings[2]); // show the stars or hearts ?>                                              <a class="post-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?>
                                  <?php } ?>


title: jQuery Autocomplete in Wordpress

text: I'm using this autocomplete script https://github.com/agarzola/jQueryAutocompletePlugin within my wordpress theme. I have a form in a page where the user could specify some tags. Actually, this is the code I'm using and it's working good.                   <script>             jQuery(function() {                 var data = '<?php global $wpdb; $search_tags = $wpdb->                        get_results("SELECT name FROM $wpdb->terms");                            foreach ($search_tags as $mytag){ echo $mytag->name. " "; } ?>'.split(" ");              $("#tags").autocomplete(data,{multiple: true});                 });     </script>      Now, the problem is, this kind of query puts all the tags inside an array when I load the page. This could work if you have 100 tags, but we have a lot more. The script has also an autocomplete from remote script option as shown below:               <script type="text/javascript">     jQuery().ready(function() {         $("#tags").autocomplete("<?php bloginfo('template_url'); ?>/get-tags.php",          {             width: 260,             matchContains: true,             selectFirst: false,             multiple: true         });     });     </script>      This must activate autocomplete as the user types. This is the code for get- tags.php (I put the file in my theme root)               <?php               include_once(‘../../../wp-config.php’);     include_once(‘../../../wp-load.php’);     include_once(‘../../../wp-includes/wp-db.php’);               global $wpdb;          $search_tags = $wpdb->get_results("SELECT name FROM $wpdb->terms");              foreach ($search_tags as $mytag)                 { echo $mytag->name. " "; }               ?>      I have tried everything and searched online for hours but I didn't find a solution on how to call the get-tags.php, it gives me an internal 500 error and the autocomplete doesn't work anymore. thanks


title: Updating from Wordpress 3.5.2 to 3.6 Errors

text: When trying to update from 3.5.2 to 3.6 the following error occurs:               Warning: touch(): Unable to create file /tmp/wordpress-3.tmp because No such file or directory in /home/yaznetx1/public_html/wp-admin/includes/file.php on line 179          Warning: unlink(/tmp/wordpress-3.tmp): Operation not permitted in /home/yaznetx1/public_html/wp-admin/includes/file.php on line 503          Download failed.: Could not open handle for fopen() to /tmp/wordpress-3.tmp          Installation Failed      Anyone know how to fix this?


title: Woocommerce single product image blurred and small. Actual image is big

text: The image in the woocommerce's product page is blurred and unclear. You can see this using the below link. http://childdevelopmentinfo.com/shop/discipline-your-kid-the-right-way- without-shouting-or-spanking/ I tried changing the CSS and regenerated the thumbnails, after changing the image dimensions in catalog settings of woocommerce but this persists. This issue is weird. I think the issue is in product-image.php file of woocommerce which is returning small, thumbnail size image instead of the medium one. Here is the code that returns the image.               $image = get_the_post_thumbnail( $post->ID, apply_filters('single_product_large_thumbnail_size', 'shop_single' ) );     $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) );     $image_link = wp_get_attachment_url( get_post_thumbnail_id() );     $attachment_count   = count( $product->get_gallery_attachment_ids() );      Any idea what is going wrong? Thanks.


title: Warnings On Updating WordPress

text: On every site where I updated Wordpress to version 3.5, two error messages flashed onto the screen, only to be immediately replaced by the Wordpress About page. The messages don't stay on the screen long enough to read, but I managed to hit PrintScreen and read them that way. Note: this has happened with previous updates, but I can't be sure when it started because I may not have noticed the errors before, and the sites all seem to work fine.               Warning: copy(/home/something/wordpress/wp-blog-header.php)      [function.copy]: failed to open stream: Permission denied in      /home/something/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 200          Warning: copy(/home/something/wordpress/index.php)      [function.copy]: failed to open stream: Permission denied in      /home/something/wordpress/wp-admin/includes/class-wp-filesystem-direct.php on line 200      Update: there are really two issues here: first, what are the warnings telling me, are they serious, and can I prevent them from happening? Second, wouldn't it be a good idea to leave the warnings on the screen instead of flashing them up, only to have them disappear into the abyss milliseconds later? I can't help wondering whether more serious warnings/errors might also disappear if/when they occurred. Are these warnings logged anywhere?