How to display working php page name in WordPress ?

To display display working php page name in WordPress
add below code in header.php inside theme folder

 echo  get_page_template()."gggggggggg";
     exit;

See out put

 OUTPUT "/wp-content/themes/twentyseventeen/pages.phgggggggg"

default build in functon is located inside ‘wp-includes/template.php’ folder

function get_page_template() {
    $id = get_queried_object_id();
    $template = get_page_template_slug();
    $pagename = get_query_var('pagename');
 
    if ( ! $pagename && $id ) {
        // If a static page is set as the front page, $pagename will not be set. Retrieve it from the queried object
        $post = get_queried_object();
        if ( $post )
            $pagename = $post->post_name;
    }
 
    $templates = array();
    if ( $template && 0 === validate_file( $template ) )
        $templates[] = $template;
    if ( $pagename ) {
        $pagename_decoded = urldecode( $pagename );
        if ( $pagename_decoded !== $pagename ) {
            $templates[] = "page-{$pagename_decoded}.php";
        }
        $templates[] = "page-{$pagename}.php";
    }
    if ( $id )
        $templates[] = "page-{$id}.php";
    $templates[] = 'page.php';
 
    return get_query_template( 'page', $templates );
}

How to add a display Title before the Enter title here field wordpress admin post

To add display Title before title field in wordpress admin post

1) Open your theme functions page
add below code

 function ps_edit_form_top() 
 { 
echo ' </code></pre> <h2>Post Name</h2> ';
 } 

add_action( 'edit_form_top', 'ps_edit_form_top');

To add display Title before Content Editor field in wordpress admin post

add below code

function add_content_before_editor_post()
{
 echo '</pre><h2>Content/Description</h2>'; 
} 
add_action('edit_form_after_title', 'add_content_before_editor_post' );

How to remove all html tag from WordPress post_content Using SQL ?

 
$dbname = DB_NAME;
$servername = DB_HOST ;
$username = DB_USER ;
$password = DB_PASSWORD ;
try {
    $conn = new PDO(“mysql:host=$servername;dbname=$dbname”, $username, $password);
    // set the PDO error mode to exception
    $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    echo “Connected successfully”;
$sql=”SELECT  post_content,ID  FROM wp_posts WHERE  post_type=’resources’  AND post_status=’publish'”;
 
$page=$conn->prepare($sql);
$page->execute();
$row = $page->fetchAll(PDO::FETCH_ASSOC);
foreach($row as $values)
{
$post_content=clean(strip_tags($values['post_content']));
$id=$values[‘ID’];
 
if(($id>0)&&($post_content!=”))
{
$sql1=”UPDATE wp_posts SET  post_content='”.$post_content.“‘ WHERE post_type=’resources’ AND post_status=’publish’ AND ID='”.$id.”‘”;
$page=$conn->prepare($sql1);
$page->execute();
}
 
}
}
catch(PDOException $e)
 {
    echo “Connection failed: ” . $e->getMessage();
 }
function clean($string) {
   //$string = str_replace(‘ ‘, ‘-‘, $string); // Replaces all spaces with hyphens.
 
   return preg_replace(‘/[^A-Za-z0-9 \-]/’, ”, $string); // Removes special chars.
}