Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wordpress loop

Posted on 2012-03-23
10
Medium Priority
?
465 Views
Last Modified: 2012-08-14
Hi,

I was wondering if someone could help me with a 'if' statement in my wordpress loop.php file.

I wanted to have two different category layouts, so i placed the following 'if' statement in both my category.php and loop.php files to get the desired result.

<?php if (is_category('22') || cat_is_ancestor_of(22, $cat)) { ?>

//new layout here

<?php } else { ?>

//original layout here

<?php } ?>

However it works but my footer breaks on the new layout.

I have attached both files for you to see the code.

The original category layout is here:
http://www.bluebean.org.uk/category/web-design-portfolio

The new blog layout so far is here:
http://www.bluebean.org.uk/category/blog

Notice the footer. Hope someone could shine some light on the issue.

Thanks,

Andrew
category.php
loop.php
0
Comment
Question by:Andy6350
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
10 Comments
 
LVL 30

Expert Comment

by:IanTh
ID: 37756494
er

err
I cant see a difference in the footer
0
 

Author Comment

by:Andy6350
ID: 37756519
This is what i have on my screen on the blog layout, see attached...
blog.jpg
0
 

Author Comment

by:Andy6350
ID: 37762441
Can you see the difference now?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 30

Expert Comment

by:IanTh
ID: 37762612
footer 2

no
I have refreshed
0
 

Author Comment

by:Andy6350
ID: 37762878
The problem is on this page:

http://www.bluebean.org.uk/category/blog/planning-your-website

at the bottom, the footer doesn't spread 100% of the screen

This page does:
http://www.bluebean.org.uk/category/web-design-portfolio
0
 

Author Comment

by:Andy6350
ID: 37767344
Not sure if your seeing the issue i have or not
0
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 37788477
I am not seeing a problem but from your screen shot it looks like footer is inside wrapper. So possibly in your new-layout-here part you have forgotten to close a div.
0
 

Accepted Solution

by:
Andy6350 earned 0 total points
ID: 37805499
found out that it was a duplicated content div tag
0
 

Author Closing Comment

by:Andy6350
ID: 37822692
Found out it was a duplicated content div tag
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question