Jump to content

count caracters


edou

Recommended Posts

Hi,

 

I'm trying to make a website using wordpress and would like to find a way to count the amount of caracters used in a message in order to stop displaying at a certain point with a link like 'read more', linking to the specific page of this message.

 

Can anyone help.

It's probably basic, but I'm really new with php.

 

Thanks.

 

E

Link to comment
https://forums.phpfreaks.com/topic/274124-count-caracters/
Share on other sites

could you be more specific. I really know nothing about php.

 

I think the function that's now counting the following is:

 

if ( count($content) > 1 ) {

if ( $more ) {

$output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];

} else {

if ( ! empty($more_link_text) )

$output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );

$output = force_balance_tags($output);

}

 

}

 

 

The problem with that, is that if I place pictures after my text, it won't display it unless I click 'read more'. So I'm obliged to place first my pictures, which is not so nice to see.

Link to comment
https://forums.phpfreaks.com/topic/274124-count-caracters/#findComment-1410700
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.