• Resolved hampusjageland

    (@hampusjageland)


    Hi all,

    I’ve been very successful with my blog thanks to all your feedback and help here!
    I just discovered two more minor errors with my blog though:

    1. It won’t allow me to insert links in my posts. Or, to be more specific, it allows me to insert them when I create the post but it won’t display them. This only applied to the posts though since the links work in my information page etc.

    2. I’m trying to create paragraphs by just hitting enter in my post editor and in there it all looks fine but when I update the post the copy below the line break disappears for some reason. I’ve even tried to insert <br /> manually.

    I’d really appreciate your help!

    Here’s my website for reference:
    https://www.projektblog.info

    Best,
    H

Viewing 7 replies - 1 through 7 (of 7 total)
  • what is the code of the file that displays the single posts?
    could you paste it into a pastebin and post the link to it here?

    it looks like the post’s content is displayed using the ‘get_the_content()’ without applying any filter to it; probably to filter the images from the content.

    the front posts seem to be done with the_excerpt which won’t show links anyway.

    Thread Starter hampusjageland

    (@hampusjageland)

    Never done that before so let me know if it doesn’t work

    https://wordpress.pastebin.com/N0Lbm1kw

    So since the posts pull the text using excerpts, the links and line breaks won’t work?

    excerpts are stripped of a lot of things (links, images, html tags, formatting, etc).

    <h7><?php the_excerpt(); ?><h7>

    trouble is, when you use the_content(); then the html syntax gets invalid because having all the possible html tags (paragraph, img, div, etc) in a h7 tag is not allowed.

    try and use a div instead and style it to have the same font/font-size as a h7; something like:

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

    in style.css, add
    .post-content { font-size:100%; }
    and ajust the number value and add further styles that might be neccessary to have the text show the same way as before.

    the_content() will also show all images that might be in your post.

    Thread Starter hampusjageland

    (@hampusjageland)

    That sounds good! The only problem I’ve had (which is also the reason for me not doing it) has been that I have no idea how to build it in a similar way without using tables. The text will just automatically jump down to underneath the image right?

    Thanks for your help! Really appreciate it!
    H

    i would assume that the div will stay in the table cell, but that is easy to find out.

    just make backup copies before editing the theme files.

    Thread Starter hampusjageland

    (@hampusjageland)

    Got copies and all so here we go…

    First problem is: How can I display a thumbnail on the index page which is not displayed in the post?

    And How do I make the copy sit next to the images?

    Thread Starter hampusjageland

    (@hampusjageland)

    Since I want it to look exactly like it does with the heading-copy-tags etc I think it could be pretty hard to reproduce that using the_content. I don’t even know how I’d separate the copy from the image (without at least using tables in the actual post, which is a bit messy…)

    I think I’ll have to live with non-live links and paragraphs. If there’s not another way of editing the functions file to allow links in the excerpts?

    Thanks for your help though!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Won’t allow links and line breaks in posts’ is closed to new replies.