AardvarkGirl
Member
Posted 6 months ago #
I've got the "Magazine Columns" plugin, and it works fine on pages and on the 'single post' view.
http://www.ratest3.com/?p=37
But if you view this post on a custom category (template) page the columns don't work.
http://www.ratest3.com/?cat=4
[Code moderated as per the Forum Rules. Please use the pastebin]
twenty ten uses the excerpt in archive pages;
loop.php
<?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
occures at least twice in the code.
AardvarkGirl
Member
Posted 6 months ago #
I'm not using excerpt.. I had the code here, and I'm pretty sure it wasn't more than 10 lines.
http://pastebin.com/yYspi1rK
can you post the full template?
what theme are you using if your theme is not derived from twenty ten?
AardvarkGirl
Member
Posted 6 months ago #
twenty-ten deriv...
Created a category called 'menu', created a template named 'category-menu.php', this is the full template...
http://pastebin.com/7yTzWJHW
P.S. thanks for your time :)
you are right - i was just too lazy to download the plugin to have a look into the plugin code ;-(
unfortunately for you, it is designed to only work on singular posts or pages;
from the plugin code:
if(stristr($content, '<!--column-->') && is_singular()) {
it seems to be restricted that way to allow for the css styling of the columns -
ideally you would get into contact with the plugin author.
AardvarkGirl
Member
Posted 6 months ago #
Danke :) (nah... not lazy...)
In theory... could I slide in a && "is what I need" or take out the "is_singluar..." ? :-\ (ok, a php programmer I am not).
Just asking because, this plugin had some major bugs that I found on the forum, that someone else fixed, but to the best of my knowledge still has not be updated on WP.
http://wordpress.org/support/topic/plugin-magazine-columns-this-plugin-needs-a-fix-and-here-it-is?replies=8 (August)
http://wordpress.org/extend/plugins/magazine-columns/ (Last updated 4-14)
AardvarkGirl
Member
Posted 6 months ago #
Ok, I swapped out the "is_singular" for "is_archive" and it works on the archive, but then doesn't work on the singular page.
What is the correct code for doing both? :)
if(stristr($content, '<!--column-->') && is_singular()) {
you could try:
if(stristr($content, '<!--column-->') && (is_singular()||is_archive())) {
here is an adaption of the article you linked to, and some other edits to the core plugin file:
http://pastebin.com/neDrdX5Y
AardvarkGirl
Member
Posted 6 months ago #
It worked like a horse! :)
Danke Danke Danke.
AardvarkGirl
Member
Posted 6 months ago #
Ok, I came back to say... while it DID work, it caused something to go amok with any images that are in the column. It makes them like double the size. And I don't mean "Oh you inserted the image it's full size" - it took the image at its full size and about doubled it (all grainy / fuzzy etc).
I changed my version of the plugin back to '&& is_archive' because that is where I need the functionality.
Just wanted to give a heads up to anyone who might find this thread in the future. ;-)
It makes them like double the size.
in connection with the code in http://pastebin.com/neDrdX5Y -
the plugin adds a style for the images (line 111 in the pastebin):
echo " .columns img { width: 98% }\n";
(the same output as from the original plugin)
change that to:
echo " .columns img { max-width: 98% }\n";
----
however, stay with your approach if it is working for you.