I moved my wordpress to an other server and kept the same address. But the code:
<link rel="stylesheet" type='text/css' href="<?php autoVer(get_bloginfo('template_directory'). '/assets/css/module.footer.css'); ?>">
does not seem to call template_directory. How do I fix it?
Thanks a lot!
Valerie
Currently instead of using something like
<script> src="<?php template_directory ('/js/name_of_script.js') ?></script>
I know the above is not the correct php but I cant remember what I tried via the forums but it didnt work anyways so I tried to use the full url to those files in the header.php. Only for it to still not work
So in a nutshell: Why isnt my Javascript and Jquery working for the animation I want to use in the nav menu (simple fade on image on mouse hover, etc.) & how will I effectively tell wordpress to get the Template url /js/my-scripts.js?
Hoping someone with some knowledge with theme development and a little Jquery background can help me troubleshoot this to get it to work like it does in my static mockup.
]]>$shortname = "nt";
array( "name" => "Logo",
"desc" => "Custom Logo",
"id" => $shortname."_custom_logo",
"type" => "text",
"std" => "<?php bloginfo('template_directory'); ?>/images/green/logo.png"),
And this is how I call it this way:
<div id="header">
<a href="<? bloginfo('url') ?>"><img src="<? echo get_option('nt_custom_logo'); ?>" /></a>
</div>
But it doesn’t works. It give me this:
<div id="header">
<a href="https://andorkh.com/lifeline"><img src="" /></a>
</div>
Any idea or suggestions what could be the problem or what I’m making wrong?
]]>Here’s the code in my template, which asks for the script in the template directory in the folder “scripts”, then looks for the image in the custom field, “thumb”, of a post:
<img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo get_post_meta($post->ID, "thumb", $single = true); ?>&h=150&w=150&zc=1" alt="<?php the_title(); ?>" width="150" height="150"/>
Here is the source code of the results (My URL is replaced with [MYSITE] )…
<img src="https://[MYSITE]/wp-content/themes/twentyeleven/scripts/timthumb.php?src=https://[MYSITE]/wp-content/uploads/2012/04/10003.jpg&h=150&w=150&zc=1" alt="Fifth Test Post – 10003" width="150" height="150"/>
You can see here that my code result is that it’s looking for the “scripts” folder in TwentyEleven. It’ll never find it. There is no “scripts” folder in TwentyEleven. I have the timthumb “scripts” folder in my child theme folder.
So why would ‘template_directory’ bring a result of “twentyeleven” when my site is using a child theme? Is this a timthumb error?
]]>I’ve set the base directory URL to all my JS.images files in my site using
<script type="text/javascript">
template_directory = "<?php echo bloginfo('template_directory');?>";
</script>
Which does work – however I’ve noticed that now, after adding this ocde, my menu links aren’t working. I can click on them BUT the browser does not navigate to the page.
I’ve removed the CSS file to see if it’s an issue related to that, but it’s definitely this script that I’ve added.
Has anyone encountered this before?
]]>Bit of a weird one – I have a php loop that spits out an image path from a database. I know I have to use bloginfo(“template_directory”) to display the image but I’m not sure how to exactly using my echo function. I need to some how combine that template directory php and the $row php…
The code I have is:
echo ‘<img src=”‘ . bloginfo(“template_directory”) . $row[‘itemimage’] . ‘”/>’;
But it of course displays that directory as a string. Any other way I configure it just creates an error.
Can anyone help me out at all? Thanks!
]]>I was setting up few variables, relative to the path of php and js files, and I realized that I had to use different gergo, for different things. For instance:
$styles_path = get_bloginfo('template_directory') . '/library/styles/';
$theme_path = TEMPLATEPATH . '/library/theme/';
I looked into this forum for an explanation about why sometimes I have to use TEMPLATEPATH and others get_bloginfo(‘template_directory’), but I could not find any posts on the topic.
Does anyone know the difference between the two?
Thanks in advance, ciao!
Carlo
<div class="rss"><a href="<?php bloginfo('rss_url'); ?>" title="Subscribe to <?php bloginfo('title'); ?> by RSS"><img src="<?php get_template_directory_uri(); ?>/images/footer-buttons/button-rss.png" border="0" alt="Subscribe by RSS" /> <abbr>RSS</abbr></a></div>
if I use <?php bloginfo('template_directory'); ?>
instead, it works, the image won’t show using get_template_uri which is what’s recommended.
I’ve built a form (simple one):
<form name="cform" method="post" action="<?php echo bloginfo('template_directory') . '/contact-form.php' ?>">
<fieldset>
<input id="cname" name="cname" type="text" value="Name" />
<input id="cemail" name="cemail" type="text" value="Email" />
<input id="cphone" name="cphone" type="text" value="Phone" />
<textarea id="cmessage" name="cmessage" rows="6" cols="33">Message</textarea>
<button id="submit" type="submit" name="submit">Send</button>
</fieldset>
</form>
PHP I’m using to process the form:
<?php
if(isset($_POST['submit'])) {
$to = "[email protected]";
$subject = "Capital Care Contact Form";
$name_input = $_POST['cname'];
$email_input = $_POST['cemail'];
$phone_input = $_POST['cphone'];
$message = $_POST['cmessage'];
$body = "From: $name_input\n E-Mail: $email_input\n Phone: $phone_input\n Message:\n $message";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
I don’t know why but when I submit a test form I get a 404 the page cannot be found error.
Any ideas why WordPress thinks the file is missing?
Thanks.
]]>bloginfo('template_directory'); /images
with edit_post_link();
, but I’m not sure where to start, because I have to use a function as an argument?
]]>