How to hide the Text Area in the Post Edit screen
In your functions.php file where the custom post type is registered do you see: ‘supports’ => array(‘title’,’editor’,’thumbnail’) or something similar? If so remove ‘editor’
In your functions.php file where the custom post type is registered do you see: ‘supports’ => array(‘title’,’editor’,’thumbnail’) or something similar? If so remove ‘editor’
WordPress picks the lowest ID as its main permalink. However, ALL categories will contain your post automatically. Meaning both these: http://yoursite/category-A/post-A http://yoursite/category-B/post-A …will return your post (given that post-A is in both category-A and category-B) via a redirect. It can’t list them all to you on the Edit page, sorry. But it will make sure … Read more
I took the example code from the WordPress user_has_cap filter codex page and modified it. Add this code to your theme functions.php: function restrict_editing_old_posts( $allcaps, $cap, $args ) { // Bail out if we’re not asking to edit or delete a post … if( ( ‘edit_post’ != $args[0] && ‘delete_post’ != $args[0] ) // … … Read more
You can add code below to the beginning of loop.php add_action(‘pre_get_posts’, ‘wpse_change_post_order’); function wpse_change_post_order($query){ $query->set(‘order’,’ASC’); $query->set(‘orderby’,’date’); } the oldest posts will be in the home page.
There a couple of ways you can go about it depending on your use case and although example number 1 is perfectly valid, it might make more sense to employ the use of example number 2. Example #1: This will send you an email each time a post is updated/published with the status of “pending”. … Read more
$the_category_id = 10; $new_posts = new WP_Query( array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array( $the_category_id ), ‘field’ => ‘term_id’, ‘operator’ => ‘AND’, ‘include_children’ => false ) ) ) ); So basically the difference is include_children parameter.
Don’t forget to use esc_url() echo ‘<a href=”‘. esc_url( $link ).'”>Welcome</a>’; Also try this: get_permalink( get_the_ID() );
The documentation for get_children isn’t great (at the time of this answer), however get_children is simply a wrapper for get_posts(). This means that orderby and order are valid arguments for your query. When you ask, “how i get them with the order as i needed“, is the property you wish to order them by a … Read more
You have to add the following lines at the top of your post template file: <?php /* * Template Name: Featured Article * Template Post Type: post, page, product */ get_header(); ?> Of course replace “Featured Article” with your desired template name and the list of post types with the post types you want to … Read more
The block editor is restoring back the title that was last saved (or typed manually into the textarea), so with the block editor, you can change the title dynamically using this code: wp.data.dispatch( ‘core/editor’ ).editPost( { title: ‘Title here’ } ) PS: You should make sure your JS file has the wp-editor, wp-edit-post or wp-data … Read more