• I am trying to figure out why this code doesn’t work:
    <h4><a class="info" href="<?php the_permalink(); ?>"><?php the_title(); ?> <span><?php the_content(); ?></span></a></h4>

    I am assuming that it has to do with how the_content parses (but we all know what assuming does). I have tried a whole bunch of different work-arounds, but to no avail. it always seems to render the content like this:
    <h4><a class="info" href="<?php the_permalink(); ?>"><?php the_title(); ?> </a><span></span><?php the_content(); ?></h4>

    Also, I know it is a problem with the_content, because if I replace the_content with “Sample Content to Make Sure This Works,” it works just as I would expect where both the anchor and span tag wrap around both the_title and the_content.

    I just want to get the content to appear within the span tags on one page, and hoping someone could shed some light on the subject.

    Thank you,
    Anthony

Viewing 2 replies - 1 through 2 (of 2 total)
  • if your content is very simple text, you could try:

    <?php echo get_the_content(); ?>

    Thread Starter Anthony D'Arco

    (@adarco)

    For some reason that still only put the first line of the text into the span tags. Thank you for the effort though. I am going to keep trying, I will let you know if I figure it out. In the meantime if you have any other ideas, I would be glad to give it a go.

    Thank you,
    Anthony

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘the_content problems’ is closed to new replies.