Forum Moderators: rogerd & travelin cat
[edited by: lorax at 3:20 pm (utc) on Nov 10, 2014]
[edited by: lorax at 11:02 am (utc) on Nov 13, 2014]
[edit reason] no URLs in sig please [/edit]
<?php $the_query = new WP_Query( 'showposts=1' ); ?>
<?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
<br>
<br>
<?php echo substr(strip_tags($post->post_content), 0, 300);?>
<?php endwhile;?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="meta">
Posted on:
<?php the_time('F jS, Y') ?>
by
<?php the_author() ?>
| <span class="postmetadata">
<?php the_tags('Tags: ', ', ', '<br />'); ?>
Posted in
<?php the_category(', ') ?>
|
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
</span></div>
<div class="entry">
<?php
if ( has_post_thumbnail() ) {
// the current post has a thumbnail
} else {
// the current post lacks a thumbnail
}
?>
<?php
/* Display the thumbnail only when available. */
if ( has_post_thumbnail() ) :
?>
<a title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php
/* Remember that we had a conditional check open; close it. */
endif;
?>
<?php the_excerpt('Read more...'); ?>
</div>
</article>
<?php endwhile; ?>
<?php else : ?>
<h2>Not found</h2>
<?php endif; ?> <?php
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 600, 200 );
function custom_excerpt_length( $length ) {
return 43;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function new_excerpt_more( $more ) {
return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">Read more..</a>';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
if (function_exists('register_sidebar')) {
register_sidebar(array(
'name' => 'Sidebar Widgets',
'id' => 'sidebar-widgets',
'description' => 'Widgets for the sidebar.',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'extra-menu' => __( 'Extra Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
function wpbeginner_comment_text_after($arg) {
$arg['comment_notes_after'] = "We are glad you are leaving a comment. Please keep in mind that comments are moderated!";
return $arg;
}
add_filter('comment_form_defaults', 'wpbeginner_comment_text_after');
?>
<?php
$query = new WP_Query( 'post_type=page&p=38' );
while ( $query->have_posts() ) : $query->the_post();
global $more; $more = 0;
the_content( 'Lees meer..' );
endwhile;
?>