0

Is there a bit of PHP I can use to grab the sticky blog post (there will only ever be one) to drop into my homepage template file?

1
  • What have you tried? Have you tried a custom WP_Query for sticky posts? Please edit your question to include your "homepage template", and whatever code you've tried. Nov 18, 2014 at 18:22

1 Answer 1

0

Straight out of the Codex:

$sticky = get_option( 'sticky_posts' );
$query = new WP_Query( 'p=' . $sticky[0] );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.