Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] proglem z linkami..
Forum PHP.pl > Forum > Przedszkole
luzzak24
<?php
if(get_theme_option('featured_posts') != '') {
?>
<script type="text/javascript">
function startGallery() {
var myGallery = new gallery($('myGallery'), {
timed: true,
delay: 6000,
slideInfoZoneOpacity: 0.8,
showCarousel: false
});
}
window.addEvent('domready', startGallery);
</script>
<div class="fullbox_excerpt">
<div class="fullbox_content">
<div class="smooth_gallery">
<div id="myGallery">


<?php
$featured_posts_category = get_theme_option('featured_posts_category');

if($featured_posts_category != '' && $featured_posts_category != '0') {
global $post;

$featured_posts = get_posts("numberposts=5&&category=$featured_posts_category");
$i = 0;
foreach($featured_posts as $post) {
setup_postdata($post);
if ( version_compare( $wp_version, '2.9', '>=' ) ) {
$slide_image_full = get_the_post_thumbnail($post->ID,'large', array('class' => 'full'));
$slide_image_thumbnail = get_the_post_thumbnail($post->ID,'large', array('class' => 'thumbnail'));
} else {
$get_slide_image = get_post_meta($post->ID, 'featured', true);
$slide_image_full = "<img src=\"$get_slide_image\" class=\"full\" alt=\"\" />";
$slide_image_thumbnail = "<img src=\"$get_slide_image\" class=\"thumbnail\" alt=\"\" />";
}

?>
<div class="imageElement">
<h3><?php the_title(); ?></h3>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="open"></a>
<?php echo $slide_image_full; ?>
<?php echo $slide_image_thumbnail; ?>
</div>
<?php }
} else {
for($i = 1; $i <=5; $i++) {
?>
<div class="imageElement">
<h3>To jest nowy post na forum <?php echo $i; ?> title</h3>
<p>To jest nowy post, kliknij w zdjęcie, aby przejśc dalej</p>
<a href="http://www.google.pl" title="Nowy post na forum <?php echo $i; ?>" class="open"></a>

<img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="full" alt="" />
<img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="thumbnail" alt="" />
</div>
<?php
}
}

?>
</div>
</div>
</div>
</div>
<?php } ?>



To jest kod. A mój problem jest następujący: Chciałem, żeby każde zdjęcie przenosiło do innego linku.. jak przerobic podany kod..? Skończyly mi się juz pomysły, wiec prosze o pomoc... 1,2,3,4,5 to są nazwy zdjęc..
IceManSpy
Co chcesz i gdzie przenosić? Sprecyzuj problem. I dawaj kod w znaczniki!
luzzak24
  1. <?php
  2. if(get_theme_option('featured_posts') != '') {
  3. ?>
  4. <script type="text/javascript">
  5. function startGallery() {
  6. var myGallery = new gallery($('myGallery'), {
  7. timed: true,
  8. delay: 6000,
  9. slideInfoZoneOpacity: 0.8,
  10. showCarousel: false
  11. });
  12. }
  13. window.addEvent('domready', startGallery);
  14. </script>
  15. <div class="fullbox_excerpt">
  16. <div class="fullbox_content">
  17. <div class="smooth_gallery">
  18. <div id="myGallery">
  19.  
  20.  
  21. <?php
  22. $featured_posts_category = get_theme_option('featured_posts_category');
  23.  
  24. if($featured_posts_category != '' && $featured_posts_category != '0') {
  25. global $post;
  26.  
  27. $featured_posts = get_posts("numberposts=5&&category=$featured_posts_category");
  28. $i = 0;
  29. foreach($featured_posts as $post) {
  30. setup_postdata($post);
  31. if ( version_compare( $wp_version, '2.9', '>=' ) ) {
  32. $slide_image_full = get_the_post_thumbnail($post->ID,'large', array('class' => 'full'));
  33. $slide_image_thumbnail = get_the_post_thumbnail($post->ID,'large', array('class' => 'thumbnail'));
  34. } else {
  35. $get_slide_image = get_post_meta($post->ID, 'featured', true);
  36. $slide_image_full = "<img src=\"$get_slide_image\" class=\"full\" alt=\"\" />";
  37. $slide_image_thumbnail = "<img src=\"$get_slide_image\" class=\"thumbnail\" alt=\"\" />";
  38. }
  39.  
  40. ?>
  41. <div class="imageElement">
  42. <h3><?php the_title(); ?></h3>
  43. <?php the_excerpt(); ?>
  44. <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="open"></a>
  45. <?php echo $slide_image_full; ?>
  46. <?php echo $slide_image_thumbnail; ?>
  47. </div>
  48. <?php }
  49. } else {
  50. for($i = 1; $i <=5; $i++) {
  51. ?>
  52. <div class="imageElement">
  53. <h3>To jest nowy post na forum <?php echo $i; ?> title</h3>
  54. <p>To jest nowy post, kliknij w zdjęcie, aby przejśc dalej</p>
  55. <a href="http://www.google.pl" title="Nowy post na forum <?php echo $i; ?>" class="open"></a>
  56.  
  57. <img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="full" alt="" />
  58. <img src="<?php bloginfo('template_directory'); ?>/jdgallery/slides/<?php echo $i; ?>.jpg" class="thumbnail" alt="" />
  59. </div>
  60. <?php
  61. }
  62. }
  63.  
  64. ?>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <?php } ?>



Chodzi mi o to, aby każde zdjęcie prowadziło gdzie indziej. Teraz wszystkie prowadzą do strony google.pl, a ja chce, zeby prowadziły do różnych stron
  1. <div class="imageElement">
  2. <h3>To jest nowy post na forum <?php echo $i; ?> title</h3>
  3. <p>To jest nowy post, kliknij w zdjęcie, aby przejśc dalej</p>
  4. <a href="http://www.google.pl" title="Nowy post na forum <?php echo $i; ?>" class="open"></a>

Są to zdjęcia prowadzące do jednego adresu, a ja chce zeby każde prowadziło do innego adresu. Nie wiem jak to inaczek wytłumaczyc..
IceManSpy
Ostatnia linijka:
  1. <a href="http://www.google.pl" title="Nowy post na forum <?php echo $i; ?>" class="open"></a>


Tutaj musisz zmieniać linki na jakie chcesz.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.