Limit article to 100 characters. Can’t use the_excerpt…

function get_custom_excerpt( $content, $link ){ $content = some_function_to_handle_html_tag(substr($content, 0, 100)); // EDIT: need to be customized with a regex for proper output $content .= ‘ <a href=”‘.$link.'”> more… </a>’; return $content; } function some_function_to_handle_html_tag(){ //a regex to check last occurance of html opening tag //append respective closing tag or strip the tag if broken e.g. … Read more

Make the title and […] clickable in result search

As for the_title(), you can wrap your title in anchor tag, use get_permalink() to get the path to the single post. Something like this will do the_title( ‘<h1 class=”entry-title”><a href=”‘ . esc_url( get_permalink() ) . ‘” rel=”bookmark”>’, ‘</a></h1>’ ); For any info on how to modify/style the_excerpt(), check out this post I have recently done. … Read more

Excerpt length: get 2 paragraphs

I have modified the earlier solution to your needs. You need to change following line $wpse0001_excerpt = substr( $wpse0001_excerpt, 0, strpos( $wpse0001_excerpt, ‘</p>’ ) + 4 ); to this $wpse0001_excerpt = explode(‘</p>’, $wpse0001_excerpt, 3); // unset the rest of the contents if(isset($wpse0001_excerpt[3])) unset($wpse0001_excerpt[3]); // append </p> to the end of last paragraph if(isset($wpse0001_excerpt[2])) $wpse0001_excerpt[1] .= … Read more

need help with ‘… read more’ excerpt in functions.php

Took me a couple of blind tries, but I got it. Before: <a class=”view-article” href=”‘ . get_permalink($post->ID) . ‘”>’ . __(‘View Article’, ‘html5blank’) . ‘</a>’; After: <a data-toggle=”modal” data-target=”#modal-‘ . $post->ID . ‘ ” class=”over”>’ . __(‘View Article’, ‘html5blank’) . ‘</a>’

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)