Hallo,
Ich benutze das Torch Pro Theme (obwohl das für mein Problem eigentlich unerheblich ist, ich denke jemand mit PHP Kenntnissen wird schon durchsteigen). Und zwar wollte ich gerne bei der Vorschau der Blogeinträge auf meiner Hauptseite die Vorschaubilder jeweils UNTER dem Titel und Devider haben. Habe ein Screen gemacht was verdeutlicht, was ich meine:
http://www.pic-upload.de/view-30130182/…bilder.jpg.html
Ich denke es muss im theme-widget.php entsprechend umgestellt werden, leider habe ich von PHP so gar keine Ahnung und jeder selbstversuch endet in einer weißen Seiten. Ich kopiere mal den Code aus der PHP. Vielleicht kann mir jemand helfen.
/**
* Home page blog widget
*/
class torch_home_blog extends WP_Widget {
function torch_home_blog() {
$widget_ops = array( 'classname' => 'home_widget_blog', 'description' => __( 'Display pages as blog.', 'torch' ) );
$control_ops = array( 'width' => 350, 'height' =>250 );
parent::WP_Widget( false, $name = __( 'Torch: Blog', 'torch' ), $widget_ops, $control_ops);
}
function form( $instance ) {
$instance = wp_parse_args( (array) $instance, array("blog_num"=>"4") );
?>
<p>
<label for="<?php echo $this->get_field_id( 'blog_num' ); ?>"><?php _e('Posts List Num', 'torch'); ?>:</label>
<input id="<?php echo $this->get_field_id( 'blog_num' ); ?>" name="<?php echo $this->get_field_name( 'blog_num' ); ?>" value="<?php echo absint( $instance['blog_num'] ); ?>" class="" />
</p>
<?php
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['blog_num'] = absint( $new_instance['blog_num'] );
return $instance;
}
function widget( $args, $instance ) {
extract( $args );
extract( $instance );
global $post;
$blog_num = (is_numeric($blog_num) && $blog_num>0)?$blog_num:4;
$get_posts = new WP_Query( array(
'posts_per_page' => $blog_num,
'paged' => 1,
'post_type' => array( 'post' )
) );
echo $before_widget;
$j = 0 ;
$css_style = "";
$return = "";
$items = "";
while( $get_posts->have_posts() ):$get_posts->the_post();
$num_comments = get_comments_number();
if ( comments_open() ) {
if ( $num_comments == 0 ) {
$comments = __('No Comments',"torch");
} elseif ( $num_comments > 1 ) {
$comments = $num_comments . __(' Comments',"torch");
} else {
$comments = __('1 Comment',"torch");
}
$write_comments = ''. $comments.'';
} else {
$write_comments = '';
}
$items .= '<div class="col-md-6"><div class="bloglist-box">';
if ( has_post_thumbnail() ) {
$featured_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'blog' );
$items .= '<img src="'.esc_url( $featured_image_url[0]).'" alt="'.get_the_title().'"/>';
} else{
$css_style = "style='margin-left:0;'";
}
$items .= '<div class="bloglist-content" '.$css_style.'>
<div class="entry-header">
<div class="entry-meta">
<div class="entry-date">'.get_the_date("M d, Y").'</div>';
$items .= $write_comments;
$items .= '</div><h1 class="entry-title">'.get_the_title().'</h1>
<div class="entry-title-dec"></div>
</div>
<div class="entry-summary">'.get_the_excerpt().'</div>
<div class="entry-footer">
<div class="entry-more">'.__("Read More","torch").'>></div>
</div>
</div>';
$items .= '</div></div> ';
$j++;
if($j%2 == 0){
$return .= '<div class="row">'.$items.'</div>';
$items = "";
}
endwhile;
if($items != "")
$return .= '<div class="row">'.$items.'</div>';
// $return = '<div class="container">'.$return.'</div>';
echo $return ;
wp_reset_postdata();
echo $after_widget;
}
}
/**************************************************************************************/
Alles anzeigen
Was muss ich hier wo ändern oder muss ich sogar in der Style.css etwas umstellen? Vielen Dank für die Hilfe!