• Would appreciate if anyone could point me to a tutorial that shows how to show a page title, excerpt and read more link on a home page.

    I want to create a page template so will code the functionality directly into that page and style with css

    What I am having an issue with is finding a clear set of instructions on how to go about it. My knowledge of the codex is pretty average and php not great, but I have a pretty decent grasp of how to put things together.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter michaeloc

    (@michaeloc)

    Would appreciate if anyone could point me to a tutorial that shows how to show a page title, excerpt and read more link on a home page.

    I want to create a page template so will code the functionality directly into that page and style with css

    What I am having an issue with is finding a clear set of instructions on how to go about it. My knowledge of the codex is pretty average and php not great, but I have a pretty decent grasp of how to put things together.

    Thread Starter michaeloc

    (@michaeloc)

    link to test site

    I have managed to put together this code, can anyone advise how to add html tags to the title and excerpt so that I can style them individually.

    <?php
    $page_id = 5;
    $page_data = get_page( $page_id );
    $content = $page_data->post_content;
    $title = $page_data->post_title;
    echo $page_data->post_title;
    echo $page_data->post_excerpt;
    ?>
    
    <a href="<?php echo get_permalink( 5 ); ?>">page link</a>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘page title, excerpt and read more link on homepage’ is closed to new replies.