• I want to put a single post title (clickable link to the full story) on a static page so it looked like this – eg:

    Embotics News: When the Cloud Clears… (this being the post title and clickable link)

    Could anyone advise what the code might look like, please

    All of my template pages have the php code for posts etc.

    I just want to pull up a single random post (just the title) from a particular category (that I want to select which will be relevant to the particular page)

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • See a page of posts for some examples.

    Thread Starter completesource

    (@completesource)

    Thanks for the suggestion Esmi.

    Strangely I already have a page of Posts which displays all my news stories

    I am just looking for a bit of code that I can put in the HTML editor of a particular page.

    EG: I have a page http://www.completesource.co.uk/software/embotics-private-cloud-management/
    It is a Static page with text and images (information page about a product we sell). I want to put a line in that says:

    Embotic News: THE POST TITLE HERE (this being the link to the full story)

    the Page is assigned to a template called Side Bar Template – I use this template for most of my pages and it has the following code in it for posts

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button.]

    Any ideas, please

    Thanks in advance

    You cannot add code to the editor. It has to be added via a template file. You need to look at creating a custom page template – as suggested in A_Page_of_Posts .

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Single post title on a static page’ is closed to new replies.