How to add “Stick this post to the front page” to front end?

I think this small source code is your solution. It currently doesn’t have frontend feedback for the Sticky Post change, but you can enhance this string, class or whatever you want in the function fb_stick_post. The first function adds the item in the Admin Bar and creates a new Url with a param value. Also, … Read more

is_front_page() malfunction?

Just speculation, but I wonder if you’re running into an anonymous function problem. Anonymous functions are allowed in WP, and usually work fine (presuming updated PHP), but, if you search around you’ll find reports of suspected bugs or at least of unexpected behavior. For that matter, I’m not sure that I’ve ever seen an anonymous … Read more

Programmatically set page_on_front

get_page_by_title() returns an object. Use $homepage->ID. You should also check if you really got a usable return value: $homepage = get_page_by_title( ‘Front Page’ ); if ( $homepage ) { update_option( ‘page_on_front’, $homepage->ID ); update_option( ‘show_on_front’, ‘page’ ); }