Archive for the ‘Theme’ Category

Create a File archive.php Theme WordPress

May 11th, 2011 by rory | No Comments | Filed in Theme

Archive.php file to function display page blog archives. Usability archive is placed posts to the group. Archive blog posts can be archived per month, the archive posts per category or archive tags.

The principle of making the same file archive.php index.php file is a file called header.php, sidebar.php and footer.php. The difference found on the content presented. The following codes are used to create the file archive.php.

<?php get_header(); ?>

<div id="content">
<?php if (have_posts()) : ?>
<?php $post = $posts[0];?>
<?php if (is_category()) { ?>
<h2><?php printf(__('Archive for the ‘%s’ Category'), single_cat_title('', false)); ?></h2>
<?php } elseif( is_tag() ) { ?>
<h2><?php printf(__('Posts Tagged ‘%s’'), single_tag_title('', false) ); ?></h2>
<?php } elseif (is_day()) { ?>
<h2><?php printf(_c('Archive for %s|Daily archive page'), get_the_time(__('F jS, Y'))); ?></h2>
<?php } elseif (is_month()) { ?>
<h2><?php printf(_c('Archive for %s|Monthly archive page'), get_the_time(__('F, Y'))); ?></h2>
<?php } elseif (is_year()) { ?>
<h2><?php printf(_c('Archive for %s|Yearly archive page'), get_the_time(__('Y'))); ?></h2>
<?php } elseif (is_author()) { ?>
<h2><?php _e('Author Archive'); ?></h2>
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2><?php _e('Blog Archives'); ?></h2>
<?php } ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link(__('« Older Entries')); ?></div>
<div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;')); ?></div>
</div>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<h2><a href="">></a></h2>
<small><?php the_time(__('l, F jS, Y')) ?></small>
<div class="entry">
<?php the_excerpt() ?>
</div>
<p><?php the_tags(__('Tags:'), ', ', '
'); ?
> <?php printf(__('Posted in %s'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit'), '', ' | '); ?> <?php comments_popup_link(__('No Comments &#187;'), __('1 Comment &#187;'), __('% Comments &#187;'), '', __('Comments Closed') ); ?></p>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link(__('&laquo; Older Entries')); ?></div>
<div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;')); ?></div>
</div>
<?php else :
if ( is_category() ) {
printf("
<h2 class='center'>".__("Sorry, but there aren't any posts in the %s category yet.").'</h2>', single_cat_title('',false));
} else if ( is_date() ) {
echo('
<h2>'.__("Sorry, but there aren't any posts with this date.").'</h2>');
} else if ( is_author() ) {
$userdata = get_userdatabylogin(get_query_var('author_name'));
printf("
<h2 class='center'>".__("Sorry, but there aren't any posts by %s yet.")."</h2>", $userdata->display_name);
} else {
echo("
<h2 class='center'>".__('No posts found.').</h2>');
}
get_search_form();
endif;
?
>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Description:

  1. < ? php get_header ();? > is useful to call the file header.php.
  2. < div id = "content" > until code < / div > before the code < ? php get_sidebar ();? > is a blog content. The contents of this blog's content is the archive later.
  3. < ? php get_sidebar ();? > is useful to call the sidebar.php file.
  4. < ? php get_footer ();? > is useful to call the footer.php file.

Create a file single.php WordPress Theme

April 27th, 2011 by rory | 2 Comments | Filed in Theme

Single.php file is a file that serves to form a single post pages. When the page posts opened then presented with a full post including the form of comments and remarks. Sample pages are posting this page.

Composed by a header post pages, content, sidebar and footer. To compile the file single.php on duty to call the file header.php, sidebar.php and footer.php. Codes for the single.php like the example below. The code is copied to the notepad and saved with the name single.php.

<?php get_header();?>

<div id="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="entry">
<?php the_content('<p class="serif">' . __('[...]') . '</p>'); ?>
<?php wp_link_pages(array('before' => '<p><strong>' . __('Pages:') . '</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<?php the_tags( '<p>' . __('Tags:') . ' ', ', ', '</p>'); ?>
<p>
<small>
<?php printf(__('Posted in %3$s | %1$s'), get_the_time(__('l, F jS, Y')), get_the_time(), get_the_category_list(', ')); ?>
</small>
</p>
</div>
</div>
<?php comments_template(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>

<?php get_sidebar(); ?>
<?php get_footer(); ?>

  1. < ? php get_header ();? > is useful to call the file header.php.
  2. < div id = "content" > until code < / div > before the code < ? php get_sidebar ();? > is content that contains the post text, comments and comment form.
  3. < ? php get_sidebar ();? > is useful to call the sidebar.php file.
  4. < ? php get_footer ();? > is useful to call the footer.php file.

Creating a Files 404.php WordPress Themes

April 25th, 2011 by rory | No Comments | Filed in Theme

404.php file is a file that is useful to display the contents page content does not exist in the database. This page can be raised because the old page content stored in the database have been deleted but a link to that page still appear in search engines. When someone opened the link that page then the page is not available. Therefore need a replacement page that allows you to replace the page that is not available. Name erorr 404 pages is a page indicating that the desired page was not found.

The principle of making 404.php file similar to the making of the file index.php and archive.php. The page consists of header, content, sidebar and footer. Therefore, the codes that exist in the 404.php file function call the files making up the header.php, sidebar.php and footer.php. Sample code to create a 404.php page is as below. Open up a notepad, copy the code below and save it with the name of 404.php.

<?php get_header(); ?>
<div id="content">
<h2 class="center">></h2>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

Description:

  1. < ? php get_header ();? > is useful to call the file header.php.
  2. < div id = "content" > until code < / div > before the code < ? php get_sidebar ();? > is content that provides information that the page opened not found.
  3. < ? php get_sidebar ();? > is useful to call the sidebar.php file.
  4. < ? php get_footer ();? > is useful to call the footer.php file.

Create a File index.php Theme WordPress

April 23rd, 2011 by rory | No Comments | Filed in Theme

After creating the file header.php, sidebar.php and footer.php, then the next is to create the file index.php. The index.php file is useful to view the main page of a blog. When the blog address is typed in the browser then the index.php page is the first searched and then opened.

The page is opened by the file index.php meet wordpress theme structure. WordPress theme structure consists of headers, content, sidebar, and footer. So the codes in a file called index.php useful untu header.php, sidebar.php and footer.php which we have previously made.

<?php get_header(); ?>

<div id="content">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<small><?php the_time(__('F jS, Y')) ?> <!-- by <?php the_author() ?> --></small>
<?php the_content(__('Read more...')); ?>
<p><small><?php printf(__('Posted in %s'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit'), '', ' | '); ?> <?php comments_popup_link(__('No Comments &#187;'), __('1 Comment &#187;'), __('% Comments &#187;'), '', __('Comments Closed') ); ?></small></p>
</div>
<?php endwhile; ?>
<p class="navigation">
<div class="alignleft"><?php next_posts_link(__('&laquo; Older Entries')) ?></div>
<div class="alignright"><?php previous_posts_link(__('Newer Entries &raquo;')) ?></div>
</p>
<?php else : ?>
<h2 class="center"><?php _e('Not Found'); ?></h2>
<p class="center"><?php _e('Sorry, but you are looking for something that isn&#8217;t here.'); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Description:

  1. < ? php get_header ();? > is useful to call the file header.php.
  2. < div id = "content" > until code < / div > before the code < ? php get_sidebar ();? > is the blog content. The main contents of a blog page and is the most important part contained on this item.
  3. < ? php get_sidebar ();? > is useful to call the sidebar.php file.
  4. < ? php get_footer ();? > is useful to call the footer.php file.

Create a File functions.php Theme WordPress

April 17th, 2011 by rory | No Comments | Filed in Theme

Functions.php file serves as a support file to add and subtract content sidebar. With this file we can add various widgets sidebar that is available on the admin user. The trick is premises drag and drop widgets needed. Drag and drop made ??in Apperance >> Widgets .

With this file, sidebar management becomes easier because the addition is done automatically. If no files are then added and the reduction of widgets is done manually by editing the sidebar.php file.

To create a functions.php file, first open the notepad, then fill with the code below. After that save the notepad with the name of functions.php.

<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'before_widget' =
> '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' =
> '<h2 class="widgettitle">',
'after_title' =
> '</h2>',
));
?
>

Create a File sidebar.php WordPress Theme

April 17th, 2011 by rory | No Comments | Filed in Theme

Sidebar is usually located on the left or the right side of the page. Sometimes the sidebar there is also located at the top of the content or at the bottom of the content depends on the wishes of the theme maker.

Sidebar to function as a tool to shorten the search web content with the links or the search and to place advertisements or other information.

To make the sidebar file, open notepad and then save it as sidebar.php. Before storage, the contents of notepad with the code below.

<div id="sidebar">
<ul>
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
<?php endif; ?>
</ul>
</div>

Sidebar takes function.php file to drag and drop the contents of the sidebar. Php function files will be discussed after this post.

Create a file footer.php WordPress Theme

April 17th, 2011 by rory | No Comments | Filed in Theme

Footer fall into one of the main components making up the blog page. Footer usually located at the bottom of the blog pages. Footer function is as the end of the cover page. Footer on the wordpress theme usually contains information about the creator of the blog platform (WordPress), the name of the theme and the author name and link.

Here are the codes used in the footer. To create a footer file, the codes are copied into a notepad and then saved with the name of footer.php.

<div id="footer">
<p>
<?php printf(__('Powered by %2$s'), get_bloginfo('name'), '<a href="http://wordpress.org/">WordPress</a>'); ?>
<br />Theme dibikin oleh <a href="http://www.yangbikintheme.com/">Yang Bikin Theme</a>
</p>
</div>
</div>
<?php wp_footer(); ?>
</body>
</html>

Create a file header.php WordPress Theme

April 17th, 2011 by rory | No Comments | Filed in Theme

The existence of important header presence in a blog. Header is the head of the blogs that will become the identity of a blog. In the header include the names of blogs and a short description of the blog. If you want to know what are the contents in a blog, then look at the header.

Here are the codes used in the header of the wordpress theme. To create a header file, the codes are copied into a notepad then saved as header.php.

<!DOCTYPE html>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page">
<div id="header">
<h1><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
<div><?php bloginfo('description'); ?></div>
</div>

WordPress Theme Structure

April 16th, 2011 by rory | No Comments | Filed in Theme, Unknown

WordPress theme consists of 4 constituent components. The components are header, content, sidebar, and footer. In making wordpress themes, components of the header, sidebar and footer created a separate file that is the file header.php, sidebar.php and footer.php. The files are later together will make the page index.php, single.php, page.php, archive.php, search.php, and 404.php.

Image Structure Theme

important files needed to create a wordpress theme

April 16th, 2011 by rory | No Comments | Filed in Theme

should each step in studying, understanding and create something to be noted. for history and science can be tied up and not loose. not like before when I learn, understand and create a wordpress theme. I had to learn and understand more because of the lessons already learned and understood many weeks yesterday who could not remember anymore. all go away because there are no records.

This time I wrote every step that I learned in making a wordpress theme. though we can all share. if I’m wrong please repaired. for the early stages of the introduction I wrote first about the files contained in the folder wordpress theme. the file is as follows.

  1. 404.php
  2. archive.php
  3. comments.php
  4. comments-popup.php
  5. footer.php
  6. functions.php
  7. header.php
  8. index.php
  9. page.php
  10. screenshot.png
  11. search.php
  12. searchform.php
  13. sidebar.php
  14. single.php
  15. style.css
  16. folder images

Any use of these files? will be discussed again next ditulisan because the files I need to learn first. hehe ..