use of the <!--more--> tag (problems)

Soldato
Joined
26 May 2006
Posts
6,119
Location
Edinburgh
I have been asked to cut down the size of posts made on a website I designed using wordpress (Atahualpa 3.5.3 theme)

The client now wants post excerpts instead of full size news.

First I set the pages to be excerpts and to only be about 75 words.

They want there to be an image on the left and a consistent size of 180x180, then some text from the news with the rest being a "read more tag"

Now the problems I am having is this: I use tables to keep the alignment consistent.

so a general post for me is this:

<table>
<tr>
<td>
<180x180.image>
</td>
<td> (The full post of the text article here)
</td>
</tr>
</table>

If the text goes over 75 words, then it knocks the page completely to whack. The alignment goes off the page, which I think is due to the </table> tag getting cut off. due to the 75 word limit.

If I increase the word limit to fit the whole news article and try using a <!--more--> tag somewhere in the post. It doesn't work. The full post just continues to be posted.

Any ideas?

webpage is www.inveralmondchs.org

Working on the "news" section at the moment, but once I am happy with the format, this will be transferred to the home page.
 
First thing I would do would be to ditch the tables, they generally have no place in modern accessible web design (unless it's for a table of data) and are usually more hassle than anything as proven by your problem.
 
First thing I would do would be to ditch the tables, they generally have no place in modern accessible web design (unless it's for a table of data) and are usually more hassle than anything as proven by your problem.

I always thought tables were recommended to keep alignments of text/pictures etc. How do you recommend I format a the text?
 
Nowadays they're frowned upon as they're just not flexible; try rolling out a mobile themed version of your site when you're running tables and it's.. difficult.

Taking your 'important notice changes to parents' night' for example you could use for the body part (mostly your code just removed the table and used a bit of CSS to line up the text):

Code:
<div class="post-bodycopy clearfix" style="background: none repeat scroll 0 0 #F4F4F4;">
	<img src="http://inveralmondchs.org/wordpress/wp-content/uploads/2012/02/entrance_logo180x180.jpg" alt="You should always add meaningful alt tags too!" title="entrance_logo180x180" width="180" height="180" class="alignleft size-full wp-image-2229" />
	
	<div class="text" style="margin-left:200px">
		<p>Please be aware that the S2 into S3 Parents’ Evening that was due to take place at the end of this month has been moved from the 30th January to the <strong>6th February</strong>,</p>
		<p>sorry for any inconvenience and we look forwarding to seeing you in February.</p>
	</div>
</div>

(move the style tags out into the CSS, I just added it here for ease)
 
So do I add these two lines to my CSS page?

Code:
<div class="post-bodycopy clearfix" style="background: none repeat scroll 0 0 #F4F4F4;">
<div class="text" style="margin-left:200px">

?
 
Remove the style="" parts from the code above then to your CSS add:

Code:
.post-bodycopy {
background: none repeat scroll 0 0 #F4F4F4;
}

.text {
margin-left:200px;
}

(.text might be used elsewhere on the site, so to avoid that screwing everything up you might need to rename it)
 
Remove the style="" parts from the code above then to your CSS add:

Code:
.post-bodycopy {
background: none repeat scroll 0 0 #F4F4F4;
}

.text {
margin-left:200px;
}

(.text might be used elsewhere on the site, so to avoid that screwing everything up you might need to rename it)

Thanks for the help with the CSS. The problem remains with the <!--more--> tag being ignored unless the word limit is reached. :(
 
I think the theme needs to be set up to use the excerpts else it won't work properly. Been a while since I have worked with WP though.
 
examplecode.jpg

themesettings.jpg

doesntwork.jpg
 
Last edited:
The strangest thing just happened, I removed the news page and instead added the posts to the "home page" Now all the more tags work and they don't go off the page etc any-more.
 
Back
Top Bottom