Skocz do zawartości
Hosting webh.pl - 20%

Wordpress - nie wyświetla obrazków z wpisu na stronie głównej

Rekomendowane odpowiedzi

Opublikowano

Hej ! Piszę z ogromną prośbą o pomoc - siedzę nad tym już od wczorajszego wieczoru - całą noc i dalej nie mogę dać sobie z tym rady.

 

Nie wyświetlają mi się obrazki z wpisu - na głównej stronie. 

 

We wpisie - są: http://association.community.vel.pl/wordpress/?p=52

 

 

Na głównej - brak: http://association.community.vel.pl/wordpress/

 

 

skin oczywiście w budowie - będzie ogromnie wdzięczny za pomoc 

 

 

 

kod index.php

<?php get_header();  ?>



<div id="column1">

	<?php if (have_posts()) : ?>

	<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=".get_theme_mod('home_cat')."&paged=$page"); while ( have_posts() ) : the_post() ?>

		<div class="post">
			
			<div id="post-<?php the_ID(); ?>" class="postbox">
				
	            
	            	
			

        	<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
					
		    	


			<div class="post-date">
		    		<em><?php _e('Posted by', 'themejunkie'); ?> <?php the_author_posts_link(); ?> <?php _e('on', 'themejunkie'); ?> <?php the_time('F j, Y'); ?></em>
		    	</div> <!--end .post-date-->
	


	            <div class="post-content">
					 <?php tj_content_limit(240); ?>	
	            </div> <!--end .post-content-->
	           

 
	            <div class="clear"></div>
	                
			</div> <!--end .postbox-->
				
			<div class="post-bottom">
				
				
						
<div class="postbox-more">
			<h3><a href="<?php the_permalink() ?>"   <?php the_title_attribute(); ?>">   <?php _e('Więcej', 'themejunkie'); ?></a><h3>
</div> <!--end .postbox-more-->				




		<div class="small-comment-cloud">
					<?php comments_popup_link('0', '1', '%', 'comments-link', '');?> 
				</div> <!--end .small-comment-cloud-->




					 	
				 <div class="clear"></div>
				 
			</div> <!--end .post-bottom-->
				
			<div class="clear"></div>	
			
		</div> <!--end .post-->

	<?php endwhile; ?>
		
		<div class="clear"></div>

		<div class="pagination">
		    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
		    <div class="left"><?php previous_posts_link(__('Newer Entries', 'themejunkie')) ?></div>
		    <div class="right"><?php next_posts_link(__('Older Entries', 'themejunkie')) ?></div>
		    <div class="clear"></div>
		    <?php } ?> 
		</div> <!--end .pagination-->	

	<?php else : ?>

	<?php endif; ?>
	
</div> <!--end #column1-->

<?php get_sidebar(); ?>

<?php get_footer(); ?>

 

kod z funkcji 

<?php





include("includes/theme-options.php");


// Uncomment this to test your localization, make sure to enter the right language code.
// function test_localization( $locale ) {
// 	return "nl_NL";
// }
// add_filter('locale','test_localization');

load_theme_textdomain('themejunkie', TEMPLATEPATH.'/languages/');

// General Widgets
if (function_exists('register_sidebar'))
{
    register_sidebar(array(
		'name'			=> 'Sidebar',
        'before_widget'	=> '',
        'after_widget'	=> '<div class="clear"></div></div></div>',
		'before_title'	=> '<div class="widget"><h3>',
		'after_title'	=> '</h3><div class="widgetbox">',
    ));	
    
    register_sidebar(array(
    	'name'			=> 'Footer Widget #1',
        'before_widget'	=> '',
        'after_widget'	=> '<div class="clear"></div></div></div>',
    	'before_title'	=> '<div class="footerwidget"><h3>',
    	'after_title'	=> '</h3><div class="widgetbox">',
    ));	
    
    register_sidebar(array(
    	'name'			=> 'Footer Widget #2',
        'before_widget'	=> '',
        'after_widget'	=> '<div class="clear"></div></div></div>',
    	'before_title'	=> '<div class="footerwidget"><h3>',
    	'after_title'	=> '</h3><div class="widgetbox">',
    ));	
    
    register_sidebar(array(
    	'name'			=> 'Footer Widget #3',
        'before_widget'	=> '',
        'after_widget'	=> '<div class="clear"></div></div></div>',
    	'before_title'	=> '<div class="footerwidget"><h3>',
    	'after_title'	=> '</h3><div class="widgetbox">',
    ));	
    
    register_sidebar(array(
    	'name'			=> 'Footer Widget #4',
        'before_widget'	=> '',
        'after_widget'	=> '<div class="clear"></div></div></div>',
    	'before_title'	=> '<div class="footerwidget"><h3>',
    	'after_title'	=> '</h3><div class="widgetbox">',
    ));	
}



# Content Excerpts
function tj_content_limit($max_char, $more_link_text = '', $stripteaser = 0, $more_file = '') {
    $content = get_the_content($more_link_text, $stripteaser, $more_file);
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    $content = strip_tags($content);

   if (strlen($_GET['p']) > 0) {
      echo "";
      echo $content;
      echo "...";
   }
   else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
        $content = substr($content, 0, $espacio);
        $content = $content;
        echo "";
        echo $content;
        echo "...";
   }
   else {
      echo "";
      echo $content;
   }
}




// Turn a category ID to a Name
function cat_id_to_name($id) {
	foreach((array)(get_categories()) as $category) {
    	if ($id == $category->cat_ID) { return $category->cat_name; break; }
	}
}

// Get Image Attachments
function tj_get_image($postid=0, $size='full') {
	if ($postid<1) 
	$postid = get_the_ID();
	$thumb = get_post_meta($postid, "thumb", TRUE); // Declare the custom field for the image
	if ($thumb != null or $thumb != '') {
		echo $thumb; 
	}
	elseif ($images = get_children(array(
		'post_parent' => $postid,
		'post_type' => 'attachment',
		'numberposts' => '1',
		'post_mime_type' => 'image', )))
		foreach($images as $image) {
			$thumbnail=wp_get_attachment_image_src($image->ID, $size);
			?>
	<?php echo $thumbnail[0]; ?>
	<?php }
		else {
		echo get_bloginfo ( 'stylesheet_directory' );
		echo '/images/image-pending.gif';
	}
}

// Show Post Thumbnails
function tj_show_thumb($width = 100, $height = 100) {
?>
<a href="<?php the_permalink() ?>" rel="bookmark"><img class="thumb" src="<?php bloginfo('template_directory'); ?>/includes/timthumb.php?src=<?php tj_get_image($post->ID, 'full'); ?>&h=<?php echo get_theme_mod($height); ?>&w=<?php echo get_theme_mod($width); ?>&zc=1" alt="<?php the_title(); ?>" /></a>
<?php
}

// Tabber: Get Most Popular Posts
function tj_tabs_popular( $posts = 5, $size = 35 ) {
	$popular = new WP_Query('orderby=comment_count&posts_per_page='.$posts);
	while ($popular->have_posts()) : $popular->the_post();
?>
<li>
 	<?php tj_show_thumb($size, $size); ?>
 	<div class="info">
 	<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
 	<span class="meta"><?php comments_popup_link('0 Comment', '1 Comment', '% Comments', 'comments-link', ''); ?></span>
	</div> <!--end .info-->
	<div class="clear"></div>
</li>
<?php endwhile; 
}

function tj_tabs_latest( $posts = 5, $size = 35 ) {
	$the_query = new WP_Query('showposts='. $posts .'&orderby=post_date&order=desc');	
	while ($the_query->have_posts()) : $the_query->the_post(); 
?>
<li>
	<?php if ($size <> 0) ?>
	<?php tj_show_thumb($size, $size);?>
	<div class="info">
	<a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"><?php the_title(); ?></a>
	<span class="meta"><?php the_time('F j, Y'); ?></span>
	</div> <!--end .info-->
	<div class="clear"></div>
</li>
<?php endwhile; 
}




// This theme uses a custom image size for featured images, displayed on "standard" posts.
	add_theme_support( 'post-thumbnails' );
	




// Tabber: Get Recent Comments
function tj_tabs_comments( $posts = 5, $size = 35 ) {
	global $wpdb;
	$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
	comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved,
	comment_type,comment_author_url,
	SUBSTRING(comment_content,1,65) AS com_excerpt
	FROM $wpdb->comments
	LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
	$wpdb->posts.ID)
	WHERE comment_approved = '1' AND comment_type = '' AND
	post_password = ''
	ORDER BY comment_date_gmt DESC LIMIT ".$posts;
	
	$comments = $wpdb->get_results($sql);
	
	foreach ($comments as $comment) {
	?>
	<li>
		<?php echo get_avatar( $comment, $size ); ?>
	
		<a href="<?php echo get_permalink($comment->ID); ?>#comment-<?php echo $comment->comment_ID; ?>" title="<?php _e('on ', 'themejunkie'); ?> <?php echo $comment->post_title; ?>">
			<?php echo strip_tags($comment->comment_author); ?>: <?php echo strip_tags($comment->com_excerpt); ?>...
		</a>
		<div class="clear"></div>
	</li>





	

<?php 
	}
}

?>

Edytowane przez Jakub
Dodano spoilery.

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Szukaj

Szukaj

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.