[Home page on my wordpress site displays url code before showing the text of my featured posts. They display normally once the post is called in their respective pages so the issue is just on the home page. How do I prevent this from happening? Screenshot of the problem and address for my home page included here.2

 * The template file for single post page.
 * @package    The Daybook
 * @version    1.1
 * @author     Elite Layers <[email protected]>
 * @copyright  Copyright (c) 2017, Elite Layers
 * @link       http://demo.elitelayers.com/thedaybook/
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2 or later
 get_header(); ?>

    <div id="thedaybook-content" class="section">

        <div class="block">

            <div class="container">

                <div class="row">
<?php /* insert affiliate disclosure */
$affiliate_disclaimer = get_field( 'ad_affiliate_disclaimer' );
if( in_array( 'yes', $affiliate_disclaimer ) ) { ?>
    <p class="disclaimer"><strong>Heads up:</strong> My posts may contain affiliate links. If you buy something through one of those links, it won't cost you a penny more, but I might get a small commission to help to keep the lights on. I don't recommend any products I have not tried and love. <a class="nowrap" href="/legal/#affiliate"><small>Learn More &raquo;</small></a></p>
<?php } /* end affiliate disclosure */ ?>
                    <main id="main" class="<?php echo esc_attr(thedaybook_content_class());?>">

                         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

                             <?php get_template_part('parts/content','single'); ?>

                         <?php endwhile; ?>

                         <?php endif; ?>


                     <aside class="<?php echo esc_attr(thedaybook_sidebar_class());?>">
                        <?php get_sidebar();?>





<?php get_footer(); ?>
  • please read this post on how to ask a good question if you wish for users to help you.
    – Aurovrata
    May 28, 2018 at 11:12
  • Hello Marcela, welcome to WPSE. Unfortunately, the offending code is not the one you post. It could be anywhere in the theme The Daybook you are using. Your best course of action is probably to contact the theme's author.
    – cjbj
    May 28, 2018 at 12:21
  • Hi cjbj - that would make sense if this issue was there since the beginning. However, it was fine and only started appearing today after I was playing with SEO and affiliate disclaimer plug in. What puzzles me is why this issue is only on the home page but not on the actual post pages.
    – Marcela
    May 28, 2018 at 12:55

2 Answers 2


Check your code, Maybe you have entered post url code with content

I mean like.(URL code) (Content Code)

I have checked your concern and i found these solutions.

If still facing problem then paste here your code so i can understand that.

  • I added the code in issue description now. I today added code in the post code to show affiliate disclaimer. It did not work (i.e. no display of affiliate disclaimer) and since then the url shows on the home page for grid posts
    – Marcela
    May 28, 2018 at 12:00

I guess the issue is in home.php file in your theme folder.

Maybe you can share the code of that file so that I can help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.