Pregunta

i have a file i am including across site to index.php, single.php etc.

This file behaves really strage and acts like it not part of
wordpress Enviroment meaning:

i get errors on get_bloginfo('template_url') and it won't
get the values from my options page.

Any idea what this might happen?

Here is the include code i have in my index.php (somewhere mid page):

<?php include(get_bloginfo('template_url') .'/extras/floater.php'); ?>

(it includes the file so problem aint there)

Here is the actuall "floater.php" code... :

<?php
    function establishParms() {
    // get yes/no values and urls..
    $facebook = get_option('sg_show_facebookfloater');
    $twitter = get_option('sg_show_twitterfloater');
    $mail = get_option('sg_show_mailfloater');

        // facabook
        if($facebook == "Yes") {
            $facebook = '<li><a href="'. get_option('sg_url_facebookfloater') .'"><img src="'. get_bloginfo('template_url') .'/images/facebook.png" alt="'.__('Visit us on Facebook', 'sagive').'" /></a></li>';
        } 

        // twitter
        if($twitter == "Yes") {
            $twitter = '<li><a href="'. get_option('sg_url_twitterfloater') .'"><img src="'. get_bloginfo('template_url') .'/images/twitter.png" alt="'.__('Visit us on Twitter', 'sagive').'" /></a></li>';
        } 

        // mail
        if($mail == "Yes") {
            $mail = '<li><a href="'. get_option('sg_url_mailfloater') .'"><img src="'. get_bloginfo('template_url') .'/images/mail.png" alt="'.__('Contact us', 'sagive').'" /></a></li>';
        } 
    }
?>

<div class="floatingBar" >
    <ul class="gotop">
        <?php echo $facebook; ?>
        <?php echo $twitter; ?>
        <li><a href="#top"><?php echo '<img src="'. get_bloginfo('template_url') .'/images/mail.png" alt="" />'; ?></a></li>                                    
        <li><a href="#top"><?php echo '<img src="'. get_bloginfo('template_url') .'/images/up.png" alt="" />'; ?></a></li>
    </ul>
</div>  

.
Nothing Special there also so.. i am left with no answer to think of.

Also... had a nother weird problem with this site (which works great on localhost)
i have a function that did a simple thing inside function.php file:

function setPaths() {
    $templateUrl = get_bloginfo('template_url');
    $imagesUrl = get_bloginfo('template_url')."/images/";
}

But when trying to use $templateUrl in index.php file it gave me nothing..

Would love for your help :)
Cheers, Sagive

REVISION:

Here is an example of an error i got:

Fatal error: Call to undefined function get_bloginfo() in /home/workspac/public_html/sagive/wp-content/themes/sagive-spaceJunkie/extras/floater.php on line 29

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
scroll top