Post title gets cut off "….."
-
Can’t figure out how to keep the post title’s of my site to display completely. Get cut off early. Any help would be awesome. Thanks!
-
Hi WRevolves,
Could you please indicate which title gets cut off? Your home page is fine and when I visit the full post page, I can’t see any cut-off title. Did you perhaps mean that long titles wrap to the next line? If this is so, it’s the natural flow of the web page, it’s not a problem. You could reduce the font size to make it fit all on one line, but that’s all.
A problem that I can see, however, is that your website is not responsive. This means that when it’s being accessed from a mobile device, it doesn’t adapt itself to the smaller screen size and the user experience is therefore compromised.
Best ??
– Maria AntoniettaHmmmm… what browser are you on? My phone and laptop are on Chrome. Both are presenting the site flawlessly except that the titles cut off after 20 letters on the homepage. That’s my problem. That I want to be able to fit the entire post title on the homepage and not have them cut off after 20 letters.
edit: I see what you mean about mobile theme and them adjusting to a smaller size automatically for easier viewing. You’re correct. I need to look into that.
edit 2: 20 LETTERS not WORDS. LOL. sorry. Trying to watch a baby today and web. Not going well…. bein’ a bad dad ??
Sorry, you probably mean the titles on top of the thumbnails. I guess there must be a function in the theme that limits the number of characters in that specific area of the site. I’ll have a look at the code, but I’m not sure I can do it tonight. I’ll get back to you on this definitely tomorrow.
Yeah, sorry, I guess I didn’t specify. I’ve gone through every step I know to take and can’t figure it out :/ Thanks!
Hi, just went through your theme’s functions.php file and couldn’t find anything that would limit the number of characters in the title of excerpts, only the number of characters in the body of the excerpt (which is 40). It could be the location of the more break in the post.
To check, go to one of the posts and open it for edit. Then click on the Text tab and make sure the <!–more–> tag is not mixed up with the title text. If it is, simply move it below it.
I hope it works ??
Nope. Nothing wrong in there. And in the Category archive pages it shows up perfectly fine. Just the homepage, in front of thumbnail, default that came with the theme. Which now is just pissing me off. Grrr. Thanks for trying!
I could replicate the issue on my server. However, are you sure you want to stick with this theme? I accessed it on the WP.org repository to download it and there’s a notice alerting the user that the theme hasn’t been updated or supported for over 2 years and it may therefore have compatibility issues with latest releases of WP. I’m not saying it has issues, but there’s a risk of that. Besides, this explains why the theme isn’t responsive, which is the expected standard for the latest themes. I recommend you look into this aspect of the situation before tackling customization tasks.
I downloaded your theme’s files and found the code that’s causing the issue. It’s in index.php and it’s an if else statement. It basically states that if the title has more than 25 characters it gets cut off. I think this is due mainly to aesthetic reasons: it doesn’t look that pretty with long titles. However this can be fixed with CSS. Here’s what you need to do: open index.php (I hope you’ve been using a child theme for this, although there haven’t been theme updates for 2 years). Find these lines of code:
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php if (strlen($post->post_title) > 25) { echo substr(the_title($before = '', $after = '', FALSE), 0, 25) . '...'; } else { the_title(); } ?></a>
Replace them with this snippet:
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php echo the_title(); ?></a>
You basically echo out the title without if … else conditional statement.
That said, the problem of using an unsupported theme still remains. Think about an upgrade. Perhaps you could get in touch with the theme’s author and ask him if he intends to support his theme.
I hope this helps ??
Have a great Sunday!Hi WRevolves,
How is it going? Has the solution worked out for you?
- The topic ‘Post title gets cut off "….."’ is closed to new replies.