SitePoint Sponsor

User Tag List

Page 1 of 5 12345 LastLast
Results 1 to 25 of 118

Thread: wordpress

  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    wordpress

    Hello,

    I got a multiple page html theme and I wanted to convert it to a wordpress theme without changing the layout or color scheme of it. can anyone give me a good tutorial with the specific code references and a tutorial on explaining how can i go about achieving this? i know wordpress uses one page.php file which says what all pages look like but is there a way to use multiple pages?

    here is my html theme:

    http://www.exinage.com/html/

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wordpress's Codex provides a lot of useful information on developing themes. Don't make the process too complicated. I used to copy all of the files for Wordpress's default theme and just edit them to include my design.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    where in the codex does it list the different call tags?

    such as this:

    Code:
    <?php the_permalink() ?>
    and just gives an explanation what it does. i remember seeing such a list but cannot find it.

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    little lever
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Theres really only a few lines you need to copy. Do as the guy above says and just pick the default one apart.
    Manchester Free Ads - Free classifieds, only in manchester.
    Best web hosting

  5. #5
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok so i am taking apart the default template and i see this set in the header for the css:

    Code:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    were do i place in the reference to the actual css files?

  6. #6
    SitePoint Addict dnordstrom's Avatar
    Join Date
    Jul 2006
    Location
    Amsterdam
    Posts
    337
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Glad to hear you're taking on WordPress.

    Here are some template functions/tags: http://codex.wordpress.org/Template_Tags

    I'd recommend downloading a base theme such as Hybrid or Starkers by Elliot Jay Stocks. Either base the new theme on that or have a look at how the above mentioned functions are used.

    Here's the manual with information about how to get started and which files are necessary: http://codex.wordpress.org/Theme_Development
    Daniel Nordstrom. of. Nintera(ctive)
    -- Featured post: Part 2. Writing NI.JS JavaScript
    ----- Follow me on Twitter. Got project? Contact me.
    -------- SitePoint: Community Guidelines Be A Great Member

  7. #7
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that didn't really answer my question...i cannot find <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> really in codex nor how to reference the css styles.

  8. #8
    SitePoint Addict dnordstrom's Avatar
    Join Date
    Jul 2006
    Location
    Amsterdam
    Posts
    337
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Utilize Google. Here's a list of parameter values for that function. I'd use @import within style.css to include other CSS files.
    Daniel Nordstrom. of. Nintera(ctive)
    -- Featured post: Part 2. Writing NI.JS JavaScript
    ----- Follow me on Twitter. Got project? Contact me.
    -------- SitePoint: Community Guidelines Be A Great Member

  9. #9
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not sure what you mean by reference the .css styles? That is looking for the style sheet in the themes folder within the wp-content/themes/theme directory. There is nothing you need to do to that line.

    As far as different layouts for different pages go. You can create page templates for each different style you need. Then when creating a page you can select the template for that particular page: http://codex.wordpress.org/Pages#Page_Templates

  10. #10
    SitePoint Addict
    Join Date
    Jan 2008
    Location
    Shaw AFB
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally hate the codex. Sure, it explains what everything does, but decent examples don't exist.

    I would suggest you check out css-tricks.com. I've learned a lot from Chris' screencasts.

    More specifically:
    Building a Photoshop Mockup
    PSD to HTML/CSS Conversion
    HTML/CSS to Wordpress conversion
    ~ Nate L ~

  11. #11
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    Not sure what you mean by reference the .css styles? That is looking for the style sheet in the themes folder within the wp-content/themes/theme directory. There is nothing you need to do to that line.

    As far as different layouts for different pages go. You can create page templates for each different style you need. Then when creating a page you can select the template for that particular page: http://codex.wordpress.org/Pages#Page_Templates
    well in regular html i say which stylesheets i use and were they are located, Wordpress doesn't need to be told that? If it does which file and how do I declare them?

  12. #12
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    That line is looking in the /wp-content/themes/active_theme_folder for a file called style.css. This file is required for a theme to function properly in the admin area.

    If you want to add additional style sheets to the theme you can add more by duplicating this line and changing the path to point to the new file(s)
    Code:
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/additionalstylesheet.css" type="text/css" media="screen" />
    Just change the name of additionalstylesheet to match whatever you name it. This goes in header.php in the theme folder.

  13. #13
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    Code:
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    That line is looking in the /wp-content/themes/active_theme_folder for a file called style.css. This file is required for a theme to function properly in the admin area.

    If you want to add additional style sheets to the theme you can add more by duplicating this line and changing the path to point to the new file(s)
    Code:
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/additionalstylesheet.css" type="text/css" media="screen" />
    Just change the name of additionalstylesheet to match whatever you name it. This goes in header.php in the theme folder.
    ok i see, is it possible to create multiple different page layouts? for example on my site i have a page for the index which I will keep index.php but then i got a regular page layout then I got the blog layout. how can i establish those two different layouts?

  14. #14
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    For the homepage you can either create a file called home.php place it in the theme folder and it will be used by default for the front page, or you can create 2 WP "pages" for home and blog then under settings > reading you can chose to display that home page as the front page and move the blog posts to the other page: For custom page templates: http://codex.wordpress.org/Pages#Page_Templates

  15. #15
    SitePoint Addict
    Join Date
    Jan 2008
    Location
    Shaw AFB
    Posts
    282
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silver163 View Post
    ok i see, is it possible to create multiple different page layouts? for example on my site i have a page for the index which I will keep index.php but then i got a regular page layout then I got the blog layout. how can i establish those two different layouts?
    If you watch the 3rd video that I posted in my prior post, Chris explains all of that.
    ~ Nate L ~

  16. #16
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    For the homepage you can either create a file called home.php place it in the theme folder and it will be used by default for the front page, or you can create 2 WP "pages" for home and blog then under settings > reading you can chose to display that home page as the front page and move the blog posts to the other page: For custom page templates: http://codex.wordpress.org/Pages#Page_Templates
    i guess i should just create the index php file and then create the blogtemplate.php file with the loop in there for the posts.

  17. #17
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silver163 View Post
    i guess i should just create the index php file and then create the blogtemplate.php file with the loop in there for the posts.
    No. Blogtemplate.php is not a standard file, so wordpress will not know what to do with it... Althuogh you could make that file, you could only apply it to a specific page, not wp as a whole.
    Ryan B | My Blog | Twitter

  18. #18
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i pulled this out of page.php but it appears that it is just like a blog post not a page post, am i correct or what?

    Code:
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
    	
    	<?php comments_template(); ?>
    	
    	</div>

  19. #19
    SitePoint Addict dnordstrom's Avatar
    Join Date
    Jul 2006
    Location
    Amsterdam
    Posts
    337
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Pages are treated as posts, yes. You could of course change the CSS classes to "page" if you want.

    EDIT: This is an extract from my own page.php, from the blog linked to in the name in my signature.

    PHP Code:
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                <div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">

                    <?php hybrid_before_entry(); // Before entry hook ?>

                    <div class="entry-content">
                        <?php the_content(); ?>
                        <?php wp_link_pages( array( 'before' => '<p class="pages">' __'Pages:''hybrid' ), 'after' => '</p>' ) ); ?>
                    </div><!-- .entry-content -->

                    <?php hybrid_after_entry(); // After entry hook ?>

                </div><!-- .hentry -->

                <?php hybrid_after_singular(); // After singular hook ?>

                <?php comments_template''true ); ?>

                <?php endwhile; ?>

            <?php else: ?>

                <p class="no-data">
                    <?php _e'Sorry, no page matched your criteria.''hybrid' ); ?>
                </p><!-- .no-data -->

            <?php endif; ?>
    Daniel Nordstrom. of. Nintera(ctive)
    -- Featured post: Part 2. Writing NI.JS JavaScript
    ----- Follow me on Twitter. Got project? Contact me.
    -------- SitePoint: Community Guidelines Be A Great Member

  20. #20
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by silver163 View Post
    am i correct or what?
    Yes "pages" are very similar to "posts". This code is the same as the other files. It contains The Loop. This file will be used when it is displaying a post that is labeled as "paged" in the database.

    http://codex.wordpress.org/Pages#Pages_in_a_Nutshell

  21. #21
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    Yes "pages" are very similar to "posts". This code is the same as the other files. It contains The Loop. This file will be used when it is displaying a post that is labeled as "paged" in the database.

    http://codex.wordpress.org/Pages#Pages_in_a_Nutshell
    so then image.php is also the same? this is so confusing.

  22. #22
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not familiar with image.php. What theme are you using? This might be a custom file made for this theme.

  23. #23
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BPartch View Post
    Not familiar with image.php. What theme are you using? This might be a custom file made for this theme.
    using the default theme

  24. #24
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What do you know there is a file called image.php in the default theme. Been so long since I looked at it I guess it slipped past me. It appears that this file is used when you link an image to the post-file in the image uploader. Clicking said image displays a page with the image larger and a caption. I have never used this file so I can not be much more help on it.

    http://themetation.com/2008/07/17/ho...ch-part-3b/#13

  25. #25
    SitePoint Evangelist
    Join Date
    Feb 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh ok so its not important in my case.

    i guess now i got to tackle the archive and the search php file.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •