The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager Sticky Post
#3
Thanks Carlos Smile

(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.)
Reply


Messages In This Thread
News Manager Sticky Post - by shijax - 2013-10-12, 00:35:00
RE: News Manager Sticky Post - by Carlos - 2013-10-14, 04:12:18
RE: News Manager Sticky Post - by shijax - 2013-10-15, 03:02:24



Users browsing this thread: 1 Guest(s)