Community Forums › Forums › Archived Forums › Design Tips and Tricks › Comment section appears on top of custom page – how do I move it?
Tagged: comment section positioning
- This topic has 6 replies, 3 voices, and was last updated 9 years, 2 months ago by Stylos.
-
AuthorPosts
-
January 30, 2015 at 5:58 pm #139096January 30, 2015 at 6:48 pm #139099StylosMember
This is the structure of the page:
<?php
/*
Template Name: a-recipe-template
*/add_action('genesis_loop', 'gt_custom_loop');
function gt_custom_loop() {
?>
<p>"JUST SOME TEXT TO SHOW UP - DEMO TO SHOW THE "WRONG" POSITIONING
OF THE COMMENT SECTION DIRECTLY BENEATH THE HEADER BUT ON TOP OF ALL THE CONTENT
FOR THIS CUSTOM PAGE TEMPLATE"</p>
<?php
add_action('genesis_loop', 'gt_custom_loop');
}genesis(); // <- everything important: make sure to include this.
?>January 31, 2015 at 3:14 am #139120Genesis DeveloperMemberYou are calling the gt_custom_loop function two times. Code will be like this
<?php /* Template Name: a-recipe-template */ remove_action('genesis_loop', 'genesis_do_loop'); function gt_custom_loop() { ?> <p>”JUST SOME TEXT TO SHOW UP – DEMO TO SHOW THE “WRONG” POSITIONING OF THE COMMENT SECTION DIRECTLY BENEATH THE HEADER BUT ON TOP OF ALL THE CONTENT FOR THIS CUSTOM PAGE TEMPLATE”</p> <?php add_action('genesis_loop', 'gt_custom_loop'); } genesis(); // <- everything important: make sure to include this. ?>
January 31, 2015 at 6:27 am #139141CarloMemberHi Stylos. Try using this code:
<?php /* Template Name: a-recipe-template */ remove_action('genesis_loop', 'genesis_do_loop'); add_action('genesis_loop', 'gt_custom_loop'); function gt_custom_loop() { ?> <p>JUST SOME TEXT TO SHOW UP – DEMO TO SHOW THE "RIGHT" POSITIONING OF THE COMMENT SECTION FOR THIS CUSTOM PAGE TEMPLATE</p> <?php } genesis(); // <- everything important: make sure to include this. ?>
January 31, 2015 at 6:55 am #139149StylosMemberHello "Genesis Developer", thank you very much for getting back to this that fast. Anyway, it does not work for me as you describe the problem... Thank you very much anyway! May be I am missing something?
What I found out by know - and what seems to work is the following:<?php
/*
Template Name: a-recipe-template
*/
?>
<?php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'gt_custom_loop');function gt_custom_loop() {
?>
<p>"JUST SOME TEXT TO SHOW UP - DEMO TO SHOW THE "WRONG" POSITIONING
OF THE COMMENT SECTION DIRECTLY BENEATH THE HEADER BUT ON TOP OF ALL THE CONTENT
FOR THIS CUSTOM PAGE TEMPLATE"</p>
<?php
add_action('genesis_loop', 'gt_custom_loop');
}add_action('genesis_loop', 'genesis_do_loop');
genesis(); // <- everything important: make sure to include this.
?>January 31, 2015 at 7:01 am #139151StylosMemberForgot and wanted to mention, that you´ve pointed me in the right direction! Initially I did not include (know of) the "remove_action(‘genesis_loop’, ‘genesis_do_loop’)"-FUNCTION.
And what made it work (moving the comment section to the bottom of the custom-template-page), was to call the "add_action"-FUNCTION again, just before the "genesis()" function call. (May be this is obvious to the experienced Genesis programmer...).January 31, 2015 at 9:35 am #139175StylosMemberHello Carlo Manf - your message just came up. Thank you for your efforts! Yes, it works this way - with the addition of the "add_action()" function before the final "genesis()" call; at least it seems to work for my custom-page-template.
Have a great weekend! -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.