Solved

Wordpress loop

Posted on 2012-03-23
10
451 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
  • 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
 
LVL 30

Expert Comment

by:IanTh
ID: 37762612
footer 2

no
I have refreshed
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now