Content Restriction but allow public REST API

You can use the REST_REQUEST constant to detect if this is a REST request, and if it’s not, apply your filter(s). Example: add_filter( ‘the_content’, ‘wpse418531_use_excerpt’ ); /** * Replaces the content with the excerpt, unless this is a REST request. * * @param string $content The post content. * @return string The filtered post content. … Read more

How to handle parent and child pages?

Problem 2: displaying the 3 panels. Do I set these up as individual children elements? If so, how can I style each one differently as it loops through? There are only 3 items. Don’t loop through them. Use get_posts() to place them in an array and then step through each array item: $panels = get_posts( … Read more

Get the excerpt of post_content

I’m sure if you did some more research you would find this as it’s been asked many times before. If you just want all expert to return the value of 15 then you have to add something like this to your functions.php // Customize excerpt word count length function custom_excerpt_length() { return 15; } add_filter(‘excerpt_length’, … Read more

How to show NEW post content in post editor?

try wp update post function: // Update post 37 for example $my_post = array( ‘ID’ => 37, ‘post_title’ => ‘This is the post title.’, ‘post_content’ => ‘This is the updated content.’, ); // Update the post into the database wp_update_post( $my_post ); https://codex.wordpress.org/Function_Reference/wp_update_post

tech