WordPress.org

Support

Support » How-To and Troubleshooting » Links work in preview but not once published (?)

Links work in preview but not once published (?)

  • Hi everyone,
    The links in my posts are working in the previews just fine but when I publish the post the links dont work at all and its getting really frustrating. Ive tried it from the visual window and the html window. Nada either way.
    Any ideas?
    Thanks in advance.

Viewing 15 replies - 1 through 15 (of 35 total)
  • Hi, can you give me a link to your blog please?

    Its couponboom.com . The top post about Yard Sale Maps…see where it says THIS SITE ? Thats where the link should be. My html is this….
    Its that time of year again…..Yard Sales! If you live in a fairly populated area you might find this yard sale mapping site useful. Enter in an address or just click on your state/town and the map will show you where the yard sales are in that area! Check out THIS SITE today.
    Thank you f00bar

    Hm, that is strange…I tried doing a test post on my own blog and the link showed up – what version of WordPress are you using?

    Nice site by the way 😀

    2.7.1 and thank you 😉 Nice is great but pretty useless unless I can get this problem fixed.
    I have to run out for a bit so Ill just pound my head against it again when I get back.
    Thanks for your help.

    OK.

    Wasn’t sure if you knew but when you click the post title to go read the full post, the link does work. It’s obviously only disabled in the post listing – which means that at least the link is there somewhere!

    Having searched this forum, I found a few others came across this problem but with no real solutions…so, it may be a WordPress thing.

    Also, I would suggest turning on Pretty Permalinks for SEO purposes, and also because it looks nicer than the query strings!

    Uhh, I didnt know that. When I click on the post title it takes me to the full post. grrrr. I dont want to go back to joomla but this is becoming a pita. Where do I change it? Under Posts is just Edit/Add/Categories/Tags.
    I dont know what ‘pretty permalinks’ is. Ive only been using wordpress for a week or so. Under my permalinks section the Common Settings is set to default.
    Thanks again.

    If you go to Permalinks and then in the custom box type:

    /%post_id%/%postname%/

    That will give you a URL like:

    http://www.yoursite.com/12/this-is-a-post/

    Which looks a bit nicer and more descriptive for search engines.

    Unfortunately, having looked in more detail it seems that links won’t work in post overviews only the actual post itself…what you could do (and I know this is not an ideal solution) is type the URL out in the post so at least people can take it from the post overview. Sorry…

    Well Im really confused now. When I make a post some links work, and some dont. All are written up, or linked, the same way. What do you think is going on? it doesnt make sense to me at all.

    you’re index.php automatically cut your post and disabling the links as well.
    probably similar as this:

    <?php
                if(is_home()) {
                  if(strlen(get_the_content())>380)
                    echo substr(strip_tags(get_the_content()), 0, 390).'[...]';
                  else
                    echo get_the_content();
              ?>

    replace the code in the index.php
    to

    <div class="entry">
    					<? if (is_search()){
    							the_excerpt();
    						}else{
    							the_content('more...');
    						}
    					?>
    				</div>

    displaying your post.

    Moderator kmessinger

    @kmessinger

    First off, do not change any code. All of the index.php files that come with WP are fine and you don’t want to fix things that are not broken.

    Second, validate your site. If you validate links, you will see the problems, http://validator.w3.org/checklink?uri=http%3A%2F%2Fwww.couponboom.com%2F&summary=on&hide_type=all&depth=&check=Check

    If you validate the html, you will find these errors, http://validator.w3.org/check?verbose=1&uri=http%3a%2f%2fwww.couponboom.com%2f

    You cannot hope to solve a problem when you have code problem.

    To change or not to change.
    I validated the links and html and I havent a clue what Im looking at.
    I thought with wordpress you can just install and blog. Im not a master at html and I dont know how to fix those problems or prevent them from happening in the future.
    Thanks for the replies.

    do you have this in your index.php of your template?

    or similar to this?

    echo substr(strip_tags(get_the_content()), 0, 390).'[...

    i encountered same situation before.

    Moderator kmessinger

    @kmessinger

    You might want to consider trying WordPress dot com. Here are the differences between dot org and dot com.

    WordPress.com vs. WordPress.org

    nazcar, Ive opened both the wordpress index.php and my theme index.php and neither of those have that line in there. Heres what they have:
    wordpress index.php

    <?php
    /**
    * Front to the WordPress application. This file doesn’t do anything, but loads
    * wp-blog-header.php which does and tells WordPress to load the theme.
    *
    * @package WordPress
    */

    /**
    * Tells WordPress to load the WordPress theme and output it.
    *
    * @var bool
    */
    define(‘WP_USE_THEMES’, true);

    /** Loads the WordPress Environment and Template */
    require(‘./wp-blog-header.php’);
    ?>

    theme index.php

    <?php get_header(); ?>

    <?php if (get_option(‘artsee_format’) == ‘Blog Style’) { ?>
    <?php include(TEMPLATEPATH . ‘/includes/blogstyle.php’); ?>
    <?php } else { include(TEMPLATEPATH . ‘/includes/default.php’); } ?>

    <?php get_footer(); ?>

    </body>
    </html>

    I thought maybe it was because of encrypted affiliate urls but even with straight up .com’s its still messing up. The links work in some of my blog posts, but not in all. The text is just dead. Thanks for your help.

    kmessinger, Im aware of the differences between .org and .com. Having your own webhost for wordpress shouldnt mean being a master at html in order to enter a link.

    Moderator kmessinger

    @kmessinger

    kmessinger, Im aware of the differences between .org and .com. Having your own webhost for wordpress shouldnt mean being a master at html in order to enter a link.

    Sorry, you said . . .

    I thought with wordpress you can just install and blog. Im not a master at html and I dont know how to fix those problems or prevent them from happening in the future.

    From my link . . .

    WordPress.org Cons
    Requires more technical knowledge to set up and run

    I misunderstood your willingness to dig into code :^)

    BTW, the theme’s index.php is quite different from many I have seen but it has been working for you at least up to a point.

    I would again suggest you check the validation links above for both your html and liks. The links validation might give you a hint of what is going wrong.

Viewing 15 replies - 1 through 15 (of 35 total)
  • The topic ‘Links work in preview but not once published (?)’ is closed to new replies.
Skip to toolbar