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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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