WordPress customization

I’m building my first WordPress site and I am having a little bit of trouble. I have a problem with a PHP script.

The site http://www.berlinairliftveteransassociation.org/wordpress I put a JavaScript slide show. I finally got the image to show up. The problem I am facing is when I try to center this image. I’m almost certain this image is contained inside a <div>. I’m hoping someone could check out the link and then to tell me what’s wrong.

Read More

I can’t post the CSS, because it is extremely long. With developer tools you can see the CSS. This is probably an easy problem but I’m still a novice.

<?php
/**
 * The Header template for our theme
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8)  ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<script type="text/javascript" src="java.js"></script>
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>java.js"></script>
<![endif]-->
<?php wp_head(); ?> 
</head>

<body <?php body_class(); ?>>
<div id="red"></div>
<div id="yellow"></div>
<div id="page" class="hfeed site leftBlueBorder">


        <img name="slide" class ="wrapper" id="slider main"><header id="masthead" class="site-header" role="banner">
        <hgroup><h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        </hgroup>

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
            <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
            <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
        </nav><!-- #site-navigation -->

        <?php if ( get_header_image() ) : ?>
        <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
        <?php endif; ?>
    </header><!-- #masthead -->

    <div id="main" class="wrapper">

Related posts

Leave a Reply

4 comments

  1. Wrap <img name="slide" class ="wrapper" id="slider main"> in a div and align that.

    <div class="headSlider>
        <img name="slide" class="wrapper" id="slider main" src="slides/2.jpg">
    </div>
    

    and add the following to your css file.

    .headSlider
    {
        margin-left: auto; 
        margin-right: auto; 
        width: 875px;
    }
    
  2. I would just apply css to the image itself to fill the container div:

    img#slider {
      width: 100%;
      height: auto;
    }
    

    Note: you are using an illegal value for the id of the image… it has a space.

  3. Well you can center the image by wrapping it in a div with text-align css property set to center, eg change:

    <img name="slide" class ="wrapper" id="slider main">
    

    to:

    <div style="text-align:center;">
        <img name="slide" class="wrapper" id="slider main">
    </div>
    

    *You should use a css style linked to a class or id rather than an inline style, thats just to illustrate

    Also your image has multiple ids (slider and main) – html elements should only have a single unique id

    There are probably other issues, but thats beyond the scope of this question