Feature Request: Allow Featured Images and Header Images on Pages #171

Closed
erik-visser opened this Issue Dec 26, 2014 · 4 comments

Projects

None yet

2 participants

@erik-visser

Hello Raam,

How can I manipulate your theme in a way that it will be possible to show a full width header (from featured image) on pages like it is now on individual posts?

@raamdev raamdev added the enhancement label Dec 28, 2014
@raamdev raamdev added this to the Next Release milestone Dec 28, 2014
@raamdev
Owner
raamdev commented Dec 28, 2014

@erik-visser Thanks for the question. That's a great feature request--I'm not sure why I didn't make this possible to begin with.

I'll work on adding this to the next release of the theme, but here's how you can make it work for now:

Note: I suggest using a Child Theme when making modifications, in which case you'd just copy the necessary files to your Child Theme before making the changes below.

Inside content-page.php, add the following code just above the line 11, which should say <header class="entry-header">:

    <?php if ( has_post_thumbnail() && ! independent_publisher_has_full_width_featured_image() ) : ?>
        <?php the_post_thumbnail( 'independent_publisher_post_thumbnail', array( 'itemprop' => 'image' ) ); ?>
    <?php endif; ?>

You should end up with something like this:

// ...
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <?php if ( has_post_thumbnail() && ! independent_publisher_has_full_width_featured_image() ) : ?>
        <?php the_post_thumbnail( 'independent_publisher_post_thumbnail', array( 'itemprop' => 'image' ) ); ?>
    <?php endif; ?>
    <header class="entry-header">
// ...
@raamdev raamdev changed the title from Header images on pages to Feature Request: Allow Featured Images and Header Images on Pages Dec 28, 2014
@erik-visser

Hello Raam,

Thanks for your quick reply. I tried that before but it didn't work. And again now. I get the image above the title but it not full screen.
screen shot 2014-12-28 at 23 44 04

@raamdev
Owner
raamdev commented Dec 29, 2014

@erik-visser Thanks for testing and reporting that it still didn't work!

I looked into this again and I realized there was a lot more changes that were needed to support Full-Width Featured Images (Post Covers) on Pages, including changes to CSS and several core functions.

I've committed these changes to the dev branch of theme and these will go out with the next release. Please see 20a069f for a list of the changes necessary.

Since changes to core functions were necessary (i.e., functions inside functions.php), it won't be possible to override those in a Child Theme. If you are using a Child Theme, I recommend updating the parent theme with the latest copy from GitHub. Please keep in mind that after extracting the ZIP file you'll need to rename the directory from independent-publisher-master to independent-publisher, so that your existing Child Theme can find the new files.

Let me know if you have any questions or issues.

@raamdev
Owner
raamdev commented Dec 29, 2014

Next release changelog:

  • Enhancement: Pages now support Featured Images and Full-Width Featured Images (i.e., Post Covers). See #171.
@raamdev raamdev closed this Dec 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment