How you change wordpress admin footer text

Sometimes you did not want to show default wordpress admin footer and want to replace with your text and logo. This example is for this purpose. So you can easily change wordpress admin footer without any big changes. You just need to copy paste below code in functions.php file.

//change the footer text

function custom_admin_footer_text () {
 echo '<img src="' . plugins_url( 'images/custom-icon.png' , __FILE__ ) . '">Dummy text goes here.';

}
add_filter( 'admin_footer_text', 'custom_admin_footer_text' );

How to get post details by post id

get_post retrieve post data by post id. This is wordpress function with 3 parameters.

<?php get_post( $id, $output, $filter ); ?> 

$id : Here you will pass id of the post you would like to get data.
$output : This is optional value. Default value is OBJECT
OBJECT – (default) returns a WP_Post object
ARRAY_A – Returns an associative array of field names to values
ARRAY_N – returns a numeric array of field values
$filter: This is also an optional. It filter the post.

Example:

<?php 
$showpost=get_post( 2 ); 
$post_title=$showpost->post_title;
?> 

Get Custom Field Value of POST

There is wordpress function get_post_meta, used to get custom field value of post.

<?php $meta_values = get_post_meta( $post_id, $key, $single ); ?>

$post_id is POST ID which you can get in loop. If you are not using default loop of wordpress then use global $post and then you can find post id value through $post->ID.
$key is for custom field name which you were insert from admin or code.
$single is optional. If set to true then the function will return a single result, as a string. If false, or not set, then the function returns an array of the custom fields.

Example:
Key is featured_image then

 get_post_meta( $post_id, ‘featured_image’ );

Why would WordPress throw a 404 error on a POST form submit in template

I was working on a WordPress project when I face this problem. It’s not any big deal. I have a form in custom template with 5 fields. But when I clicked on the submit button it shown 404 errors. So then I found that if you are using $_POST, $_GET or $_REQUEST with a post or get method in form the first check form fields name.
Eg. You have 2 fields with a username and email. These names used by WordPress. So just change the name and id of fields and then try to submit the form. It’s just simple.