How do I use ‘git reset –hard HEAD’ to revert to a previous commit? [duplicate]

First, it’s always worth noting that git reset –hard is a potentially dangerous command, since it throws away all your uncommitted changes. For safety, you should always check that the output of git status is clean (that is, empty) before using it. Initially you say the following: So I know that Git tracks changes I make to my application, … Read more

How do I delete a Git branch locally and remotely?

Executive Summary Note that in most cases the remote name is origin. In such a case you’ll have to use the command like so. Delete Local Branch To delete the local branch use one of the following: Note: The -d option is an alias for –delete, which only deletes the branch if it has already been fully merged in its upstream branch. … Read more

SyntaxError: unexpected EOF while parsing

The SyntaxError: unexpected EOF while parsing means that the end of your source code was reached before all code blocks were completed. A code block starts with a statement like for i in range(100): and requires at least one line afterwards that contains code that should be in it. It seems like you were executing your program line by … Read more

Adding WordPress Header and Footer to a PHP Script

If you want to add WordPress Header & Footer in a PHP script flow those stapes: Step-1: Upload Your PHP project in the WordPress root folder. Step-2: Added this code on the PHP script header: Well Done! Now you can use all wp functions in your PHP project, like wp_head(), wp_footer(), get_header(), get_footer(), and more.

How to count the current posts terms WordPress

wp_count_terms the function counts terms in a given taxonomy (e.g. total number of categories, total number of tags). To get what you want, get the terms for the post and just count them count( wp_get_post_terms( $post_id, $taxonomy, $args ) );. Or, assuming that in real life you might need those terms later: count() function help you to … Read more