WordPress.org

Forums

[resolved] FIle heirarchy / custom index page (9 posts)

  1. jakeyy
    Member
    Posted 5 years ago #

    Hiyas!

    I've read all I can find on dir structure, creating custom page etc.

    My problem is this.

    My homepage has an embedded flv and I can't for the life of me work out how to set it to the index AND link to my blog.php file to display blog posts.

    So far I've tried creating pages in the WP control panel and messing with the settings in the reading menu. This didn't work :(

    At the moment the home.php is displaying.

    I have in my theme directory:

    home.php
    index.php
    blog.php
    footer.php
    header.php
    sidebar.php

    The sidebar is a mix of prototype js library and ul, I want to edit it manually instead of having wordpress generate it for me.

    Sorry if this is a stupidly simple question :)

    J.

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    Try renaming home.php to something like home-old.php. Then create a static page that will act as your home page, embed your file and publish the page. Finally, configure WP to use a static front page. I think that will give you the result that you're after.

  3. jakeyy
    Member
    Posted 5 years ago #

    I tried this and it didn't work :(

    The code I'm trying to add:

    <object width="550" height="400">
    <param name="movie" value="somefilename.swf">
    <embed src="http://**********.com/blog/wp-content/themes/******/fullscreenBG.swf" width="100%" height="100%">
    </embed>
    </object>

    I'm not sure if you can use object tags within the WP html editor. :(

    // EDIT //

    I've noticed when I edit either of my created pages from within WP the permalinks are showing as http://*******.com/blog

    Not sure if this is of any relevance...

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    I'm not sure if you can use object tags within the WP html editor

    You can use any HTML markup in the HTML tab but don't switch back to Visual or your markup will be removed.

  5. jakeyy
    Member
    Posted 5 years ago #

    Ah. I think it may be one of my many PHP errors. Playing with the loop in index.php displays the .swf albeait in a tiny window.

    Setting permalinks and playing with this loop appears to be solving the root of the problem.

    Now i just need to work out how to get the flash displaying outside of the post area :) (It's a full screen background).

    My index.php:

    <?php get_header(); ?>
    
    <?php get_sidebar(); ?>
    
          <?php /* The Loop — with comments! */ ?>
          <?php while ( have_posts() ) : the_post() ?>
          <?php /* Create a div with a unique ID thanks to the_ID() and semantic classes with post_class() */ ?>
              <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
          <?php /* an h2 title */ ?>
               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
          <?php /* Microformatted, translatable post meta */ ?>
               <div class="entry-meta">
                <span class="meta-prep meta-prep-author"><?php _e('By ', 'your-theme'); ?></span>
                <span class="author vcard"><a class="url fn n" href="<?php echo get_author_link( false, $authordata->ID, $authordata->user_nicename ); ?>" title="<?php printf( __( 'View all posts by %s', 'your-theme' ), $authordata->display_name ); ?>"><?php the_author(); ?></a></span>
                <span class="meta-sep"> | </span>
                <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'your-theme'); ?></span>
                <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span>
                <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
               </div><!– .entry-meta –>
          <?php /* The entry content */ ?>
               <div class="entry-content">
          <?php the_content( __( 'Continue reading <span class="meta-nav">&raquo;</span>', 'your-theme' )  ); ?>
          <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:', 'your-theme' ) . '&after=</div>') ?>
               </div><!– .entry-content –>
          <?php /* Microformatted category and tag links along with a comments link */ ?>
               <div class="entry-utility">
                <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'your-theme' ); ?></span><?php echo get_the_category_list(', '); ?></span>
                <span class="meta-sep"> | </span>
                <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'your-theme' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ) ?>
                <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?></span>
                <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
               </div><!– #entry-utility –>
              </div><!– #post-<?php the_ID(); ?> –>
          <?php /* Close up the post div and then end the loop with endwhile */ ?>
          <?php endwhile; ?>
    
    <?php get_footer(); ?>

    Any ideas? :D

    Also, thank you for helping esmi, it's appreciated. Do you have a Paypal account where you can take a donation?

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    Why not simply drop the object block into index.php just before the start of the Loop? I've not seen your site so I don't know how feasible this would be in terms of your design but something like:

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <?php if( is_home() && !is_paged() ):?>
    <div id="movie">
    [ object markup ]
    </div>
    <?php endif;?>
    
          <?php /* The Loop — with comments! */ ?>
          <?php while ( have_posts() ) : the_post() ?>

    Would seem to be do-able and should only display the movie on the front page itself. Of course, you'd then need to start tweaking the stylesheet and adding in some additional CSS to control the movie div. For a little extra CSS "tweakability", edit header.php and change <body> to <body <?php if (function_exists('body_class')) body_class(); ?>>. That will give you some extra classes on the body tags that you might find useful when it comes down to styling the movie block.

    With regard to PayPal, please feel free to pop over to http://quirm.net/download/ if you've a mind to. :-)

  7. jakeyy
    Member
    Posted 5 years ago #

    Ah,

    Tried that and for some reason it wasn't happening for me although it seems a logical solution. Are the div tags necessary?

    Also, you should check for emails for a paypal receipt. It's not much but better than a kick in the mouth I suppose :)

    //EDIT//

    Actually it's working in weird and wonderful ways!

    If i hit the page I set as posts page in WP settings it works...

    Strange :O

  8. esmi
    Forum Moderator
    Posted 5 years ago #

    Are the div tags necessary?

    Not vital but they do act as a unique wrapper which may help when trying to re-style that part of the page.

    for some reason it wasn't happening for me

    Did you check the page source or turn off the CSS to see if the movie block is being output. It could be that it's in there but you have a CSS positioning/layer problem that's hiding it. Is the site online or are you working on it locally?

    you should check for emails for a paypal receipt

    Cool! Thank you :-)

  9. jakeyy
    Member
    Posted 5 years ago #

    is_home()
    When the main blog page is being displayed. (WordPress 2.1 handles this function differently than prior versions. See Alternate Methods for Setting the Front Page for pre-2.1 WP.)

    Note: If you select a static Page as your frontpage (see below), this tag will be applied to your "posts page".

    :)

    is_front_page() worked perfectly!

    Thanks mate! You've been a great help!

Topic Closed

This topic has been closed to new replies.

About this Topic