[Plugin: Exec-PHP] Displaying PHP in my header
-
So I want to used the theme Blinky with the plug-in Exec-PHP. The plan is to be able to create posts using information stored on my database.
The plugin works when posting on the page, but for some reason it does not work for display in the header, which is theme-specific. The theme’s website is of no help and the creator is not responding so I’m hoping some wizards here can help me get the header to display my php posts.
To see what I’m talking about, visit my website. As you’ll see the php echo of This is the Exec-PHP ‘Hello World’ shows in the white section of the site but does not display in the blue header section.
The header.php file reads:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title> <link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" /> <?php wp_head();?> <script src="<?php bloginfo('template_url'); ?>/script.js" type="text/javascript"></script> <?php $xDBArr = unserialize(get_option('Slidette_values')); $Slidette_Theme = $xDBArr[0]; $Slidette_Logo = $xDBArr[1]; $Slidette_Slideshow = $xDBArr[2]; $Slidette_Boxes = $xDBArr[3]; $Slidette_Twitter = $xDBArr[4]; $xColor = $Slidette_Theme; if($Slidette_Theme=="") { $Slidette_Theme="xGreen"; } if($Slidette_Slideshow=="") { $Slidette_Slideshow="0"; } if($Slidette_Boxes=="") { $Slidette_Boxes="0"; } $wud = wp_upload_dir(); ?> <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> </head> <body> <div class="<?php echo $Slidette_Theme;?>" id="xMain"> <div class="xHeader"> <div class="xHeaderB"> <div class="xContent"> <div class="xLogo"> <?php if($Slidette_Logo=="") { bloginfo('name'); }else { ?> <img src="<?php echo $Slidette_Logo;?>" alt="" /> <?php } ?> </div> <div class="xDescription"> </div> </div> <div class="xRSS"><a href="<?php bloginfo('rss2_url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/new_rss.png" alt="" /></a></div> <div class="xMenu"> <ul> <li class="clear"><a href="<?php bloginfo('home'); ?>">Home</a></li> <?php wp_list_pages('title_li=');?> </ul> </div> <div class="xSlideshow"> <div class="xSlider"> <div class="xSliderB"> <?php if(have_posts()) { query_posts('showposts=&cat='.$Slidette_Slideshow); ?> <?php while(have_posts()) { the_post(); ?> <div class="xSContent"> <div class="xTitle"><?php the_title(); ?></div> <div class="xText"><?php $xContent = get_the_content(); $xTitle = get_the_title($post->post_title); $xFImage = xGetFirstImage($xContent); $xContent = strip_tags($xContent); $xContent = strip_shortcodes( $xContent ); $xContent = str_replace('[/caption]','',$xContent); if(strlen($xContent)>400) { $xContent = substr($xContent,0,400)."..."; } if($xFImage=="") { $xFImage=get_bloginfo('template_url')."/images/dog.jpg"; } echo $xContent; ?></div> <a href="<?php the_permalink() ?>" class="read"></a> </div> <div class="xSPicture"> <div class="xFeatured"></div> <img src="<?php echo $wud['baseurl']; ?>/timThumb/timthumb.php?w=276&h=223&src=<?php echo $xFImage;?>" alt=""/> </div> <?php } ?> <?php }else { ?> <?php } ?> </div> </div> <div class="xSliderBar"> <a href="#" class="xArrowUp"></a> <a href="#" class="xDotA"></a> <a href="#" class="xDotB"></a> <a href="#" class="xDotC"></a> <a href="#" class="xDotD"></a> <a href="#" class="xDotE"></a> <a href="#" class="xArrowDown"></a> </div> </div> <div class="xTwitter"><a href="http://www.twitter.com/<?php echo $Slidette_Twitter;?>"><img src="<?php bloginfo('template_url'); ?>/images/twitter.png" alt="" /></a></div> </div> </div>The index.php file reads:
<?php get_header(); $xDBArr = unserialize(get_option('Slidette_values')); $Slidette_Boxes = $xDBArr[3]; ?> <div class="xC"> <div class="xLeft"> <?php wp_reset_query(); if(have_posts() && is_home()) { ?> <?php $i=1; query_posts('showposts=4&cat='.$Slidette_Boxes); while(have_posts()) { the_post(); ?> <div class="xBlock<?php if(is_int($i/2)) {echo "B";} ?>"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p><?php $xContent = get_the_content(); $xTitle = get_the_title($post->post_title); $xFImage = xGetFirstImage($xContent); $xContent = strip_tags($xContent); $xContent = strip_shortcodes( $xContent ); $xContent = str_replace('[/caption]','',$xContent); if(strlen($xContent)>190) { $xContent = substr($xContent,0,190); } if($xFImage=="") { $xFImage=get_bloginfo('template_url')."/images/dog.jpg"; } $wud = wp_upload_dir(); ?> <img src="<?php echo $wud['baseurl']; ?>/timThumb/timthumb.php?w=143&h=115&src=<?php echo $xFImage;?>" alt=""/> <?php echo $xContent;?> <a href="<?php the_permalink(); ?>">...Read More</a></p> </div> <?php $i++; } ?> <?php }else { } ?> <div class="xPosts"> <?php wp_reset_query(); if(have_posts()) { ?> <?php while(have_posts()) { the_post(); ?> <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2> <div class="xInfo"> <b>Posted By:</b> <?php the_author(); ?> <b>on</b> <?php the_date() ?> <b>in</b> <?php the_category(', ') ?> - <b>Comments:</b> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> </div> <div class="xContent"> <p><?php the_content('') ?></p> </div> <div class="xReadMore"><a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_url'); ?>/images/readMoreContent.jpg" alt="" /></a></div> <div class="xDel"></div> <?php } ?> <?php }else { ?> <?php } ?> <div class="navigation"> <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div> </div> </div> </div> <div class="xRight"> <?php get_sidebar('right');?> </div> </div> <?php get_footer();?>
The topic ‘[Plugin: Exec-PHP] Displaying PHP in my header’ is closed to new replies.