Forums

[resolved] Custom page does not adhere to css (7 posts)

  1. calebjross
    Member
    Posted 2 months ago #

    I created a custom page template (frontpage.php) to use as a static home page. Everything works well, except that the text and links do not abide by the css used for the rest of the site.

    Here is a link to the newly created static page: http://www.calebjross.com/indexpage/

    Here is a link to the main site: http://www.calebjross.com

    You will notice that the <h2> tags on the main site (used in the post titles) have a verdana font, a grey color, and don't have underlines when linked. However, the <h2> tags on the new home page (used for the menu list) do not have these attributes.

    Any help would be greatly appreciated. Thank you!

  2. lockdownd7
    Member
    Posted 2 months ago #

    Have you checked to make sure you're linking to the stylesheet correctly? Maybe you misspelled or something like that.

  3. krembo99
    Member
    Posted 2 months ago #

    You need to include the header information in your template file.
    Right now , if you look at teh code, because of lacking <head> info, there is no reference to any wordpress tags and function, that includes the CSS that it is not linked.

  4. calebjross
    Member
    Posted 2 months ago #

    Thanks. This definitely gets me closer.

    I pasted in the <?php get_header(); ?> tag from another page, but this also pulls in the header image along with the page layout options (three columns, white background, etc.). Is there a way to just pull in the link styles? (I want to get ride of the default blue & underline look of the links).

  5. esmi
    Member
    Posted 2 months ago #

  6. calebjross
    Member
    Posted 2 months ago #

    Thanks everyone. Here's what I did (for anyone who may come here with the same issue). I don't know much about .php at all, so this was a great learning experience for me.

    1) I copied all of the information between the <head> tags from my header.php document (included in the original theme):

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <?php
    global $options;
    foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } }
    ?>
    <?php include (TEMPLATEPATH . '/functions/bfa_meta_tags.php'); ?>
    <?php if ( $ata_show_header_image == "Yes") {
    include (TEMPLATEPATH . '/functions/bfa_rotating_header_images.php');
    } ?>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
    <?php include (TEMPLATEPATH . '/style.php'); ?>
    <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_head(); ?>

    2) I pasted this info between the <head> tags on my new page template (frontpage.php)

    3) I deleted random bits line by line, noting the changes that happened with each removal.

    4) Ultimately, I was left with the following code, which allowed me to keep my different background color (different from the white of the rest of the site) and the H2 tags adopted for formatting from the css of the main site:

    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <?php
    global $options;
    foreach ($options as $value) {
    if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); } }
    ?>
    <?php include (TEMPLATEPATH . '/style.php'); ?>

    I still don't know what a lot of the .php above means, but some of it I can decipher. Here's to learning!

  7. krembo99
    Member
    Posted 2 months ago #

    all the PHP code, (include etc) does not have to be INSIDE the <head> tag. It does not belong there .
    It DOES belong in the header, but needs to be BELOW the closing </head> tag .

Reply

You must log in to post.

About this Topic