Kombination von zwei Wordpress - Themes
lima-city → Forum → Programmiersprachen → PHP, MySQL & .htaccess
alt post
ansicht
array
benutzen
code
container
display
enthalten index
folgende vorschau
http
image
index
jemand
layout
post
problem
standart
vorschau
-
Hallo,
ich stehe vor dem Problem, dass ich mir für ein Wordpress-Theme entschieden habe, welches vom Grunddesign für mich optimal geeignet ist.
Ich möchte allerdings statt der Standart Startseiten-Ansicht folgende Vorschau auf der Startseite haben die ich aus einem anderen Theme habe.
Gewünschtes Vorschau-Layout: http://img163.imageshack.us/img163/2003/1tbt.png
Das ist der Code der Startseite, wie ich sie nicht haben möchte, allerdings im benutzen Theme enthalten (index.php)
<?php /** * Displays the index section of the theme. * * @package Theme Horse * @subpackage Attitude * @since Attitude 1.0 */ ?> <?php get_header(); ?> <?php /** * attitude_before_main_container hook */ do_action( 'attitude_before_main_container' ); ?> <div id="container"> <?php /** * attitude_main_container hook * * HOOKED_FUNCTION_NAME PRIORITY * * attitude_content 10 */ do_action( 'attitude_main_container' ); ?> </div><!-- #container --> <?php /** * attitude_after_main_container hook */ do_action( 'attitude_after_main_container' ); ?> <?php get_footer(); ?>
Index.php des gewünschten Vorschau-Layouts:
<?php get_header(); ?> <div id="load_posts_container"> <?php $category_ID = get_category_id('blog'); $args = array( 'post_type' => 'post', 'posts_per_page' => 12, 'cat' => '-' . $category_ID, 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1) ); query_posts($args); $x = 0; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; if($paged > 1) $y = (0 + (($paged-1) * 12)); else $y = 0; while (have_posts()) : the_post(); ?> <?php if($x == 2) { ?> <div class="home_post_box home_post_box_last" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } else { ?> <div class="home_post_box" onmouseover="show_post_desc(<?php echo $y; ?>)" onmouseout="hide_post_desc(<?php echo $y; ?>)"> <?php } ?> <!--<img src="<?php bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />--> <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post',array('alt' => 'post image', 'class' => 'rounded')); ?></a> <div class="home_post_desc" id="home_post_desc<?php echo $y; ?>"> <?php $temp_arr_content = explode(" ",substr(strip_tags(get_the_content()),0,225)); $temp_arr_content[count($temp_arr_content)-1] = ""; $display_arr_content = implode(" ",$temp_arr_content); echo $display_arr_content . '...'; ?> </div><!--//home_post_desc--> <div class="home_post_title_cont"> <h3><?php the_title(); ?></h3> <h4><?php the_category(', '); ?></h4> </div><!--//home_post_title_cont--> </div><!--//home_post_box--> <?php if($x == 2) { $x = -1; /*echo '<div class="clear"></div>';*/ } ?> <?php $x++; $y++; ?> <?php endwhile; ?> <?php wp_reset_query(); ?> <div class="clear"></div> </div><!--//load_posts_container--> <div class="load_more_cont"> <p align="center"><span class="load_more_text"><?php next_posts_link('<img src="' . get_bloginfo('stylesheet_directory') . '/images/load-more-image.png" />') ?></span></p> </div><!--//load_more_cont--> <script type="text/javascript"> // Ajax-fetching "Load more posts" $('.load_more_cont a').live('click', function(e) { e.preventDefault(); //$(this).addClass('loading').text('Loading...'); //$('.load_more_text a').html('Loading...'); $.ajax({ type: "GET", url: $(this).attr('href') + '#main_container', dataType: "html", success: function(out) { result = $(out).find('#load_posts_container .home_post_box'); nextlink = $(out).find('.load_more_cont a').attr('href'); //alert(nextlink); //$('#boxes').append(result).masonry('appended', result); $('#load_posts_container').append(result); //$('.fetch a').removeClass('loading').text('Load more posts'); //$('.load_more_text a').html('Load More'); if (nextlink != undefined) { $('.load_more_cont a').attr('href', nextlink); } else { $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); // $('.load_more_cont').css('visibilty','hidden'); } if (nextlink != undefined) { $.get(nextlink, function(data) { //alert(nextlink); if($(data + ":contains('home_post_box')") != '') { //alert('not found'); // $('.load_more_cont').remove(); $('#load_posts_container').append('<div class="clear"></div>'); } }); } } }); }); </script> <?php get_footer(); ?>
tpl-blog.php
<?php
/*
Template Name: Blog
*/
?>
<?php get_header(); ?>
<div class="blog_left">
<?php
$args = array(
'category_name' => 'blog',
'post_type' => 'post',
'posts_per_page' => 6,
// 'cat' => '-' . $category_ID,
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1)
);
query_posts($args);
$x = 0;
while (have_posts()) : the_post(); ?>
<?php if($x == 1) { ?>
<div class="blog_box_cont home_blog_box_last">
<div class="home_post_box blog_box home_post_box_last">
<?php } else { ?>
<div class="blog_box_cont">
<div class="home_post_box blog_box">
<?php } ?>
<!--<img src="<?php //bloginfo('stylesheet_directory'); ?>/images/blog-image.jpg" />-->
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('home-post',array('alt' => 'post image', 'class' => 'rounded')); ?></a>
<div class="home_post_title_cont">
<h3><?php the_title(); ?></h3>
</div><!--//home_post_title_cont-->
</div><!--//home_post_box-->
<div class="blog_content">
<?php $temp_arr_content = explode(" ",substr(strip_tags(get_the_content()),0,225)); $temp_arr_content[count($temp_arr_content)-1] = ""; $display_arr_content = implode(" ",$temp_arr_content); echo $display_arr_content . '...'; ?>
</div><!--//blog_content-->
</div><!--//blog_box_cont-->
<?php if($x == 1) { echo '<div class="clear"></div>'; $x = -1; } ?>
<?php $x++; ?>
<?php endwhile; ?>
<div class="clear"></div>
<div class="blog_nav_cont">
<div class="left"><?php previous_posts_link('« Previous') ?></div>
<div class="right"><?php next_posts_link('Next »') ?></div>
<div class="clear"></div>
</div><!--//blog_nav_cont-->
<?php wp_reset_query(); ?>
</div><!--//blog_left-->
<?php get_sidebar(); ?>
<div class="clear"></div>
<?php get_footer(); ?>
Könnte mir jemand erklären wie ich beides zusammenbringe? -
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage