I'm creating a blog and would like to know how to do the following:
On the home page I display the title, an image and a summary of the post, and clicking the "Read All" button opens the post completely in another browser window, such as in internet blogs.
I've been developing as follows: I've done the entire layout of a website for a business in my city, more exactly a building materials store, and a news portal was also requested.
I'm just running tests on an external project, before incorporating it into the site code. I'll post the code so you can see. I'm very lay with PHP, I'm using Notepad ++ to develop my code.
<?php require( 'conectar.php') ?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Blog</title>
</head>
<body>
<?php $sql=m ysql_query( " SELECT * FROM postagem ORDER BY data DESC"); $conta=m ysql_num_rows($sql); if($conta <=0 ){ echo '<h2>Nenhuma postagem encontrada.</h2>'; }else{ while($res=m ysql_fetch_array($sql)){ ?>
<div class="postagem"> <span> <h2><a><?php echo $res['titulo']; ?></a></h2> </span> <span> <h3><a><?php echo $res['postagem']; ?></a></h3> </span>
</div>
<?php }} ?>
</body>
</html>
I found the following function.:
function new_excerpt_more($more) {
global $post;
return ‘… <a href=”‘. get_permalink($post->ID) . ‘”>’ . ‘Ler matéria completa »’ . ‘</a>’;
}
add_filter(‘excerpt_more’, ‘new_excerpt_more’);
Would I be able to apply it to my need?