Forums

[Plugin: Magazine Columns] why plugin works in single post but not on cat page (12 posts)

  1. 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]

  2. alchymyth
    The Sweeper
    Posted 6 months ago #

    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.

  3. 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

  4. alchymyth
    The Sweeper
    Posted 6 months ago #

    can you post the full template?

    what theme are you using if your theme is not derived from twenty ten?

  5. 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 :)

  6. alchymyth
    The Sweeper
    Posted 6 months ago #

    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.

  7. 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)

  8. 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()) {

  9. alchymyth
    The Sweeper
    Posted 6 months ago #

    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

  10. AardvarkGirl
    Member
    Posted 6 months ago #

    It worked like a horse! :)

    Danke Danke Danke.

  11. 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. ;-)

  12. alchymyth
    The Sweeper
    Posted 6 months ago #

    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.

Reply

You must log in to post.

About this Topic