Call to undefined function issue

I know there are other, maybe better ways to do what I want to achieve, but I have to use this solution. I have two stylesheets: style.css – normal stylesheet style-dynamic.php – dynamic stylesheet linked to the first one I’m using some PHP code in the second one, like: #body { background-color: <?php echo get_option(‘theme_background’); … Read more

sidebar isn’t showing, what’s wrong w/ this code?

Here’s what I have in my sidebar.php: <aside id=”sidebar”> <?php if ( is_user_logged_in() ) { echo ‘<a href=””><img id=”visit-the-forums” src=”‘. bloginfo(‘template_url’) . ‘/images/visit-the-forums.png” alt=”Check out the Forums!” /></a>’ } else { echo ‘<a href=””><img id=”join-the-forums” src=”‘. bloginfo(‘template_url’) . ‘/images/join-the-forums.png” alt=”Join the Forums!” /></a>’ } ?> <a id=”side-ad”> <img src=”<?php bloginfo(‘template_url’) ?>/images/ipad-ad.png” alt=”iPad 2 Giveaway!” /> … Read more

PHP $_SERVER[‘HTTP_HOST’] vs. $_SERVER[‘SERVER_NAME’], am I understanding the man pages correctly?

I did a lot of searching and also read the PHP $_SERVER docs. Do I have this right regarding which to use for my PHP scripts for simple link definitions used throughout my site? $_SERVER[‘SERVER_NAME’] is based on your web server’s config file (Apache2 in my case), and varies depending on a few directives: (1) … Read more

Loop through posts of a custom-post-type (event) and create .ics (iCal) file?

I really need your help with a feature I have never worked with so far. I have a custom-post-type named wr_event. And I created this custom WP_Query to retrieve all posts for this post-type that are “younger” than yesterday. Fairly simple and this works like a charm. function event_list_iCal() { $yesterday = time() – 24*60*60; … Read more

What are the disadvantages of using persistent connection in PDO

In PDO, a connection can be made persistent using the PDO::ATTR_PERSISTENT attribute. According to the php manual – Persistent connections are not closed at the end of the script, but are cached and re-used when another script requests a connection using the same credentials. The persistent connection cache allows you to avoid the overhead of … Read more