wordpress

WordPress plugin tag not parsing in <script> block

I'm using the following code in one of my WordPress plugin files: else if($filetype == 'swf'){ print <<<EOT <script type="text/javascript" language="javascript"> jQuery(document).ready(function(){ var embed = '<div>[kml_flashembed movie="$img" /]</div>'; jQuery("#header").prepend(jQuery(embed)); }); </script> <style type="text/css"> #$h...

Is it OK to fix a character encoding error using SQL REPLACE?

I have a (Wordpress) blog and some of my older posts have a character encoding problem where £ displays as £ (i.e. a pound sign prepended with a capital 'A' with a hat on). The problem is at the DB level, so I was going to run the following SQL statement: update wp_posts set post_content = replace(post_content, ‘£’, ‘£’); Would thi...

Function name conflict when including a PHP file in a WordPress Theme.

I am a PHP novice, so bear with me if any of my terminology is incorrect. I have a small PHP file (page_class.php) that defines some functions and I include this file in the header.php of my theme: <?php include("page_class.php"); ?> And these are the contents of page_class.php: <?php function curPageURL() { $pageURL = 'http'; if ...

Run php functions on selected Wordpress pages

Hi, I am trying to customise a Wordpress theme. I have a function in themes/functions.php that I would like to run on some pages. I need to be to: Detect the page ID to determine whether the function should execute Determine which hook to attach the function to (preferably something like page load. Cheers ...

jQuery Ajax pageload <div> puzzle

Still learning this jQuery stuff.... I like this ajax page loader; it works for Wordpress on a <div id="content"> right out of the box. But one thing bothers me: the collapses while ajax loads the page and spins the spinner, and I'd like to be able to have the div retain some of it's size instead of making the footer of the page jump u...

How to check response from merchant in Wordpress eCommerce

I am writing a payment gateway for WP eCommerce (http://www.instinct.co.nz/e-commerce/) The merchant requires the user to be redirected to the merchants website (similar to paypal express I believe). Once the user has completed the transaction (successfully or not) they are redirected back to the transaction results page of WP eCommerce ...

Wordpress inline label (jQuery)

I'm building my new theme and I've a problem. I use jQuey to display the input's label into the input : this.label2value = function(){ var inactive = "inactive"; var active = "active"; var focused = "focused"; $("label").each(function(){ obj = document.getElementById($(this).attr("for")); if(($(obj).attr("...

Add Comment and Reaction Count in Wordpress with Disqus plugin

Okay I'm trying to add comments and reactions count just like what you would normally see on some wordpress blogs like http://johntwang.com/blog/ where on the left top of each post there is ** comment and * reactions* My problem is I can't find the disqus's documentation, where hopefully there is some method I can call to return me t...

Getting dead.letter... Saved message in /home/content... after sending message in a form

I am using a wordpress plugin that sets up a basic contact form on a website. After filling in the fields and submitting, I get the dead letter message. I have read what a dead letter is, but I don't understand why I am getting the message. The email is actually sent to the recipient, but he does not like this error showing up and scarin...

Rewrite To WordPress Page

I have an existing page of /programs/kids.php that I want to load a category page from WP. I want the .htaccess file in /programs to handle this rewriting for me. Something along the lines of: RewriteEngine on ReWrite kids2.php http://www.mysite.com/blog/cat/kids/ Any help would be awesome. ...

How to make a clickable header in wordpress?

How do you make a Wordpress header image clickable so that it navigates to the the home page. Here is my header.php file: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile...

Good tools for analyzing VPS performance (VPS running WordPress blogs?

What are tools you would recommend for analyzing VPS performance. Specifically I run several Wordpress blogs on a VPS and would like to find some tools to help me find issues worth looking into (so I can address them). I use New Relic for getting some data on where to focus some attention on our rails applications and find it very usef...

Wordpress loop > unique loop renders slightly wrong results...

A few things to understand before my question will make sense: I use a hidden category called 'Unique' to specify if the post will use the single.php or a special one used for the unique ones. I want the index to act as a single: showing only one post, displaying next/prev post links, and comments also. I need the index.php to say if t...

Wordpress Upgrade Problem

Upgraded fine from 2.8 to 2.9, but now get this error when I view the url: Fatal error: Call to undefined method Redirection::_weak_escape() in /var/www/html/wordpress/wp-includes/wp-db.php on line 515 I can't even login to Dashboard to remove plugins or anything, only via FTP can I work on this. Any help would be appreciated :) ...

Adding custom class to every widgets in wordpress, what's your approach?

Hi, I'm creating a theme for wordpress and I am having problem implementing image replacement on headers on my widgets. How do you I add a custom class or id to wrap my widgets? for example HTML: <div id="sidebar"> <div id="customWidgetId"> <h2>This Title will be replace by an Image</h2> <p>Wordpress 'Text' Widget cont...

Wordpress - image.php - if no image redirect to home

hello, i use a script for my image.php.. the url with an image looks like this: /image.php?title=Alyssa Milano Unicef&description=Alyssa Milano Unicef&url=uploads/2009/12/alyssa_milano_unicef_05.jpg But if someone types directly www.site.com/image.php it shows a blank site.. a redirection would be nice, to the 404page or startpage.. ...

''' character shows up as "\'" in php output.

I am working on a post type form. The site is wordpress based. While testing the form, I noticed that everytime I use the ''' character, when the post is posted, it prints out "\'" instead. For example: Input: "Bob's birthday plans." Output: "Bob\'s birthday plans." How do I stop php or wordpress, whichever is responisble, from doi...

Wordpress selecting wrong DB

I have a Wordpress site that uses two databases -- one section queries one database ("database_A"), and then Wordpress makes its connection to its own database ("database_B"). Everything it working well until I go to call this function: $pageposts = $wpdb->get_results($querystr, OBJECT); The Wordpress suddenly selects the wrong datab...

Ways to include a scraped table into another page

Hi, I've coded a PHP script that scrapes a publicly available data table. The data changes every 5 min. My script whenever called will scrape the data using htmlsimpledom and returns me the table in HTML table format. I now want to include this result returned by the script into a wordpress page, so that every time I visit the WP page, ...

Download page template for Wordpress

I'm using Wordpress primarily to host some downloads (icons, to be exact) and I'm wondering if anyone's ever come across a page template for exactly that. Ideally I'd like a grid page where I can easily add and remove downloads to programatically (if possible). I'd like to use jQuery for the visuals. A Google query of "download page tem...