Home>Support>Text between content and comments

Text between content and comments

I use Vantage on www.staffansandberg.se and would like to have some text on every page and post on my site (not search, archive and front page). The text is supposed to be between content and comments. I use a Facebook comments plugin. What file am I supposed to change to add the text?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi StaffanS,

    I would add the code via the vantage_main_bottom or vantage_after_main_container actions (add_action()).

    If you would rather edit a template, you would add it to either the footer.php (and run a is_singular() check) or you would add it directly to the relevant template files – single.php or page.php.

    As always, please make sure that you’re using a child theme.

  2. 7 years, 10 months ago StaffanS

    Thanks for the reply.
    My intetion was to make it simle, just use echo to get the text.
    My problem is to find where in the files I should write the code. This is a part of page.php in my child theme:

    <?php get_template_part( 'content', 'page' ); ?>
    	
    
    			<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
    				<?php comments_template( '', true ); ?>
    			<?php endif; ?>
    
    		<?php endwhile; // end of the loop. ?>
    
    
    	</div><!-- #content .site-content --> 

    If I write my code under the “get_template” line, then I get the text above the content on the page. Under endif will write the code under the comments. I would like to have the code under the text on the page, but above the comments. I have the same problem with my single.php file,the text appear too high or too low.
    This is a part of my single.php file:

    get_header(); ?>
    
    <div id="primary" class="content-area">
    	<div id="content" class="site-content" role="main">
    
    	<?php while ( have_posts() ) : the_post(); ?>
    
    		<?php get_template_part( 'content', 'single' ); ?>
    
    
    		<?php if( siteorigin_setting('navigation_post_nav') ) vantage_content_nav( 'nav-below' ); ?>
    
    		<?php if ( comments_open() || '0' != get_comments_number() ) : ?>
    			<?php comments_template( '', true ); ?>
    		<?php endif; ?>
    
    	<?php endwhile; // end of the loop. ?>
    
  3. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi StaffanS,

    I would add it under so I’m quite confused as to why it’s appearing before the content. Do you have a public URL where we can take a look at what’s going on? If you need to keep this URL private from other users, just select “Private Reply” on the bottom right of the comment box.

  4. 7 years, 10 months ago StaffanS

    This is an exemple when I write the code between get_template_part and comments_open in page.php. The text appears under the comments.
    I have another problem with placements. I would like to have an ad under the content, centered to the content when I exclude the sidebar. I have this code in the end of my content-single.php:

    <?php do_action('vantage_entry_main_bottom') ?>
    <br>
    <?php the_ad_group(27); ?>
    	</div>
    
    
    </article><!-- #post-<?php the_ID(); ?> --> 

    The ad is published above the postnavigation as you can see on this page. Nothing happens if I move the code for the ad under the div. The ad will be displayed over the navigationbuttons if I move the adcode further down. I would like to have the ad under the buttons. I tried to put it in the footer.php, but then it will appear centered to the wholes page with the sidebar.

  5. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi StaffanS,

    Ah. I ignored an important part of your post – you’re using Facebook comments which is why this isn’t a simple edit. So that plugin hooks into the_content (which as the name implies, is the post content) filter and appends itself to the end of it. To output something before you’ll need to add a hook with a priority higher than 10 and less than 100. For example, something like this:

    funciton siteorigin_example_content_filter( $content ){    return $content . ' example';}add_filter( 'the_content', 'so_example_content_filter', 50 );

    Does that make sense?

  6. 7 years, 10 months ago StaffanS

    I read some tutorials about hooks, but did not understand much, I don’t have enough knowledge about php. I have to spend more time to learn more about php before I test your solution.
    Do you have any suggestions about how to put an ad under the post navigation aligned to the content on the page, not with the content and sidebar?

  7. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi StaffanS,

    Understandable. Consider giving the code I provided a try as you should be able to modify that as a good base.

    I’m kind of confused. You want it aligned with the content but not with the content and sidebar? As, you want it only to before the content but not before the sidebar? Is that correct? If so, place your code before this line:

    <div id="primary" class="content-area">
    
  8. 7 years, 10 months ago StaffanS

    Sorry for my bad English.
    I would like to have the ad after the content and the post navigation, not before. This is an example of how I would like to have it. It works on all pages, but the next and previuos buttons are after the ad in my posts.

  9. 7 years, 10 months ago Alex S
    Hi, I Work Here

    Hi StaffanS,

    Hm. Try adding it after the following line:

    <?php if( siteorigin_setting('navigation_post_nav') ) vantage_content_nav( 'nav-below' ); ?>
    
  10. 7 years, 10 months ago StaffanS

    Thanks! That worked :)
    Good support was one of the most important criterias when I decided theme for my site. I haven’t been disapointed. I helped some friends to start their own sites, all of them use Vantage. :)

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More