Do I embed php code in html or call it from html. Not sure how to do either. Here is my html code w/ php and it produces blank page w/ favicon.
<!DOCTYPE html>
<!–[if lt IE 7 ]><html class=”ie ie6″ lang=”en”> <![endif]–>
<!–[if IE 7 ]><html class=”ie ie7″ lang=”en”> <![endif]–>
<!–[if IE 8 ]><html class=”ie ie8″ lang=”en”> <![endif]–>
<!–[if (gte IE 9)|!(IE)]><!–><html lang=”en”> <!–<![endif]–>
<head>
<!– Basic Page Needs
================================================== –>
<meta charset=”utf-8″>
<meta name=”author” content=””>
<!– Mobile Specific Metas
================================================== –>
<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>
<!– CSS
================================================== –>
<link rel=”stylesheet” href=”css/skins/default.css”>
<link rel=”stylesheet” href=”css/style.css”>
<link rel=”stylesheet” href=”css/skeleton.css”>
<link rel=”stylesheet” href=”css/responsive.css”>
<link rel=”stylesheet” href=”css/prettyPhoto.css”>
<link rel=”stylesheet” href=”css/fontello.css”>
<!– Oregano font –>
<link href=’http://fonts.googleapis.com/css?family=Oregano:400,400italic’ rel=’stylesheet’ type=’text/css’>
<!–[if lt IE 9]>
<script src=”http://html5shim.googlecode.com/svn/trunk/html5.js”></script>
<![endif]–>
<!– Favicons
================================================== –>
<link rel=”shortcut icon” href=”images/favicon.ico”>
<link rel=”apple-touch-icon” href=”images/apple-touch-icon.png”>
<link rel=”apple-touch-icon” sizes=”72×72″ href=”images/apple-touch-icon-72×72.png”>
<link rel=”apple-touch-icon” sizes=”114×114″ href=”images/apple-touch-icon-114×114.png”>
</head>
<body>
<?php get_pages( $args ); ?>
<?php
/*
Template Name: SLPosts
*/
/* Include header */
get_header();
?>
<!– Template sub-parent wrapper –>
<div class=”inner-page”>
<!– Template content wrapper –>
<div class=”page-content”>
<?php
if( function_exists(‘single_latest_posts_lite’) ) {
$parameters = array(‘title_only’ = ‘false’);
single_latest_posts_lite( $parameters );
echo “Title ” single_latest_posts_lite( $parameters )
}
/* Include Footer */
get_footer();
?>
</body>
</html>
Hi, if you want to embed Single Latest Posts into your current template, then just use the code below:
<?php
if( function_exists('single_latest_posts') ) {
$parameters = array('title_only' => 'false');
single_latest_posts( $parameters );
}
?>
Here you’ll find the code embedded into your HTML template: https://gist.github.com/anonymous/6722060
Be aware you must save it as a .php instead of .html, otherwise it won’t execute PHP code.
Cheers.