SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Chicago
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Which CSS file is slected in the below PHP code

    In the below snippet of php code how does the php know which #main to read ? Note at the top of the code I have added the css file from my zenphoto which contains a DIV main. However, for some reason when I go to my site it is apparent that the code is reading #main from my Wordpress css.

    Can someone help me in terms of what the php is doing below relative to the css files being called ?

    PHP Code:
    <?php if (!defined('WEBPATH')) die(); ?>
    <?php 
    require($_SERVER['DOCUMENT_ROOT'].'/blogs/wp-blog-header.php'); ?>



    <?php
    // add the zen css and javascript to the wordpress header
    function addcss() {
    global 
    $_zp_themeroot;
    echo 
    '<link rel="stylesheet" href="'.$_zp_themeroot.'/default/styles/dark.css" type="text/css" />';
    printRSSHeaderLink('Gallery','Gallery RSS');
    zenJavascript();
    }
    add_action('wp_head''addcss');
    ?>

    <?php get_header(); ?>


    <?php db_connect(); ?>

    <div id="main">
    <div id="gallerytitle">
            <?php if (getOption('Allow_search')) {  printSearchForm(''); } ?>
            <h2><?php printHomeLink(''' | '); echo getGalleryTitle(); ?></h2>
        </div>
       
            <div id="padbox">

            <div id="albums">
                <?php while (next_album()): ?>
                <div class="album">
                            <div class="thumb">
                        <a href="<?php echo htmlspecialchars(getAlbumLinkURL());?>" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumThumbImage(getAnnotatedAlbumTitle()); ?></a>
                              </div>
                            <div class="albumdesc">
                        <h3><a href="<?php echo htmlspecialchars(getAlbumLinkURL());?>" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumTitle(); ?></a></h3>
                                 <small><?php printAlbumDate(""); ?></small>
                        <p><?php printAlbumDesc(); ?></p>
                    </div>
                    <p style="clear: both; "></p>
                </div>
                <?php endwhile; ?>
            </div>
            <br clear="all" />
            <?php printPageListWithNav("&laquo; ".gettext("prev"), gettext("next")." &raquo;"); ?>
        </div>
    </div>




    <?php if (function_exists('printLanguageSelector')) { printLanguageSelector(); } ?>

    <div id="credit"><?php printRSSLink('Gallery','','RSS'' | '); ?> <?php printCustomPageURL(gettext("Archive View"),"archive"); ?> | 
    <?php printZenphotoLink(); ?>
    </div>

    <?php if (function_exists('printAdminToolbox')) printAdminToolbox(); ?>
    <?php $wpdb
    ->select(mydbname); ?>

    <?php get_sidebar(); ?>
    <?php get_footer
    (); ?>

  2. #2
    SitePoint Addict skunkbad's Avatar
    Join Date
    Apr 2008
    Location
    Temecula, CA
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I only see one link to a css file, so I'm assuming the other link is in the wp-blog-header.php file you are including. If you can post the content of that file, it might be easier to tell you what is going on. Generally speaking, the css file lower in the code will overwrite a rule that is higher up. That's the nature of CSS. It would be good if you could include links to what you are working on, or show more code.

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Chicago
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to integrate zenphoto with wordpress per the below link http://www.ruzee.com/blog/2006/06/in...nto-wordpress/

    When I click on zenphoto/index.php my wordpress header, footer, and sidebar should be displayed seamlessly with the main portion of zenphoto


    Wordpress Header.php
    PHP Code:
    <?php include('templates/start.php'); ?>

    <!-- container START -->
    <div id="container">

    <?php include('templates/header.php'); ?>



    <!-- removed content START on March 3, 2009 and added to start of index.php -->

    <!-- removed main START on March 3, 2009 and added to start of index.php -->

    Wordpress Index.php

    PHP Code:
    <?php get_header(); ?>
    <!-- content START -->
    <div id="content">

    <!-- main START -->
        <div id="main">

    <?php $options get_option('inove_options'); ?>

    <?php if ($options['notice'] && $options['notice_content']) : ?>
        <div class="post" id="notice">
            <div class="content">
                <?php echo($options['notice_content']); ?>
                <div class="fixed"></div>
            </div>
        </div>
    <?php endif; ?>

    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); update_post_caches($posts); ?>
            <div class="post" id="post-<?php the_ID(); ?>">
                <h2><a class="title" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
                <div class="info">
                    <span class="date"><?php the_time(__('F jS, Y''inove')) ?></span>
                    <div class="act">
                        <span class="comments"><?php comments_popup_link(__('No comments''inove'), __('1 comment''inove'), __('% comments''inove')); ?></span>
                        <?php edit_post_link(__('Edit''inove'), '<span class="editpost">''</span>'); ?>
                        <div class="fixed"></div>
                    </div>
                    <div class="fixed"></div>
                </div>
                <div class="content">
                    <?php the_content(__('Read more...''inove')); ?>
                    <p class="under">
                        <?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?>
                        <?php if ($options['categories']) : ?><span class="categories"><?php the_category(', '); ?></span><?php endif; ?>
                        <?php if ($options['tags']) : ?><span class="tags"><?php the_tags(''', '''); ?></span><?php endif; ?>
                    </p>
                    <div class="fixed"></div>
                </div>
            </div>
        <?php endwhile; ?>

    <?php else : ?>
        <div class="errorbox">
            <?php _e('Sorry, no posts matched your criteria.''inove'); ?>
        </div>
    <?php endif; ?>

    <div id="pagenavi">
        <?php if(function_exists('wp_pagenavi')) : ?>
            <?php wp_pagenavi() ?>
        <?php else : ?>
            <span class="newer"><?php previous_posts_link(__('Newer Entries''inove')); ?></span>
            <span class="older"><?php next_posts_link(__('Older Entries''inove')); ?></span>
        <?php endif; ?>
        <div class="fixed"></div>
    </div>

    <!-- main END -->
    </div>

    <?php get_sidebar(); ?>
        <div class="fixed"></div>
        
    <!-- content END -->
    </div>

    <?php get_footer(); ?>
    Wordpress footer.php

    PHP Code:
    <!-- removed end main from footer.php and added to end of index.php om mar 3 2009 -->    

        <?php get_sidebar(); ?>
        <div class="fixed"></div>

    <!-- removed end content from footer.php and added to end of index.php om mar 3 2009 -->    


    <?php include('templates/end.php'); ?>
    Zenphoto index.php

    PHP Code:
    <?php if (!defined('WEBPATH')) die(); ?> 
    <?php require($_SERVER['DOCUMENT_ROOT'].'/blogs/wp-blog-header.php'); ?> 



    <?php 
    // add the zen css and javascript to the wordpress header 
    function addcss() { 
    global 
    $_zp_themeroot
    echo 
    '<link rel="stylesheet" href="'.$_zp_themeroot.'/default/styles/dark.css" type="text/css" />'
    printRSSHeaderLink('Gallery','Gallery RSS'); 
    zenJavascript(); 

    add_action('wp_head''addcss'); 
    ?> 

    <?php get_header(); ?> 


    <?php db_connect(); ?> 

    <div id="main"> 
    <div id="gallerytitle"> 
            <?php if (getOption('Allow_search')) {  printSearchForm(''); } ?> 
            <h2><?php printHomeLink(''' | '); echo getGalleryTitle(); ?></h2> 
        </div> 
        
            <div id="padbox"> 

            <div id="albums"> 
                <?php while (next_album()): ?> 
                <div class="album"> 
                            <div class="thumb"> 
                        <a href="<?php echo htmlspecialchars(getAlbumLinkURL());?>" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumThumbImage(getAnnotatedAlbumTitle()); ?></a> 
                             </div> 
                            <div class="albumdesc"> 
                        <h3><a href="<?php echo htmlspecialchars(getAlbumLinkURL());?>" title="<?php echo gettext('View album:'); ?> <?php echo getAnnotatedAlbumTitle();?>"><?php printAlbumTitle(); ?></a></h3> 
                                <small><?php printAlbumDate(""); ?></small> 
                        <p><?php printAlbumDesc(); ?></p> 
                    </div> 
                    <p style="clear: both; "></p> 
                </div> 
                <?php endwhile; ?> 
            </div> 
            <br clear="all" /> 
            <?php printPageListWithNav("&laquo; ".gettext("prev"), gettext("next")." &raquo;"); ?> 
        </div> 
    </div> 




    <?php if (function_exists('printLanguageSelector')) { printLanguageSelector(); } ?> 

    <div id="credit"><?php printRSSLink('Gallery','','RSS'' | '); ?> <?php printCustomPageURL(gettext("Archive View"),"archive"); ?> |
    <?php printZenphotoLink(); ?> 
    </div> 

    <?php if (function_exists('printAdminToolbox')) printAdminToolbox(); ?> 
    <?php $wpdb->select(mydbname); ?> 

    <?php get_sidebar(); ?> 
    <?php get_footer(); ?>

  4. #4
    SitePoint Addict skunkbad's Avatar
    Join Date
    Apr 2008
    Location
    Temecula, CA
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are so many included files! I'm not a wordpress guy, but I'd probably forget about all this php code, and go find the css files that are involved. I use Firefox, and there is a wonderful extension called "Web Developer Toolbar", or something similar. One of the great things it will allow you to do is pull up all of the CSS that is used on a page. It will give you the name of the files, and also the order that they are used. Once you can edit these files, unless there are inline styles being applied (which would be too obvious), then you will be able to pinpoint what is going on.


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
  •