Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Webcomic Post content Only Shows Latest Comic's #45

Open
Mihari opened this issue Jun 2, 2015 · 22 comments
Open

Webcomic Post content Only Shows Latest Comic's #45

Mihari opened this issue Jun 2, 2015 · 22 comments
Assignees
Labels

Comments

@Mihari
Copy link

Mihari commented Jun 2, 2015

As the subject says, the webcomic postbit only shows the latest comics text area, the title, and meta data all changes correctly, but the post does not.

@mgsisk mgsisk self-assigned this Jun 2, 2015
@mgsisk mgsisk added the question label Jun 2, 2015
@mgsisk
Copy link
Owner

mgsisk commented Jun 2, 2015

Can you link to an example? Dynamic navigation is usually the culprit, but this doesn't quite sound like a dynamic navigation issue…

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

http://paprika.katbox.net/
http://peterandcompany.katbox.net/
http://addictivescience.katbox.net/

Any of our newest comics using the latest inkblot seem to be having the issue.

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

I already checked the child theme and made sure the webcomic/content.php and the webcomic/display.php that were altered for our purposes were only different with the widget areas I added, so it's not the child theme.

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

For the record this is Inkblot 4.3

@mgsisk
Copy link
Owner

mgsisk commented Jun 2, 2015

That's… really interesting. It took me a minute to see what was going on. XD I'm not even sure this is an Inkblot issue, actually; I'd assume Webcomic is the culprit, but it's hard to tell. Which Webcomic are you using?

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

Version 4.3.2

@mgsisk
Copy link
Owner

mgsisk commented Jun 2, 2015

Can you try removing the Select a collection dropdown from the Webcomic nav's? I'm tempted to believe those are causing the trouble…

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

Removing them did resolve the incorrect display.

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

I was wondering how something like this could escape the majority of users, but being the dropdowns would do that.

@mgsisk
Copy link
Owner

mgsisk commented Jun 2, 2015

Well that's really annoying. Didn't I already fix this once? Specifically because it was causing issues on The Katbox? XD Those are just [Webcomic] Collections widgets, right?

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

Well, yes, but I don't know about it being specifically because of the Katbox. I just seem to notice all the issues most people don't use! :D

However, yes, it is that one, funny too tho, cause we were just talking about the dropdowns recently in the chat. XD

@mgsisk
Copy link
Owner

mgsisk commented Jun 2, 2015

Yeah, it was mgsisk/webcomic#186

I was (mostly) joking about fixing it for Katbox; it shouldn't be doing that for anyone. In fact it really shouldn't be doing that now; I'm not even sure how that's happening on those sites, because if you're using Webcomic 4.3.2 you should already have the fix.

The exact line numbers might be off, but can you check /webcomic/-/php/tags.php for:

public static function webcomic_dropdown_collections( $args = array() ) {
    global $post; $temp_post = $post;

    …[lots of code in here]…

    $post = $temp_post;

    return apply_filters( 'webcomic_dropdown_collections', $output, $r );
}

It should start on or around line 2496.

@Mihari
Copy link
Author

Mihari commented Jun 2, 2015

    public static function webcomic_dropdown_collections( $args = array() ) {
        global $post; $temp_post = $post;

        $r = wp_parse_args( $args, array(
            'select_name'      => 'webcomic_collections',
            'id'               => '',
            'class'            => '',
            'before'           => '',
            'after'            => '',
            'show_option_all'  => '',
            'show_option_none' => '',
            'hide_empty'       => true,
            'hide_if_empty'    => true,
            'collection'       => '',
            'order'            => 'ASC',
            'orderby'          => '',
            'callback'         => '',
            'webcomics'        => false,
            'webcomic_order'   => 'ASC',
            'webcomic_orderby' => 'date',
            'show_count'       => false,
            'target'           => 'archive',
            'selected'         => ''
        ) );

        extract( $r );

        $selected    = $selected ? $selected : self::get_webcomic_collection();
        $collections = self::get_webcomic_collections( true );

        if ( 'name' === $orderby ) {
            usort( $collections, array( 'WebcomicTag', 'sort_webcomic_collections_name' ) );
        } elseif ( 'slug' === $orderby ) {
            usort( $collections, array( 'WebcomicTag', 'sort_webcomic_collections_slug' ) );
        } elseif ( 'count' === $orderby ) {
            usort( $collections, array( 'WebcomicTag', 'sort_webcomic_collections_count' ) );
        } elseif ( 'updated' === $orderby ) {
            usort( $collections, array( 'WebcomicTag', 'sort_webcomic_collections_updated' ) );
        }

        if ( 'DESC' === $order ) {
            $collections = array_reverse( $collections );
        }

        $output = $options = '';

        foreach ( $collections as $v ) {
            if ( ( $readable_count = wp_count_posts( $v[ 'id' ], 'readable' ) and 0 < ( $readable_count->publish + $readable_count->private ) ) or !$hide_empty ) {
                if ( !$collection or $v[ 'id' ] === $collection ) {
                    $readable_count   = $readable_count ? $readable_count->publish + $readable_count->private : 0;
                    $collection_title = apply_filters( 'webcomic_collection_dropdown_title', $v[ 'name' ], $v );

                    if ( $webcomics ) {
                        $the_posts = new WP_Query( array( 'posts_per_page' => -1, 'post_type' => $v[ 'id' ], 'order' => $webcomic_order, 'orderby' => $webcomic_orderby ) );

                        if ( $the_posts->have_posts() ) {
                            if ( $callback ) {
                                $options .= call_user_func( $callback, $v, $r, $the_posts );
                            } else {
                                $options .= '<optgroup label="' . $collection_title . ( $show_count ? " ({$readable_count})" : '' ) . '">';

                                while ( $the_posts->have_posts() ) { $the_posts->the_post();
                                    $options .= '<option value="' . get_the_ID() . '" data-webcomic-url="' . apply_filters( 'the_permalink', get_permalink() ) . '"' . ( $selected === get_the_ID() ? ' selected' : '' ) . '>' . apply_filters( 'collection_dropdown_webcomic_title', the_title( '', '', false ), get_post(), $i ) . '</option>';
                                }

                                $options .= '</optgroup>';
                            }
                        }
                    } else {
                        $options .= $callback ? call_user_func( $callback, $v, $r ) : '<option value="' . $v[ 'id' ] . '" data-webcomic-url="' . ( 'archive' === $target ? get_post_type_archive_link( $v[ 'id' ] ) : self::get_relative_webcomic_link( $target, false, false, '', $v[ 'id' ] ) ) . '"' . ( $selected === $v[ 'id' ] ? ' selected' : '' . '>' ) . $collection_title . ( $show_count ? " ({$readable_count})" : '' ) . '</option>';
                    }
                }
            }
        }

        if ( $options or !$hide_if_empty ) {
            $output = $before . '<select' . ( $select_name ? ' name="' . esc_attr( $select_name ) . '"' : '' ) . ( $id ? ' id="' . esc_attr( $id ) . '"' : '' ) . ' class="' . implode( ' ', array_merge( array( 'webcomic-collections' ), ( array ) $class ) ) . '">' . ( $show_option_all ? '<option value="0"' . ( 0 === $selected ? ' selected' : '' ) . '>' . $show_option_all . '</option>' : '' ) . ( $show_option_none ? '<option value="-1"' . ( -1 === $selected ? ' selected' : '' ) . '>' . $show_option_none . '</option>' : '' ) . $options . '</select>' . $after;
        }

        $post = $temp_post;

        return apply_filters( 'webcomic_dropdown_collections', $output, $r );
    }

@mgsisk
Copy link
Owner

mgsisk commented Jun 13, 2015

I'll admit, this one still has me stumped. If anyone else has experienced this issue please chime in.

@Mihari
Copy link
Author

Mihari commented Jun 15, 2015

We can try that debug code this Wednesday if you like, or if you want to arrange a time sooner, let me know.

@metafarion
Copy link

I'm experiencing something similar to this, except in my case it DOES appear that dynamic navigation is causing it. If I disable dynamic navigation, all the page content changes as expected. With it enabled, the image and meta data change, but the post content does not. Webcomic 4.3.2 and Inkblot 4.5.2.

@Marajade208
Copy link

Metafarion, thank you for your post! I was having the same issue with the posts and when I unchecked the dynamic navigation, it fixed the problem. Thank goodness for an easy fix! So immensely helpful, I was stressing.

@metafarion
Copy link

It's an effective fix in a pinch, but it sure would be nice if we could get DN working to cut down on loading and scrolling :-P

@mgsisk
Copy link
Owner

mgsisk commented Oct 15, 2015

@metafarion and @Marajade208, can you provide a links to your sites?

@metafarion
Copy link

Ok, since the site is not in production yet, I'm switching back to vanilla Inkblot and re-enabling dynamic navigation so you can see: http://elainetipping.com/peter-pan/

Something I just noticed actually: I'm using the Webcomic Homepage template, and the main tag where the post content resides is not within the post-webcomic div which has the data-webcomic-container attribute. That's necessary for DN to work isn't it?

@Marajade208
Copy link

http://pastelmancer.com/

@Marajade208
Copy link

There's a lot of pressure on my end to make the site as customized as possible. My client (who's actually doing the web comic) loves the layout of a lot of the comics on http://www.thehiveworks.com/
I am really enjoying your theme @mgsisk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants