• hi! child of 2012

    i would like to change the layout of my single.php template simply adding a div between the header and the rest of the page. in this division i ll put the featured image of the post. (in full size)

    so i bet i ve to put something inside here

    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    			<?php get_template_part( 'content',       get_post_format() ); ?>
    
    			<?php
    				if ( function_exists('related_posts') ) {
    				related_posts ();
    			}
    			?>

    under the get-header. i m not really good with PHP, so can anyone tells me how to solve this problem? thank you really much!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ilmattiapascal

    (@ilmattiapascal)

    i m looking for guides, maybe what i ask is not the real solution of the problem, but at least a strong help about what i should “study” to achieve this. If i ve to make it by myself, i ask you to help me to wasting less time searching for a guide or a manual. (so don’t be too generic please)

    my reference site is always that one, look at the bigimage between the header and the rest: https://www.garancedore.fr/2013/04/16/mes-halteres/

    until now i made that, and obviously it doesn’t work:

    <div id="bigimage">
    	    <div id="bigwideimage">
    				<?php get_bigimage(); ?>
    		</div>
    	</div>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', get_post_format() ); ?>
    
    			<?php
    				if ( function_exists('related_posts') ) {
    					related_posts ();
    				}
    			?>

    in single.php. then i tried to call the div id in style.css like that:

    /* articles */
    
    #bigimage {
    	display: block;
    	margin: 0;
    	padding: 10px;
    }
    
    #bigwideimage {
    		width: 500px;
    		height: 200px;
    		margin: 0;
    }

    obviously now the post page doesn’t work because wp told me to define the function get_bigimage….and i really don’t know how to make it in the function.php ??
    `

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    wow! i figured out something. i changed the get_bigimage, with the more classic <?php the_post_thumbnail(); ?>.

    Now something is working and i need your help to let it work definetly.

    i have my new and lovely div between the nav bar and the rest of the layout. I m free to change the size and he seems to work like a charm.

    The only problem is to bound the featured image to this box. the feat image appears, but she isn’t relative to the new division..

    Thread Starter ilmattiapascal

    (@ilmattiapascal)

    anybody has a solution for this god forsaken user with a small bunch of css knowledge in the pocket, and only devil and dust of php ? ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modify the single.php default layout’ is closed to new replies.