Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Php - Obrazek na podstronach nie działa
Owneds
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 5.05.2011

Ostrzeżenie: (0%)
-----


Witam serdecznie.
Mam problem, a mianowicie:
Nie wiem jak zrobić stały obrazek w php w szablonie.
Mam taki oto kod:

  1. <?php
  2. /**
  3.  * @package web2feel
  4.  * @since web2feel 1.0
  5.  */
  6. ?>
  7.  
  8. <article id="post-<?php the_ID(); ?>" <?php post_class('mbox'); ?>>
  9.  
  10. <div class="post-image">
  11. <?php
  12. $thumb = get_post_thumbnail_id();
  13. $img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
  14. $image = aq_resize( $img_url, 300, 0, true ); //resize & crop the image
  15.  
  16. ?>
  17.  
  18. <?php if($image) : ?>
  19. <a href="<?php the_permalink(); ?>"><img src="<?php echo $image ?>"/></a>
  20. <?php endif; ?>
  21.  
  22. </div>
  23.  
  24.  
  25. <header class="entry-header">
  26. <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'web2feel' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
  27. </header><!-- .entry-header -->
  28.  
  29.  
  30. <div class="entry-summary">
  31. <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Przeczytaj i pobierz: %s', 'web2feel' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><center><img src="download.png" alt=""/></center></a></h1>
  32.  
  33.  
  34. </div><!-- .entry-summary -->


Głównie chodzi o ten kod:
  1. <div class="entry-summary">
  2. <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Przeczytaj i pobierz: %s', 'web2feel' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><center><img src="download.png" alt=""/></center></a></h1>


Na stronie głównej wszystko jest idealnie, ale jeżeli url mojej strony zmieni się na kolejną podstronę czyli: xxxx.pl/page/2/
to wtedy w źródle strony pojawia się taki kod:
  1. <img src="http://xxxx.pl/page/2/download.png" alt="">


a chciałbym żeby na każdej stronie, wszystko było na stałe, czyli:
  1. <img src="download.png" alt="">


Serdecznie dziękuje za pomoc.

Ten post edytował Owneds 3.01.2014, 13:02:14
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 22:33