Hello, I got problem to write code excerpt in my article.
CREATE TABLE IF NOT EXISTS 'articles' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'title' varchar(250) NOT NULL,
'body' text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
INSERT INTO 'articles' ('id', 'title', 'body') VALUES
(1, 'Lorem', 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry''s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.');
Article class
class Article_class {
protected static $table_name = 'articles';
public $id, $title, $body;
public static function get_articles() {
try {
global $database_handle;
$sql = "SELECT * FROM " . self::$table_name;
$statement = $database_handle->sql_query($sql);
$statement->setFetchMode(PDO::FETCH_OBJ);
while($row = $statement->fetch()) {
$data[] = $row;
}
return $data;
} catch(PDOException $pdo_exception) {
die("Error " . $pdo_exception->getMessage());
}
}
}
That code is working fine in my view template, What I really want is how to create the excerpt for 5 line. I already search in Google, but I can't find it, too many Wordpress excerpt code.
Btw where is the seacrh form, I can't find, in top is for all, not for PHP only.