Redirect a successful registration to specific page in WordPress

Put this code in function.php

function wps_registration_redirect(){
    return home_url( '/finished/' );
}
add_filter( 'registration_redirect', 'wps_registration_redirect' );

Remove WordPress logo from admin bar

Add this code to your functions.php file to remove the WordPress logo on admin bar.

<?php
function annointed_admin_bar_remove() {
 global $wp_admin_bar;

 /* Remove their stuff */
 $wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);
?>

The Difference Between query_posts and WP_Query in wordpress

According to the WordPress Codex, there is actually a distinct difference between WP_Query() and query_posts(),

The query_posts() function is intended to be used to modify the main page Loop only. It is not intended as a means to create secondary Loops on the page.
If you want to create separate Loops outside of the main one, you should create separate WP_Query() objects and use those instead.
Use of query_posts() on Loops other than the main one can result in your main Loop becoming incorrect and possibly displaying things that you were not expecting.

wordpress-theme-cheat-sheet-for-beginners

Basic Template Files

Below is the list of basic files that every theme should have.

  • style.css
  • header.php
  • index.php
  • sidebar.php
  • footer.php
  • single.php
  • page.php
  • comments.php
  • 404.php
  • functions.php
  • archive.php
  • searchform.php
  • search.php

Codes in Header.php

<?php bloginfo(‘name’); ?> – Title of the Blog, or Blog Name

<?php wp_title(); ?> – Title of a Specific Page

<?php bloginfo(‘url’); ?> – Exact URL for the Site

<?php bloginfo(‘description’); ?> – Site’s Description

<?php bloginfo(‘template_url’); ?> – Location of Site’s Theme File

<?php bloginfo(‘stylesheet_url’); ?> – Link to the Style.css location

<?php bloginfo(‘rss2_url’); ?> – RSS Feed URL for the Site

<?php bloginfo(‘pingback_url’); ?> – Pingback URL for the site

<?php bloginfo(‘version’); ?> – WordPress Version Number

Codes for Other Template Files

<?php get_header(); ?> – Displays Header.php file content

<?php get_footer(); ?> – Displays Footer.php file content

<?php get_sidebar(); ?> – Displays Sidebar.php file content

<?php comments_template(); ?> – Displays Comment.php file content

<?php the_content(); ?> – Displays the Content of the Post

<?php the_excerpt(); ?> – Displays the excerpt that is used in Posts

<?php the_title(); ?> – Title of the Specific Post

<?php the_permalink() ?> – Link of the Specific Post

<?php the_category(‘, ‘) ?> – Category of a Specific Post

<?php the_author(); ?> – Author of the Specific Post

<?php the_ID(); ?> – ID of a Specific Post

<?php edit_post_link(); ?> – Edit link for a Post

<?php next_post_link(‘ %link ‘) ?> – URL of the Next Page

<?php previous_post_link(‘%link’) ?> – URL of the Previous Page

<?php get_links_list(); ?> – Lists all links in Blogroll

<?php wp_list_pages(); ?> – Lists all Pages

<?php wp_get_archives() ?> – List Archive for the Site

<?php wp_list_cats(); ?> – Lists all Categories

<?php get_calendar(); ?> – Displays the Built in Calendar

<?php wp_register(); ?> – Displays Register Link

<?php wp_loginout(); ?> – Displays Login/Logout Link only to Registered Users