Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




stick_post [ WordPress Function ]

stick_post ( $post_id )
Parameters:
  • (int) $post_id Post ID.
Defined at:



Make a post sticky.

Sticky posts should be displayed at the top of the front page.

Source


<?php
function stick_post($post_id) {
    
$stickies get_option('sticky_posts');

    if ( !
is_array($stickies) )
        
$stickies = array($post_id);

    if ( ! 
in_array($post_id$stickies) )
        
$stickies[] = $post_id;

    
update_option('sticky_posts'$stickies);
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics