• Resolved accend4web

    (@accend4web)


    I am still finding my feet with wordpress, but I have just been informed about the Featured Image that is available on Pages.

    What I have done so far is create a child template for the pages, and then the content of the page is displayed as the webapge.

    Inside the page admin, i have inserted a header image 1500 x 400 using the path supplied once upload to the media folder.

    But wanted to try and get this featured image working, and cant work it out.

    I have pickedo on one page for now, selected a featured image which shows fine, i can see that, but I dont know how to get all the featured images to sit at the top of the page.

    This is the page im testing it on, and dont know what code to supply, so below is the code from the template I am using to build these pages, and here is the link to the page its being tested on – ridgeway/parasite-catalogue/fasciola-hepatica/

    <?php /* Template Name: Ridgeway-Internal-Left-Nav */ ?>
    <?php get_header(); ?>
    
    <?php get_template_part('element', 'page-header'); ?>
    
    <div id="main" class="main">
    	<div class="container">
    <section id="content" class="content">
    <?php do_action('cpotheme_before_content'); ?>
    			
    <?php if(have_posts()) while(have_posts()): the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="page-content">
    	<?php do_action('cpotheme_after_title'); ?>
        <!--<div class="hr"><hr /></div>-->
    	<?php the_content(); ?>
    </div>
    </div>
    <?php endwhile; ?>
    <?php if(get_query_var('paged')) $current_page = get_query_var('paged'); else $current_page = 1;?>	
    <?php $query = new WP_Query('post_type=cpo_service&paged='.$current_page.'&posts_per_page=-1&order=ASC&orderby=menu_order'); ?>
    <?php if($query->posts): $feature_count = 0; ?>
    <section id="services" class="services">
    <?php cpotheme_grid($query->posts, '', '', 3); ?>
    </section>
    <?php cpotheme_numbered_pagination($query); ?>
    <?php wp_reset_postdata(); ?>
    <?php endif; ?>
    <?php do_action('cpotheme_after_content'); ?>
    </section>
    <?php get_sidebar(); ?>
    <div class="clear"></div>
    </div>
    </div>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter accend4web

    (@accend4web)

    Might be useful sorry should have added it –

    This is what the top of each page currently looks like in the WYSIWYG

    <img class="aligncenter size-full wp-image-167" style="margin-bottom: 15px;" src="/ridgeway/wp-content/uploads/2017/01/ridgeway_CRO_tubes.jpg" alt="" />
    <div id="ridgeway_wrapper">
    <div id="ridgeway-CRO-Left">[accordionmenu id="unique043c391" accordionmenu="933"]
    <div class="leftnav_cta_below">We supply research organisations and universities with a range of parasites. See our <a style="text-decoration: underline;" title="Parasite Catalogue" href="parasite-catalogue/">Parasite Catalogue</a> for the full list</div>
    </div>
    <div id="ridgeway-CRO-Right">
    <h1>Fasciola hepatica (liver fluke)</h1>
    <h2>The life cycle of liver fluke</h2>
    Thread Starter accend4web

    (@accend4web)

    Ok I think I got it, I added this line to my child functions.php file

    add_theme_support( ‘post-thumbnails’, array( ‘post’, ‘page’ ) );

    Then in the child template and this seemed to work

    the_post_thumbnail()

    If this is wrong, be good to get that feedback

    This is the proper way to handle it, yes.

    Sorry for the late reply.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get Featured Image to work on Page’ is closed to new replies.