WordPress.org

Ready to get started?Download WordPress

Forums

Links work in preview but not once published (?) (36 posts)

  1. girliegirl
    Member
    Posted 5 years ago #

    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.

  2. f00bar
    Member
    Posted 5 years ago #

    Hi, can you give me a link to your blog please?

  3. girliegirl
    Member
    Posted 5 years ago #

    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

  4. f00bar
    Member
    Posted 5 years ago #

    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 :D

  5. girliegirl
    Member
    Posted 5 years ago #

    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.

  6. f00bar
    Member
    Posted 5 years ago #

    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!

  7. girliegirl
    Member
    Posted 5 years ago #

    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.

  8. f00bar
    Member
    Posted 5 years ago #

    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...

  9. girliegirl
    Member
    Posted 5 years ago #

    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.

  10. nazcar
    Member
    Posted 5 years ago #

    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.

  11. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    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.

  12. girliegirl
    Member
    Posted 5 years ago #

    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.

  13. nazcar
    Member
    Posted 5 years ago #

    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.

  14. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

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

    http://support.wordpress.com/com-vs-org/

  15. girliegirl
    Member
    Posted 5 years ago #

    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.

  16. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    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.

  17. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    Looks like the links are now working.

  18. girliegirl
    Member
    Posted 5 years ago #

    No, links are still not working. Heres an example...In this post, the words Beyond The Rack are linked and work fine...http://www.couponboom.com/2009/06/beyond-the-rack/
    But in this post, the words Google Coupons are linked but not working, just dead text.
    This is what confuses me, why it would work in some posts but not in others?
    Thanks for your time.

  19. girliegirl
    Member
    Posted 5 years ago #

    Oops, forgot to add the Google Coupon post.... http://www.couponboom.com/2009/06/google-coupons/

  20. nazcar
    Member
    Posted 5 years ago #

    yeah.exactly same. the links in your blog entries will work in a single post page but not in the main page, its like it didplays only an excerpt from that post.

    check default.php, whats inside that template?
    does it have this code?

    if(is_home()) {
                  if(strlen(get_the_content())>380)
                    echo substr(strip_tags(get_the_content()),
  21. girliegirl
    Member
    Posted 5 years ago #

    Hmm, I dont seem to have a default.php. Where would that be? Its not in the main directory, or the theme directory.

  22. nazcar
    Member
    Posted 5 years ago #

    theme directory..
    or inside
    theme directory/theme-name/includes/default.php

  23. kmessinger
    Volunteer Moderator
    Posted 5 years ago #

    The google coupon link in the post http://www.couponboom.com/2009/06/google-coupons/
    works for me.

  24. girliegirl
    Member
    Posted 5 years ago #

    nazcar, I found the default.php and I dont see the code you showed....do you?

    <div id="container">
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/content-top-home.gif" alt="logo" style="float: left;" />
    <div id="left-div">

    <!--Begind recent post-->
    <?php if (have_posts()) : while (have_posts()) : the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

    <div class="home-post-wrap">

    <div class="date">
    <div class="month"><?php the_time('M') ?></div>
    <div style="clear: both;"></div>
    <div class="day"><?php the_time('j') ?></div>
    </div>

    <div class="post-right">
    <div class="featured-categories"><?php the_category('') ?></div><span class="author-link"><?php the_author_posts_link(); ?> </span>
    <div style="clear: both;"></div>
    <h2 class="titles">" title="Permanent Link to <?php the_title(); ?>"><?php the_title() ?></h2>
    <div style="clear: both;"></div>
    <?php $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true); ?>
    <?php if($thumb !== '') { ?>
    " title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php echo $thumb; ?>&h=165&w=165&zc=1" alt="<?php if($thumb_alt !== '') { echo $thumb_alt; } else { echo the_title(); } ?>" class="thumbnail" />
    <?php } else { echo ''; } ?>
    <?php the_content_limit(410, ""); ?>
    </div>

    </div>

    <?php endwhile; ?>

    <div style="clear: both;"></div>
    <div style="margin-left: 110px; margin-top: 5px;">
    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    else { ?>
    <p class="pagination"><?php next_posts_link('« Previous Entries') ?> <?php previous_posts_link('Next Entries »') ?></p>
    <?php } ?>
    </div>

    <?php else : ?>

    <h2 >No Results Found</h2>

    <p>Sorry, your search returned zero results. </p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>
    <img src="<?php bloginfo('stylesheet_directory'); ?>/images/content-bottom.gif" alt="logo" style="float: left;" />
    </div>

    kmessinger......I meant not from the front page, where the snippet of the blog post is.

  25. nazcar
    Member
    Posted 5 years ago #

    this one:

    <?php the_content_limit(410, ""); ?>

    try replacing that code with this one:

    <?php the_content('more...'); ?>

    PS: backup that default.php, just in case.

  26. girliegirl
    Member
    Posted 5 years ago #

    Well, not so sure thats the solution but it will work for now. In my theme options theres a list for how I want the blog to be viewed in post format or default. I was using default and your code basically changed it to a post format. Not a fix but it does make the links active right up front so I guess Ill stick with it for awhile.
    Thanks so much for the help!

  27. nazcar
    Member
    Posted 5 years ago #

    you can insert <!--more--> tag in your post to cut the text to be viewed on your main page.

  28. girliegirl
    Member
    Posted 5 years ago #

    Thats slick, thank you. Ive only been using wordpress for a week or so now but Ill get the hang of it.....sooner or later.
    Thanks for your help, and for dropping in! ;)

  29. Coryan
    Member
    Posted 5 years ago #

    This is exactly the problem I have having. Links work in preview and single post mode, but not on main page. I have looked everywhere in the theme directory for the default.php, and can't find it anywhere. Is it possible that a theme would not have a default.php?

  30. SecondHelping
    Member
    Posted 5 years ago #

    I'm having the same problem at http://www.secondhelpingonline.com -- it's working on main page, but not posts.

    this is incredibly frustrating.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags