WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] List of WordPress PHP code (3 posts)

  1. ambitdesigns
    Member
    Posted 5 years ago #

    Hello, I am relatively new to WordPress and want to design my own themes. I know HTML and CSS but I am quit "nooby" when it comes to PHP. I noticed while designing a theme for WordPress that it is as simple as creating a static page (using HTML and CSS) then using lines of PHP to replace the content of your page.

    For example if I created a website in static HTML and CSS and replaced the text of the body of the page with the line:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    	<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    	<div class="storycontent">
    		<?php the_content(__('(more...)')); ?>
    	</div>
    	<div class="feedback">
    		<?php wp_link_pages(); ?>
    		<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    	</div>
    </div>
    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    
    <?php endif; ?>

    Then the content of my static web page would be filled with the blog posts that I created within the WordPress Administration panel.

    My question is:

    What other lines of PHP can I use, can some one give me a complete list of PHP code that is avaliable? Does WordPress have a document that contains all of these PHP lines and their use?

    Here are some more examples of what I am talking about and what I THINK they are their use:

    <?php wp_register(); ?>

    -> Shows link to register page

    <?php wp_loginout(); ?>

    -> Shows link to Log In and Log Out

    <?php wp_list_pages('title_li=' . __('')); ?>

    -> Lists all pages (I don't know what 'title_li=' . __('') does)

    <?php get_footer(); ?>

    -> Gets code from footer.php

    <?php get_header(); ?>

    -> Gets code from header

    <?php bloginfo('html_type'); ?>

    -> Gets the type of HTML file (I don't know what types there are)

    <?php bloginfo('charset'); ?>

    -> Gets the character set (I don't think this is necessary but just extra info, am I right?)

    <?php wp_title('-', true, 'right'); ?> <?php bloginfo('name'); ?>

    -> Gets the title of your blog (I don't know what '-', true, 'right' means or what 'name' does)

    <?php bloginfo('stylesheet_url'); ?>

    -> Gets the path to your stylesheet and inserts it into the head

  2. Samuel B
    moderator
    Posted 5 years ago #

  3. ambitdesigns
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic