0

I'm having a weird issue where Wordpress is cutting off and not grabbing all of the content from pages or posts.

Examples can be seen on the following pages:

http://gripjunkies.com/about/

http://gripjunkies.com/staying-in-tune-during-the-off-season/

Here is what the code looks like for single.php

<?php get_template_part('parts/header'); the_post(); ?>

<main>

  <div class="singleContainer">

    <article id="post-<?php the_ID(); ?>"
             <?php post_class(); ?>
             itemscope itemtype="http://schema.org/BlogPosting">

      <header>
        <h1 class="singleHeadline" itemprop="headline">
          <?php the_title(); ?>
        </h1>

        <div class="singleInfo">Posted by <a class="authorLink linkFade"><?php the_author();?></a> on <?php echo get_the_date( get_option('date_format'));?> </div>
      </header>

      <div class="singleBody" itemprop="articleBody">
        <?php the_content(); ?>
      </div>

    </article>

  </div>


  <div class="discussion">

      <div class="centerBox">
        Have comments or questions about this article? Feel free to discuss below with other members.
      </div>

      <div class="comments">

        <?php comments_template(); ?>

      </div>

    </div>


</main>

<?php get_template_part('parts/footer'); ?>

And here is what the code looks like for page.php, which is doing the same thing.

<?php get_template_part('parts/header'); the_post(); ?>

<main>


  <section class="container">

    <div class="title">
      <h1><?php the_title(); ?></h1>
    </div>

    <div class="content">
      <?php the_content(); ?>
    </div>

  </section>

</main>

<?php get_template_part('parts/footer'); ?>

Any ideas what the issue might be? I'm using Scratch theme.

This isn't my first time using my theme, but is my first time getting this error. I've spoken with my friend who developed the theme, but we were both able to decide that Scratch wasn't the issue that this was happening.

Any suggestions?

1 Answer 1

1

Try calling the_post() at the top of the file before calling functions like the_title() and the_content()

If that doesn't work, then most likely you have a function on the the_content filter that is causing this problem. Try disabling the plugins you have installed one by one to see if that fixes the problem

2
  • I've done that. It's at the top of each of my code snippets that I provided, right next to the header. I've also disabled plugins and tried from there, still nothing. I'll try looking and seeing if there is a filter somewhere that got created by mistake, but I don't believe that's the case. Commented Jan 5, 2017 at 15:51
  • Just ran through my functions.php and there was a filter there. Now I feel silly, but thanks for making me check myself. Commented Jan 5, 2017 at 16:00

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.