• Resolved hatchb4ck

    (@hatchb4ck)


    I’ve been building a child theme for twenty twenty and found that whenever I navigate to manga press pages (latest, archive, individual comic pages) the theme’s header is no where to be found.

    I see a

    do_action('mangapress_get_comic_header');

    in all of the manga+press template files but after tracking it back through the various php files in the plugin I run into a dead end at

    do_action("mangapress_get_template_part_{$slug}", $slug, $name);

    in the theme_functions.php file.

    I may be reading this improperly, I am a php novice, but that do_action should evaluate to

    do_action("mangapress_get_template_part_header", header, comic);

    I have not been able to locate the add_action for ‘mangapress_get_template_part_header’ anywhere in the plugin files.

    Perhaps this is the wrong place to be looking for the issue.

    Any insights on what I may be missing would be very helpful.

    Thanks.

    Joe

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hatchb4ck

    (@hatchb4ck)

    A bunch of digging later I have got the items ironed out for manga+press compatibility with the twentytwenty theme.

    Before going on, I want to apologize ahead of time to Jess, the plugin author, if what I’ve done is a “faux pas”.

    I made the following changes to the plugin:

    1. Added the following to the ‘public static $classMap’ array in vendor\composer\autoload_static.php

    'MangaPress\\Theme\\Compatible\\Twentytwenty' => __DIR__ . '/../..' . '/src/Theme/Compatible/Twentytwenty.php'

    2. Added the following to the ‘return’ array in vendor\composer\autoload_classmap.php

    'MangaPress\\Theme\\Compatible\\Twentytwenty' => $baseDir . '/src/Theme/Compatible/Twentytwenty.php'

    3. Copied resources\assets\css\twentynineteen.css to resources\assets\css\twentytwenty.css. The CSS isn’t perfect, but its a starting point for me to modify in my child theme.

    4. Using all of the provided files in src\theme\compatible as examples, created a Twentytwenty.php in that directory.

    Again, I am sorry if this is somehow disrespectful to the plugin author. I realize that an upgrade to the plugin will destroy these changes. Hopefully the next update has the twentytwenty compatibility built in.

    If the developer would like me to send a copy of my Twentytwenty.php, I am happy to do so. I’m sure they can make it better.

    • This reply was modified 4 years, 9 months ago by hatchb4ck.
    Plugin Author Jess

    (@ardathksheyna)

    No apologies necessary! You basically just created a theme support class for TwentyTwenty, which I can tweak and add to the next release so many thanks there!

    Yeah, a plugin upgrade would definitely destroy those changes. Also, any changes to the files under the /vendor/ directory would be overridden if you ran Composer.

    Once again, thanks!

    Thread Starter hatchb4ck

    (@hatchb4ck)

    I’m still working through some issues with what I’ve created. The modal-menu functionality that is present on other twentytwenty pages isn’t present in the manga+press pages.

    I’m pretty close to getting it resolved.

    Plugin Author Jess

    (@ardathksheyna)

    A head’s up: instead of modifying the plugin, add your new class to your own theme and load it via the mangapress_theme_compatible-{$theme} hook. In this case, it would actually be mangapress_theme_compatible-twentytwenty.

    Example:

    
    function mytheme_twentytwenty_compat() {
       require_once "class-twentytwenty.php";
    }
    add_action('mangapress_theme_compatible-twentytwenty', 'mytheme_twentytwenty_compat');
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘theme header not loading on manga+press pages’ is closed to new replies.