Tagged: featured content
- This topic has 7 replies, 2 voices, and was last updated 7 years, 7 months ago by Roland.
-
AuthorPosts
-
March 8, 2017 at 1:33 pm #111512RolandParticipant
Hi
Is not possible to change some code so that the Featured Content boxes are located below rather than above front page text?
Thanks
March 8, 2017 at 4:34 pm #111522MaheshParticipant@rolandallen: For that you’ll need to create a child theme and use
add_action
on another hooks. You can find more details on creating child theme HERE.Regards,
MaheshMarch 8, 2017 at 6:26 pm #111533RolandParticipantHi Mahesh,
I am indeed using a Child Theme – can you advise the code I would need to move the page text above the Featured Content?
Many thanks
March 8, 2017 at 6:49 pm #111535RolandParticipantHi Mahesh,
I just found a possible solution to this from Sakin, posted on January 29th, 2015 where he gives the following code:
<?php // Removing the Default Action Hook function unhook_catchkathmandu_functions() { remove_action( 'catchkathmandu_before_main', 'catchkathmandu_homepage_featured_position', 10 ); } add_action( 'init', 'unhook_catchkathmandu_functions' ); add_action( 'catchkathmandu_content_sidebar_start', 'catchkathmandu_homepage_featured_display', 15 );
It doesn’t seem to work – any suggestions?
Many thanks
March 9, 2017 at 1:58 pm #111607MaheshParticipant@rolandallen: Add the following code in you child theme’s
functions.php
./** * Loading Parent theme stylesheet * */ add_action( 'wp_enqueue_scripts', 'catchkathmandu_child_enqueue_styles' ); function catchkathmandu_child_enqueue_styles() { wp_enqueue_style( 'catchkathmandu-parent-style', get_template_directory_uri() . '/style.css' ); } function catchkathmandu_child_featured_content_below_main(){ remove_action( 'catchkathmandu_main', 'catchkathmandu_homepage_featured_display', 10 ); remove_action( 'catchkathmandu_after_secondary', 'catchkathmandu_homepage_featured_display', 10 ); remove_action( 'catchkathmandu_before_main', 'catchkathmandu_homepage_featured_position', 10 ); add_action( 'catchkathmandu_content_after_content', 'catchkathmandu_homepage_featured_display', 10 ); } add_action('init', 'catchkathmandu_child_featured_content_below_main');
Then create
footer.php
file in your child theme and add the following codes:<?php /** * The template for displaying the footer. * * Contains the closing of the id=main div and all content after * * @package Catch Themes * @subpackage Catch Kathmandu * @since Catch Kathmandu 1.0 */ ?> <?php /** * catchkathmandu_content_sidebar_end hook * * @hooked catchkathmandu_content_sidebar_wrap_end - 10 * @hooked catchkathmandu_third_sidebar - 15 */ do_action( 'catchkathmandu_content_sidebar_end' ); ?> <div style="clear: both;"></div> <?php do_action( 'catchkathmandu_content_after_content' ); ?> </div><!-- #main .site-main --> <?php /** * catchkathmandu_after_main hook */ do_action( 'catchkathmandu_after_main' ); ?> <footer id="colophon" role="contentinfo"> <?php /** * catchkathmandu_before_footer_sidebar hook */ do_action( 'catchkathmandu_before_footer_sidebar' ); /* A sidebar in the footer? Yep. You can can customize * your footer with three columns of widgets. */ get_sidebar( 'footer' ); /** * catchkathmandu_after_footer_sidebar hook */ do_action( 'catchkathmandu_after_footer_sidebar' ); ?> <div id="site-generator" class="container"> <?php /** * catchkathmandu_before_site_info hook */ do_action( 'catchkathmandu_before_site_info' ); ?> <div class="site-info"> <?php /** * catchkathmandu_site_info hook * * @hooked catchkathmandu_footer_content - 10 */ do_action( 'catchkathmandu_site_generator' ); ?> </div><!-- .site-info --> <?php /** * catchkathmandu_after_site_info hook */ do_action( 'catchkathmandu_after_site_info' ); ?> </div><!-- #site-generator --> <?php /** * catchkathmandu_after_site_generator hook */ do_action( 'catchkathmandu_after_site_generator' ); ?> </footer><!-- #colophon .site-footer --> <?php /** * catchkathmandu_after_footer hook * * @hooked catchkathmandu_scrollup - 10 */ do_action( 'catchkathmandu_after_footer' ); ?> </div><!-- #page .hfeed .site --> <?php /** * catchkathmandu_after hook */ do_action( 'catchkathmandu_after' ); wp_footer(); ?> </body> </html>
Regards,
MaheshMarch 9, 2017 at 2:18 pm #111608RolandParticipantHi Mahesh,
Many thanks for going to so much trouble to produce this code – unfortunately it doesn’t appear to work? I’ve added the top section of code into the child theme style.css and created a blank footer.php into which I’ve pasted the larger section of code – I’m sure it’s something I’m doing wrong?
Kind regards,
Roland
March 9, 2017 at 2:20 pm #111610RolandParticipantApologies – I’ve just re-read this and seen that I need to add the top piece of code into functions.php, not style.css…
I’ll try again!
March 9, 2017 at 2:22 pm #111611RolandParticipantHi Mahesh,
It now works perfectly!
Many thanks indeed.
Kind regards,
Roland
-
AuthorPosts
- The topic ‘Featured Content below page text’ is closed to new replies.