Conditionally loading Facebook PHP SDK in shortcode

You can try to use the_posts filter to search for you shortcode and require the sdk, something like this: function has_my_FB_shortcode($posts) { if ( empty($posts) ) return $posts; $found = false; foreach ($posts as $post) { if ( stripos($post->post_content, ‘[my_shortcode’) ){ $found = true; break; } } if ($found) require(‘path/to/facebook_sdk.php’); return $posts; } add_action(‘the_posts’, ‘has_my_FB_shortcode’);

Mysterious HTTP 404 header in my own scripts

It turns out that it’s the require(‘../wp-blog-header.php’); part who caused the HTTP 404 error. I replaced the header code with: status_header(200); nocache_headers(); Both are part of WordPress API. And the problem went away. I found this solution from: http://wordpress.org/support/topic/integrating-wp-in-external-php-pages?replies=22

Downloading File from Outside Web Root

What you have there is production ready. However, there is room for some minor improvements, so I will point those out for you. Also see my notes below regarding X-Sendfile and X-Accel-Redirect. Replace these lines: ob_clean(); flush(); with the following: while (@ob_end_clean()); The point is, if there is something already in the output buffer, you … Read more

Editing Header Titles of each details in woocommerce Order Email [closed]

To change the heading that appears in the body (message) of the email template you can use the following filter: ‘woocommerce_email_heading_’ . $this->id where $this->id equates to the id class property that is set within the email class of the specified type. For example, to change the heading of the “New Order” email you would … Read more

Auto-refresh page every minute?

you can add <meta http-equiv=”refresh” content=”60″> to your header.php file in wordpress theme. EDIT: I removed the last bit of code and just made a plugin with read me file and the functions you would want. You can download the plugin from here WP Auto Refresh Plugin and install it from the beck-end. Note i … Read more

Editing page content through FTP?

If the content is dynamically written, you won’t be able to change this through ftp. At the template files the content is called by typing <?php the_content(); ?>(or the_content(); ) if already scripting in php. You need to get his WordPress login information to log in to his website, over there you can see pages, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)