• Resolved wutzelmutz

    (@wutzelmutz)


    hi there,

    while redesigning a custom theme, i stumbled upon the following:

    since I have deleted nearly everything from the source code, there’s not much left.
    now I find it somehow strange that the title I’m calling on the post pages does not belong to the rest of the content.

    it’s always mixing up title/category and the rest of the post details.

    <?php get_header(); ?>
    
    	<div id="content">
    
    		<div class="post-single">
    
    			<h1>&mdash; <?php the_title(); ?> &mdash;</h1>
    			<h2><?php the_category(' / ') ?></h2>
    
                		<div class="entry">
    	            <?php if (have_posts()) : ?><?php while (have_posts()) : the_post();
    			$Verlag = do_shortcode(get_post_meta($post->ID, 'Verlag', true));
    			$Seiten = get_post_meta($post->ID, 'Seiten', true);
    			$Preis = get_post_meta($post->ID, 'Preis', true);
    			$Einband = get_post_meta($post->ID, 'Einband', true);
    			$Leseprobe = get_post_meta($post->ID, 'Leseprobe', true);
    
    		?>
    				<?php the_content(); ?>
                    <div class="bottom">
    		<?php the_post_thumbnail() ?>

    and so on .. any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • http://codex.wordpress.org/The_Loop

    the post title and the categories are outside the loop;
    which starts with this code:

    if (have_posts()) : while (have_posts()) : the_post();

    move that code to before this line:
    <h1>&mdash; <?php the_title(); ?> &mdash;</h1>

    don’t forget to set the php tags properly.

    Thread Starter wutzelmutz

    (@wutzelmutz)

    Thank you! Now it works just fine.

    I never really understood that loop thing ..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post title does not belong to the post’ is closed to new replies.