2013-10-15, 03:02:24
Thanks Carlos
(2013-10-14, 04:12:18)Carlos Wrote: Create a component e.g. sticky-post with this content (edit first lines to customize it):
Code:<?php
$post = 'your-sticky-post-slug'; // <-- sticky post slug
$excerpt = true; // <-- false for full post
global $NMPAGEURL;
if (strval(get_page_slug(false))==$NMPAGEURL && !isset($_GET['post']) && !isset($_GET['page']) && !isset($_GET['tag']) && !isset($_GET['archive']) && !isset($_GET['search']))
nm_show_post($post,$excerpt);
?>
In your template, before <?php get_page_content(); ?>, insert:
Code:<?php get_component('sticky-post'); ?>
That's it.
(It could be easily improved to insert the sticky post in a div with a class or id, so that it can be highlighted using styles.)