Tagged: x
-
AuthorPosts
-
July 12, 2016 at 11:27 am #1083345
walterbriggsParticipantHello!
We’d like to be able to use the featured image full-width above the content on some pages. I did a search of the forum and found a code to enter in the custom code area:
jQuery(document).ready(function($) {
$(‘.page .entry-featured’).insertAfter(‘header.masthead’);
});However, it doesn’t seem to be working. A similar code for Posts works on those:
(function($) {
$(‘.single .entry-featured’).insertAfter(‘header.masthead’);
})(jQuery);I’m just wondering if the code is correct and I’m just doing something else wrong, or if the code no longer works (it was from a 2015 post) and needs an update?
Thanks!
July 12, 2016 at 11:43 am #1083373
walterbriggsParticipantAh. It appears it might be the template I’m using (Blank – No Container | Header, Footer). It shows up correctly if I use the default template. Is there a way to achieve the same thing with the ‘Blank – No Container | Header, Footer’ template?
Thanks!
July 12, 2016 at 1:55 pm #1083588
RupokMemberHi there,
Maybe it won’t work but you can provide the URL (with Blank – No Container | Header, Footer set) and we could check.
Thanks!
July 12, 2016 at 2:12 pm #1083628
walterbriggsParticipantThis reply has been marked as private.July 12, 2016 at 6:58 pm #1083918
JadeModeratorHi there,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once you got the child theme setup and activated, you can access the files though FTP then go to /wp-content/themes/x-child/framework/views/integrity then create a file in the directory named template-blank-4.php. Open the file then add this code:
<?php // ============================================================================= // VIEWS/INTEGRITY/TEMPLATE-BLANK-4.PHP (No Container | Header, Footer) // ----------------------------------------------------------------------------- // A blank page for creating unique layouts. // ============================================================================= ?> <?php get_header(); ?> <div class="x-main full" role="main"> <?php while ( have_posts() ) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php if ( has_post_thumbnail() ) : ?> <div class="entry-thumbnail"><?php the_post_thumbnail( 'full' ); ?></div> <?php endif; ?> <?php x_get_view( 'global', '_content', 'the-content' ); ?> </article> <?php endwhile; ?> </div> <?php get_footer(); ?>Then add this in the functions.php of the child theme:
.page-template-template-blank-4 .entry-thumbnail img { width: 100%; margin-bottom: 30px; }After saving the changes in the file, you can open the page, set a Featured Image to it then select Blank – No Container | Header, Footer as the template. Basically the file content about will override the structure of the default Blank – No Container | Header, Footer template and adds the featured image at the top of the content is there is anything set for the page.
Hope this helps.
July 13, 2016 at 8:45 am #1084858
walterbriggsParticipantHi Jade,
It’s very close, thank you. I think this gives me enough direction to do what I need it to.
Thanks!
July 13, 2016 at 10:19 am #1085010
JoaoModeratorThat is great
Let us know if you need further help.
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1083345 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
