how to add a logo on custom wordpress theme [closed] - php

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm building a WordPress theme from scratch at the moment and I seem to be stuck on trying to add a logo to the top left corner of the page where you would normally see the title of the page.
<h1>
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a
</h1>
<div class="site-description">
<h3>
<?php echo html_entity_decode(get_bloginfo('description')); ?>
</h3>
</div>`
So instead of the h1 tag there, I would like an image that will allow the user to return to the homepage. Also would I need to save the image in a specific folder ?
Please help and thank you in advance !

try this
<img src="<?php bloginfo('template_directory'); ?>/images/logo.jpg" />
<div class="site-description">
<h3>
<?php echo html_entity_decode(get_bloginfo('description')); ?>
</h3>
</div>
assuming that image is in the images folder of template directory with file name logo.jpg

Use
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?>
<img src="image.jpg" width="32" height="32">
</a>
instead of
<h1>
<a href="<?php echo home_url(); ?>"><?php bloginfo('name'); ?></a
</h1>
Working well for me
See the image http://i.stack.imgur.com/Vs23W.jpg

Related

How can I replace html elements with php? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a website in which I use just html, but I'd like to add one location where I would edit things like the nav and the footer. Then it would be instantly updated across the whole site.
So, for example, I'd like to put:
<nav>
<div class="nav-wrapper">
Logo
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>Sass</li>
<li>Components</li>
<li>JavaScript</li>
</ul>
</div>
</nav>
Into
<?php echo $nav;?>
Any help would be greatly appreciated! =)
Add the html that you want to show into a file. For eg:
add this to menu.html
<nav>
<div class="nav-wrapper">
Logo
<ul id="nav-mobile" class="right hide-on-med-and-down">
<li>Sass</li>
<li>Components</li>
<li>JavaScript</li>
</ul>
</div>
</nav>
Now include this page in other HTML pages wherever you want to call it like below
<?php
include 'menu.html';
?>
I like Lal's answer. I would change include 'menu.html'; with include_once 'menu.php'; The idea is that you will can add some php variables if you need them on some point.....

Working with Iframes and PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have several questions about php content in Iframe.
I want to create some navigation links and target the Iframe. Is there an easy way to do?
Do you think I can only do this with Ajax or Ahah ?
This is what I ve tried so far, but it does not work.
Here is my code.
// HERE ARE NAVIGATION LINKS
<header>
<h1>Välkommen till Min Sida</h1><br>
<nav>
HOME
ABOUT ME
CONTACT
SUBSCRIBE
</nav>
</header>
// HERE IS MY IFRAME WHERE I WANT TO OPEN MY PHP FILES
<div class='content' >
<iframe>
<?php
$go = #$_GET["go"];
switch($go){
// IF I CLICK ON "WELCOME" FROM THE NAVIGATION BAR, OPEN THIS LINK IN My IFRAME
case "welcome";
include("welcome.php");
break;
// IF I CLICK ON "ABOUT" FROM THE NAVIGATION BAR, THIS LINK IN MY IFRAME
case "about";
include("newarrivals.php");
break;
// AS "DEFAULT", SHOW THIS IN THE IFRAME
default;
echo
<figure>
<img src="figure.png" alt="Figure 1" style="max-width:80%; height:auto;">
<figcaption> <h6> Illustration: Mehmet Akb. </h6> </figcaption>
</figure>
break;
}
?>
</iframe>
</div>
</div>
</body>
You can use javascript to reload iframe
Move your iframe content to icontent.php
Add some ID into iframe <iframe id="contentFrame"></iframe>
Change your link action
HOME
ABOUT ME
CONTACT
SUBSCRIBE
Create this javascript function
function goto(url) {
document.getElementById("contentFrame").contentWindow.location.replace(url);
}
If your Iframe has a name, you can use target property to determine the iframe name such as
<iframe name="topframe"></iframe>
<a href="xxx" target="topframe">

Users cant see image on index in Wordpress [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Friends,on the index page there is image for each tittle but these are not show.
this is web site : www.manisaihtiyac.com
I think there is a problem right this code :
<div class="yef_resim">
<a href="<?php the_permalink(); ?>">
<img src="<?php echo get_post_meta($post->ID, 'logo', true); ?>" border="0" />
</a>
</div>
Nothing is being returned by your function get_post_meta:
<a href="http://www.manisaihtiyac.com/?p=35">
<img src="" border="0">
...

PHP images not displaying. Works in HTML [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
So I'm building a website and I'm attempting to reuse code for a scrolling photo banner.
I can mock-up everything pretty well within a strict html page. So I decided to move everything over to PHP to help make things more efficient and with the intent of eventually using MySQL in other content on the site. However, after I created my functions and began to plug everything in the photo banner disappeared. Everything else including the CSS displays beautifully. I went so far as to remove the CSS from the page to see if that was the problem. Unfortunately the images still refuse to show up. It was a direct copy->paste from the working HTML document so I'm not totally sure why the photos for the banner aren't appearing. Any advice or help would be great. Here's the code:
<html>
<style>
#import "honeysstyle.css";
</style>
<div id="container">
<div class="photobanner">
<img class="first" src="C:\wamp\www\Honeys Project\honeys\Image1.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image2.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image3.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image4.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image5.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image1.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image2.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image3.jpg" alt="">
<img src="C:\wamp\www\Honeys Project\honeys\Image4.jpg" alt="">
</div>
</div>
<?php
require( 'function.php' );
draw_titlebar();
draw_navigation();
?>
</html>
image path should be like this
<img src="http://localhost/Honeys Project/honeys/Image2.jpg" alt="">
change
<img class="first" src="C:\wamp\www\Honeys Project\honeys\Image1.jpg" alt="">
to
<img class="first" src="honeys/Image1.jpg" alt="">

fatal error in my free web hosting site? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Fatal error: Call to undefined function get_header() in /home/a2260510/public_html/index.php on line 1
error code in below
When I refresh the browser then i see the error.
<?php get_header(); ?>
<div class="fix main_body_area ">
<div class="fix main_feature floatleft">
<div class="fix heading_area">
<div class=" heading floatleft">
<h4><img src="<?php echo get_template_directory_uri();?>/images/post_red_img.png"><div class="head_pan">Gruesome video shows Syria brutality</div></h4>
</div>
<div class=" heading_2 floatright">
<h4><img src="<?php echo get_template_directory_uri();?>/images/gray.png" alt="gray"><div class="fix head_span"><p><marquee>As crackdowns against anti-government protesters continue acrosss</marquee></p></div></h4>enter code here
</div>
</div>
<?php get_template_part('slider');?>
<div class="fix feature_area_images">
<?php get_template_part('image_widgets');?>
</div>
<div class="fix news_post_area">
<div class="fix head_news">
<?php get_template_part('post_loop');?>
</div>
</div>
<?php get_template_part('sidebar');?>
</div>
<?php get_footer();?>
</div>
You're using a wordpress theme as a standalone web app.
What you have to do is:
Go to http://wordpress.org/download/ and download the last version.
Upload the contents of the wordpress zip downloaded in your public_html folder.
Now you can put yout files (the ones showing the fatal error) in the wp-contents/themes folder.
Go to your site url, and install wordpress (help in here: http://codex.wordpress.org/Installing_WordPress)
It should work.

Categories