A Multi Topics Tech Blog that Make us Tech Geek

The Most common helpful wordpress .php functions


The Most common helpful wordpress .php functions


The Most common helpful wordpress .php functions

The Most common helpful wordpress .php functions


WordPress is the dominant content management system (CMS) platform for numerous types of websites. It’s user-friendly and highly customizable, making it a popular among other blogging and website platform.

This post lists common PHP codes used in custom WordPress theme development. This is a basic overview of how to integrate these functions into your WordPress site, and you’ll need access to a WordPress website or Blog to follow along


The Most common helpful wordpress .php functions are as follow



The Most Common WordPress Functions


Title of the site <?php bloginfo(‘title of my site’); ?>
Title of specific post or page <?php wp_title(); ?>
The style.css file’s theme location <?php bloginfo(‘stylesheet_ url’); ?>
Pingback URL for the site <?php bloginfo(‘pingback_url’); ?>
Location for the site’s theme file <?php bloginfo(‘template_url’); ?>
WordPress version for the site <?php bloginfo(‘version’); ?>
Atom URL for the site <?php bloginfo(‘atom_url’); ?>
Exact URL for the site <?php bloginfo(‘rss2_url’); ?>
Name of the site <?php bloginfo(‘name’); ?>
Html version of the site <?php bloginfo(‘html_type’); ?>
Charset parameter of the site <?php bloginfo(‘charset’); ?>
Author of a specific post or page <?php the_author(); ?>
ID of a specific post or page <?php the_ID(); ?>
Link to edit a specific post or page <?php edit_ post_link(); ?>
Links from the blogroll <?php get_links_ list(); ?>
Comment.php file’s content <?php comments_template(); ?>
List of pages of the site <?php wp_ list_pages(); ?>
List of categories for the site <?php wp_ list_cats(); ?>
URL to the next post <?php next_ post_link(‘%link’) ?>
URL to the previous post <?php previous_post_link(‘%link’) ?>
The built-in calendar <?php get_calendar(); ?>
List of archives for the site <?php wp_get_archives() ?>
Next and previous post link <?php posts_nav_link(); ?>
Site’s description <?php bloginfo(‘description’); ?>
Content of the posts <?php the_content();?>
Checks if there are posts <?php if(have_posts()) : ?>
Shows posts if posts are available <?php while(have_posts()) : the_post(); ?>
Closes the ‘while’ PHP function <?php endwhile; ?>
Closes the ‘if’ PHP function <?php endif; ?>
Header.php file’s content <?php get_header(); ?>
Sidebar.php file’s content <?php get_sidebar(); ?>
Footer.php file’s content <?php get_footer(); ?>
The date in ’06-21-11′ format <?php the_time(‘m-d-y’) ?>
Link for the comments on the post <?php comments_popup_link(); ?>
Title of a specific post or page <?php the_title ();?>
URL of a specific post or page <?php the_permalink() ?>
Category of a specific post or page <?php the_category(‘,’) ?>

How to use wordpress functions

One strength of WordPress that has contributed to its widespread use is its intuitive user interface for content producers mixed with enough configuration options for any serious developer to tailor the CMS to meet unique needs.

The WordPress functions listed above are provided by WordPress and can be used when developing a WordPress theme, but WordPress is extensible and allows for custom functions to be written. Fortunately, in many cases, the functions that WordPress provides are more than enough to build or change a business or organization website.

If you’re creating your own custom WordPress theme, or you want to know how to edit one that you already have installed, then perform these steps:

  • Log into your WordPress site. A common place to do that is at:
  • www.your-wordpress-site.com/wp-admin

However, the exact location of the WordPress login page will depend on how your site was set up.

  • Once logged into WordPress, you will see a page called the Dashboard. On the left side should be a navigation menu, and you’ll want to find the AppearanceEditor section to view the relevant WordPress files.
  • The Editor page will have a list of files you can view and edit on the right side. To get started, you can choose index.php from that list by clicking on it.

The first line of the index.php template might look have this piece of code: <?php get_header(); ?>. That’s simply snippet of code that says “Place the header content at the top of this page.”

In another file, one that is commonly named header.php, there’s code that specifies what the header actually contains. If you’re still in the Editor section of WordPress, you can select header.php from the list on the right to see how that is built.

Below you will find more useful code snippets commonly used in WordPress.


Additional Useful WordPress Code Snippets


Custom permalinks /%postname%/
Include any file <?php include(TEMPLATEPATH .’/x’); ?>
Value for search form <?php the_search_ query(); ?>
Prints out message <?php _e(‘Message’); ?>
Displays the register link <?php wp_register(); ?>
Displays the login/logout link <?php wp_loginout(); ?>
Divides the content into pages <!–next page–>
Cuts off the content <!–more–>
Meta for administators <?php wp_meta(); ?>
Time to load the page <?php timer_stop(1); ?>
Queries to load the page <?php echo get_num_queries(); ?>

 

Gurjit Singh is Microsoft Certified IT Professional. He likes to write about Computer Network, WordPress, Blogging Tips, SEO, Make Money Online, Computer Tips and Creating Tech Tutorials.
Thanks For Visiting YouMeGeeK.CoM

TRENDING POST :  Best Messaging Apps Available for You.
Page 1 of 11

Leave a Reply

*

Alexa Certified Traffic Ranking for YouMeGeek.com

  • 212
  • 579
Click Contact for Advisement, Backlink, Paid article and Guest Post  :)

Tech Blogging Ideas!

Receive top education news, Blogging lesson WordPress, ideas Make Money Online Tips
and more!
JOIN NOW
close-link