Tagged: x
-
AuthorPosts
-
July 5, 2016 at 1:31 pm #1073413
chriszeiglerParticipantHi there, is it possible to move the comments section up into the content of blog posts? Currently they are at the very bottom of the page and so no one sees it and it limits conversation. You can see what it looks like here: http://thebasicsite.org/how-to-reach-more-men-in-your-ministry/
I’d like to move it to either before or after the About the Author section. Thanks for the help!
July 5, 2016 at 2:00 pm #1073460
RahulModeratorHello There,
What you are trying to accomplish requires a template customization, we would like to suggest that you use 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 have a child theme, you will need to edit the wp-single.php in
/x/framework/views/renew/wp-single.phpcopy this file and edit it. Remove the comments template which is in line #20 and upload it to your child themes folder/x-child/framework/views/renew/wp-single.php.You also need to edit _content.php in
/x/framework/views/global/_content.php. Do the same thing, copy and edit this file. You need to change lines 18-20if ( $stack == 'renew' ) : x_get_view( 'renew', '_content', 'post-footer' ); endif;to this:
if ( $stack == 'renew' ) : x_get_view( 'renew', '_content', 'post-footer' ); x_get_view( 'global', '_comments-template' ); endif;And upload to your child theme’s folder
/x-child/framework/views/global/_content.phpPlease let us know how it goes.
July 5, 2016 at 3:05 pm #1073558
chriszeiglerParticipantI have a child theme installed, but I’m not very familiar/comfortable with changing php files. Is there any other way to do this?
July 5, 2016 at 3:23 pm #1073585
JoaoModeratorHi There,
This is the way of doing this.
It is pretty straightforward, I am sure you will be proud of yourself once you accomplish π
You simply need to copy the file from the X Folder Paste on the same destination folder on the Child Theme and change the code as instructed above. You can use a text editor to edit the php file before uploading to the Child theme Folder.
Try it out and if you face any problems please reach us and we will help you out.
Thanks
Joao
July 6, 2016 at 10:51 am #1074977
chriszeiglerParticipantHi,
I just tried it and now the comments are gone completely. So, I’m thinking I did something wrong π
July 6, 2016 at 12:08 pm #1075080
chriszeiglerParticipantActually, now I’m seeing them, but they’re still at the bottom like they were before.
July 6, 2016 at 4:34 pm #1075409
FriechModeratorHi There,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Thanks.
July 6, 2016 at 7:08 pm #1075518
chriszeiglerParticipantThis reply has been marked as private.July 7, 2016 at 12:39 am #1075967
FriechModeratorHi There,
Thanks for the credentials and sorry for the confusion, we give you the instruction for renew stack while your site is in integrity.
Please redo everything and follow this instead. On your child theme navigate to this directory: \wp-content\themes\x-child\framework\views\integrity\
Create a file there named wp-single.php and paste the code below on it.
<?php // ============================================================================= // VIEWS/INTEGRITY/WP-SINGLE.PHP // ----------------------------------------------------------------------------- // Single post output for Integrity. // ============================================================================= $fullwidth = get_post_meta( get_the_ID(), '_x_post_layout', true ); ?> <?php get_header(); ?> <div class="x-container max width offset"> <div class="<?php x_main_content_class(); ?>" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php x_get_view( 'integrity', 'content', get_post_format() ); ?> <?php /*x_get_view( 'global', '_comments-template' );*/ ?> <?php endwhile; ?> </div> <?php if ( $fullwidth != 'on' ) : ?> <?php get_sidebar(); ?> <?php endif; ?> </div> <?php get_footer(); ?>Then navigate to \wp-content\themes\x-child\framework\views\global\
And there create a file named _content.php and paste the code below on it.
<?php // ============================================================================= // VIEWS/GLOBAL/_CONTENT.PHP // ----------------------------------------------------------------------------- // Display of the_excerpt() or the_content() for various entries. // ============================================================================= $stack = x_get_stack(); $is_full_post_content_blog = is_home() && x_get_option( 'x_blog_enable_full_post_content' ) == '1'; ?> <?php if ( is_singular() || is_search() || is_archive() || $is_full_post_content_blog ) : x_get_view( 'global', '_content', 'the-content' ); /*this is the content*/ x_get_view( 'global', '_comments-template' ); /*this is the comment*/ if ( $stack == 'renew' ) : x_get_view( 'renew', '_content', 'post-footer' ); endif; else : x_get_view( 'global', '_content', 'the-excerpt' ); endif; ?>Notice this line:
x_get_view( 'global', '_comments-template' ); /*this is the comment*/That is the code to render the comment. Unfortunately you can only place that above or below the content, not above or below the author bio because your author element is part of the post content.
Hope this make sense.
Let us know how it goes.
Cheers!
July 7, 2016 at 8:35 am #1076447
chriszeiglerParticipantOk, I was able to get that to work, but I didn’t like having the comments above the content as you mentioned. Is there any way to render the author bio in that _content.php file so you can then put the comments between the content and the bio?
July 7, 2016 at 2:20 pm #1076838
JadeModeratorHi there,
Please try this code for the _content.php:
<?php // ============================================================================= // VIEWS/GLOBAL/_CONTENT.PHP // ----------------------------------------------------------------------------- // Display of the_excerpt() or the_content() for various entries. // ============================================================================= $stack = x_get_stack(); $is_full_post_content_blog = is_home() && x_get_option( 'x_blog_enable_full_post_content' ) == '1'; ?> <?php if ( is_singular() || is_search() || is_archive() || $is_full_post_content_blog ) : x_get_view( 'global', '_content', 'the-content' ); /*this is the content*/ x_get_view( 'global', '_comments-template' ); /*this is the comment*/ echo do_shortcode('[author title="About the Author"]'); if ( $stack == 'renew' ) : x_get_view( 'renew', '_content', 'post-footer' ); endif; else : x_get_view( 'global', '_content', 'the-excerpt' ); endif; ?>Hope this helps.
July 7, 2016 at 9:36 pm #1077373
chriszeiglerParticipantThat worked. Thanks so much! One last thought. I’m thinking of removing the Related articles section to make it a little cleaner. Is there a way to do that?
July 7, 2016 at 11:43 pm #1077488
Prasant RaiModeratorHello There,
Thanks for writing in!
Since you are using Jetpack related posts, the same can be disabled from Jetpack > Settings > Related Posts.
Thanks.
July 8, 2016 at 1:56 pm #1078275
chriszeiglerParticipantGot it. I forgot this was setup using Jetpack and not the theme. Thanks!
July 8, 2016 at 3:11 pm #1078377
JoaoModeratorHi Chris,
Let us know if you need help with anything else.
Joao
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1073413 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
