Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter intothewhite

    (@intothewhite)

    It seems that calling the template file about.php and the page About causes a problem. Renamed the file (rather than the template) and everything's fine.

    Thread Starter intothewhite

    (@intothewhite)

    I've figured out the problem (although it's not solved).

    For some reason, the page uses page.php as its template, not about.php. In wp-admin the page has been told to use About as its template (Manage - Page - Advanced - Page Template - About).

    I’m guessing this is a problem with the database?

    Thread Starter intothewhite

    (@intothewhite)

    Thanks for replying.

    You’ve found an unrelated problem: I hadn’t got rid of the reference to the stylesheet I was using when it was a static, mockup page. I’ve done that, but the problem persists — unsurprising, as a missing stylesheet wouldn’t cause bits of the page to be displayed and others not.

    It’s a bit of an odd problem.

    — Leon

    `

    Thread Starter intothewhite

    (@intothewhite)

    Because I want the page to query the database – I write posts that detail work that has been done with clients (and these posts are tagged ‘client’). The page pulls all posts tagged ‘client’ from the database, and displays a link, the title and the excerpt.

    Thanks,

    Leon

    Thread Starter intothewhite

    (@intothewhite)

    This is the index.php code:

    <?php query_posts('category_name=front') ?>
    
    	<?php while (have_posts()) : the_post(); ?>
    
    		<div id="banner">
    
    			<h2><?php the_excerpt(); ?>
    
    		</div>
    
    		<div id="content">
    
    			<h3><?php the_title(); ?></h3>
    
    			<?php the_content(); ?>
    
    		</div>
    
    	<?php endwhile; ?>

    Works just fine, but when I call sidebar.php:

    <?php
    
    		<?php if (is_home()) {
    
    			echo "<h2>Find out how we help companies</h2>";
    
    			echo "<ul class=\"linklist\">";
    
    				wp_get_archives('type=postbypost');
    
    			echo "";
    
    			echo "<h2>Latest thinking from the blog</h2>";
    
    			echo "<h3>How to do only that which you can do</h3>";
    
    			echo "<p>Blog excerpt. <a>Visit our blog</a>.</p>";
    
    		}
    
    		elseif (is_page('About')) {
    
    			echo "<h2>Contact us</h2>";
    
    			echo "<p>123 West St.SomewhereSomewhereTel: +1 111 123 4567email: [email protected]</p>";
    
    			echo "<h2>What our clients say</h2>";
    
    			echo "<ul class=\"quotelist\">";
    
    				wp_list_bookmarks('title_li=&categorize=0&category_name=quote&limit=1&show_description=1');
    
    			echo "";
    
    		}
    
                    else {
    
    			echo "<h2>What our clients say</h2>";
    
    			echo "<ul class=\"quotelist\">";
    
    			wp_list_bookmarks('title_li=&categorize=0&category_name=quote&show_description=1');
    
    			echo "";
    
    		}
    
    		?>

    No sidebar content is displayed, apart from the final else block (which means that the code doesn’t recognise the current page). I’m wondering whether my syntax is correct here (I’m new to PHP).

    Thread Starter intothewhite

    (@intothewhite)

    What happens if you don’t use the Front template for the Home page?

    I tried another tack. I decided to use a normal front page that used index.php. In index.php I used query_posts to pull up any posts categorised as ‘front’ (I know it seems long winded, but it gives quite a bit of flexibility).

    Anyway, that’s fine, but now my sidebar conditional statements don’t work, i.e. if (is_home()) doesn’t pick up the home page.

    Does query_posts somehow affect this?

    Thanks,

    Leon

    Thread Starter intothewhite

    (@intothewhite)

    Oops – spotted about 20 seconds after posting here.

    Square eyes as been working on this all day.

    Need a break!

    Thanks for looking at it anyway!

    Leon

    You’re using a background image, so you need to look at your CSS file (forget about the tables). It’s called style.css and you can find it at https://blog.littlebluedog.org/wp-content/themes/silver-light-01/style.css. Change line 18 from:

    #header {background: #ffffff url('images/telly_bloghdr.jpg') no-repeat bottom center;}

    to

    #header {background: #ffffff url('images/telly_bloghdr.jpg') no-repeat bottom left;}

    And change line 23 from:

    #header p.desc{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;margin:0;padding:0;}

    to

    #header p.desc{font-family:Verdana, Arial, Helvetica, sans-serif;font-size:11px;margin:0;padding:0; margin-left: 220px;}

    Yes, it will affect the overall look. Another alternative would be to remove the calendar; everything else *should* wrap into the sidebar container.

    Look for references to #sidebar, #content and #page in your style.css file and play around with the sizes, widths, colours etc. (saving before you make any changes!) The CSS is pretty simple and decently commented. Bear in mind that the #page width will set the width of the whole page – I wouldn’t go above 960px as you’d be excluding the most common monitor resolution.

    It looks like your sidebar content is too wide for the sidebar container, so it can’t float next to the content. Your content is set to 500px wide while the page is 754px, which means you have 254px for the sidebar.

    One solution would be to increase the width of the page. The problem with this would be that you’d make users on an 800X600 monitor scroll horizontally in order to see all your content. If you’re OK with that it’s quite simple. Change line 236 of your style.css file from:

    width: 754px;

    to

    width: 940px;

    This will give you a sidebar 440px wide, which should be sufficient.

    Thread Starter intothewhite

    (@intothewhite)

    I’ve looked into this some more and found that the problem is related to how I tag posts.

    If I tag a post with ‘lead’ it is displayed on the blog’s front page. I put this before the loop in index.php:

    <?php if (have_posts()) : ?>
    
    	<?php query_posts("tag=lead&showposts=1"); ?>
    
    	<?php while (have_posts()) : the_post(); ?>

    It appears that only comments made on the lead post will appear on any post’s single page. I can’t for the life of me figure out why this is the case.

    I’m not sure if it’s related, but I also use <? php query_posts(); ?> within the loop in my single.php file. Is it OK to use it within the loop?

    TIA,

    Leon

Viewing 11 replies - 1 through 11 (of 11 total)