I think you should use the post_submitbox_misc_actions
add_action( 'post_submitbox_misc_actions', 'publish_in_frontpage' );
function publish_in_frontpage($post)
{
$value = get_post_meta($post->ID, '_publish_in_frontpage', true);
echo '<div class="misc-pub-section misc-pub-section-last">
<span id="timestamp">'
. '<label><input type="checkbox"' . (!empty($value) ? ' checked="checked" ' : null) . 'value="1" name="publish_in_frontpage" /> Publish to frontpage</label>'
.'</span></div>';
}
Related Posts:
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Widgets not showing in my custom theme
- How to add just one specific page to widget without plugin?
- Extending the WP_Widget_Text class
- Hook called before text widget save
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Inserting a class on before_widget if checkbox is checked
- Widget header unique classes
- How to include checkbox in widget backend form?
- Limit the number of inactive widgets
- Cleaning up WordPress to improve performance?
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- Remove option to allow trackbacks/pingbacks from post page options
- How to remove hardcoded characters from playlists?
- Creating custom Woocommerce attribute taxonomies from a plugin
- Load post content into iframe
- wp_customize_image_control default value
- Get the sidebar ID in which the current widget was dropped
- Transform php code into a widget?
- Search and Replace in database: How to replace data in SQL dump file on Windows?
- WordPress widget in custom theme
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- Anything I can add to functions.php to make text widgets accept PHP?
- WordPress menu deletes when trying to add a hook
- Overriding a theme redux file in child theme
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- How to display custom field on homepage
- How to get 2 or multiple custom post types in wordpress functions.php
- Creating bulk posts with Youtube videos
- Change the site tagline (or similar) based on current page
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- create a select input with menus created on a custom options page
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- How to pick the default selected value in wordpress dropdown?
- How to add a do_action on refreshing of WP customizer?
- Customize position of social icons in upme plugin [closed]
- Weird 404 URL Problem – domain name being placed at end of urls
- Hide subcategories (widget)
- Adding a widget function into the php theme file
- How to edit widget code to add unique class name to each div?
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- Media Upload , file name changed automatically
- Replace shortcode in substring
- Archives shortcode displaying above widget title
- Widgets in the loop if active
- How to obtain the current website URL in my theme?
- What exactly do this function declared into functions.php file of a WP theme?
- customize wordpress database error page
- Echo title attribute php
- str_replace with the_content is not working
- Ajax search shows all results when user empties input?
- List post by title length
- Need help with pagination
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- List of Events with Multiple Dates: Only NEXT Date
- Editor capabilities – admin_init
- WP insert post Redirect after function has executed
- How can I add diffrent editable text fields?
- How a HTML form can trigger a PHP function?
- Retrieve the whole widget sidebar and pass it inside an html
- Hide A Class and Add Custom HTML Code Using WordPress
- Featured image in menu wordpres
- How to stop hiding buttons forward / backward in pagination?
- How to create a widget with a populated dropdown?
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Dynamic “home” image and URL based on current folder
- Need help transforming echo to return for use with shortcode
- Noob question: want to remove the “site identity” logo for specific part of website only
- Redirect after login depending on the URL
- Autoloading Classes in Plugins
- Automatically refresh page if widget is added to page?
- Real time notification on user profile after new comment
- How to add text before posts
- Add two or multiple functions in WordPress Post or Page
- Show content by using tags
- Widget Update problems using a for loop
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Non-static method error when trying to use class in widgets
- WordPress error on my website
- Slider from different widgets
- Even with PHP plugin get_posts not working in widget area
- how to run a php code in widget?
- Use custom get results query to show posts WordPress
- media-uploader insert into post is not inserting
- Best way to define a database with product codes and back-end support?
- List sibling pages widget, exclude current page
- How to show all of aspecific post type that has taxonomy and a specific term
- wp_customize_image_control default value
- How to hide something from custom home page with php code?
- Banner editable from backend
- How to add button to top of theme customizer?
- Using a loop to build and update widgets
- Display a list of users with avatar filterable with alphabets
- How can I add more code to this?
- How does one programmatically manage posts from a external php script?
- New to WordPress & Freelancing [closed]