WordPress.org

Ready to get started?Download WordPress

Forums

Single Latest Posts Lite
New User need help (4 posts)

  1. jneibel@mirroredstorage.com
    Member
    Posted 9 months ago #

    I have an existing WP that I am converting over to new website. I am using a template that has space for post on each page and a custom blog.html page. I did not have a function.php so I created one w/ the the following:
    <?php
    add_theme_support('post-thumbnails');
    ?>

    I am not clear on how to embed the what in my html to get the posts pulled and displayed.

    Can you provide html code examples?

    http://wordpress.org/plugins/single-latest-posts-lite/

  2. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 9 months ago #

  3. jneibel@mirroredstorage.com
    Member
    Posted 9 months ago #

    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="72x72" href="images/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.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>

  4. Jose Luis SAYAGO
    Member
    Plugin Author

    Posted 9 months ago #

    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.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.