Popular functions in WordPress theme?

Liliana

Member
Registered
Joined
Mar 14, 2013
Messages
61
Points
0
Hello,

Anyone give me the most functions in WordPress theme?
I'm learning about wordpress theme design thus I want to know these functions and it will apply for my works on theme editing or making. Thanks in advanced.
 

Alex Thompson

Well-known member
Moderator
Joined
Jun 6, 2013
Messages
297
Points
28
WordPress has a library of giant pre-written content (Approximately 3240 PHP functions). Here I just introduce some popular functions in WordPress template

Function to get website information
get_bloginfo ($show)
$show can be:
'Name' - Returns the title Website
'Description' - Returns the description Website
'ADMIN_EMAIL' - Returns the admin's email
'SITE_URL' - Returns the url of the website
'Home' - Returns the home url

Functions to get content
get_header('header_name') - Get content from a header php file
For example:
we have header_for_homepage.php then can call <?php get_header('for_homepage');?>
Default is <?php get_header();?> to call header.php

get_footer ('footer_name') - Get content from a footer php file
For example:
we have footer_for_homepage.php then can call <?php get_footer('for_homepage');?>
Default is <?php get_footer();?> to call footer.php

get_sidebar ('sidebar_name') - Get content from a sidebar php file
For example:
we have sidebar_for_homepage.php then can call <?php get_sidebar('for_homepage');?>
Default is <?php get_sidebar();?> to call sidebar.php

The function used for Post, Page, Custom Post Type, Attachment
the_ID() - Print the ID of the current posts. If you want to get ID paper we use get_the_ID function() (can use $Post->ID)

the_title() - Print the title of the current posts. Get Text get_the_title article we use () (can use $Post-> POST_TITLE)

the_content() - Print the article content (the_content filter has passed). Get Content article get_the_content () (can use $Post-> post_content)

the_author() - Print the post author name. Get author names we use get_the_author (). Get ID of the author $Post-> post_author

the_category (',') - Print a list of article categories, separated by ','

the_time ('{date format}') - In a paper published time. For example: the_time('dm-Y') will print 09-19-2014

the_permalink() - Print out a link to the article. Get get_the_permalink article link() or get_permalink($Post->ID)

the_post_thumbnail($size, $attr) - show the featured thumbnail for post
For example: the_post_thumbnail('large', array ('alt' = 'my image description'))

Loop in WordPress
<?php if (have_posts ()):?> If have posts
<?php endif; ?> Close conditions
<?php while (have_posts ()): the_posts (); ?> Loop and show content (posts), you can add conditions in these loops
<?php endwhile;?> End loop

Hope I showed you popular commands that used to use in WP. If you have any questions, let me know

Regards,
Alex :)
 

arronmattwills

Well-known member
Registered
Joined
Dec 23, 2013
Messages
191
Points
18
The important things to remember while working on wordpress website:
You should clearly learn about the theme and it's functionality and features.
You have to go through the header.php
footer.php and content-page.php files.
You can customize the style.css
There will be reset values in wp css.
You can edit them.
Entry title and entry content are the content part of a wp page.
 

abhi_garg

Member
Joined
Jun 5, 2013
Messages
24
Points
0
I don't have much knowledge & sound of Wordpress But I know Wordpress is really good & wonderful platform ! So I must say every Function of Wordpress is important !
 
Older Threads
Replies
2
Views
4,256
Replies
14
Views
7,364
Replies
2
Views
3,527
Latest Threads
Recommended Threads
Similar Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top