• ? I have some images to stand in for my comic; Check!

    ? I placed code (<?php do_action(‘comic-area’); ?>) in index.php and the “comic” appears where it should on the main page; Check!

    ? I click on the “previous” button and I’m taken to a blog post with the earlier “comic” instead of remaining on the main page. I can navigate between blog posts, but that’s not right. The navigating shouldn’t leave the main page.

    I’ve tried different themes, placing code in different place, and fighting this for a couple of days and just can’t seem to figure it out. What am I missing? What am I doing wrong?

    How can I make it work properly?

    Thank you for your help!

    (My test page — https://abugandaflea.com/wordpress/)

Viewing 1 replies (of 1 total)
  • Short answer: That’s not how it works.

    The comic updates are posts, like the regular blog posts but within their own little taxonomy. This means each of these posts comes with its own blog post within its chapter and, if those are activated, category, and all of those define their own post page (not in the WordPress sense of page, that’s yet another taxonomy, more in the common-sense sense) and that’s what the navigation links to.

    Also, the index.php is not your main page in WordPress. It’s the general base for how every page is built, or more to the point, every page that isn’t defined differently by other templates. If you want your code to show only on the home page, look for a template called ‘home.php’ (or create one) and place the code there. Then again, this won’t restrict your comic area with all its functionalities to the main page either. The comic posts will still be created and linked to in the navigation, but it’s possible they’ll show without leading images because that code is only happening on your home page.

    Now, if you want your comic to really only appear on the main page and to navigate within that, I think there are several possibilities, but I’d understand if you didn’t like any of them:

    – Don’t use comics as posts. Instead, activate Multi-Comic Support for one comic post (there’s a checkbox for that) and call your image files from there. I haven’t tried it myself yet but I’m assured it creates a javascript-enabled presentation that allows for several images (i.e. comics, if you use it that way) within one post. (Also, deactivate the navigation in Config to avoid confusion.) This can get messy if you want to upload a lot of comics to that post because that’s what the individual posts and the navigation are for.

    – Alternately, don’t use the comic posts themselves on your homepage. Instead, use custmoized thumbnail previews (you can make them as elaborate as you want and even use full-size images as ‘thumbnails’) and show them within a carousel or slider. There are plugins for that. Make sure they work with custom post types, though, and that they support whatever amount of such previuews you have in mind.

    – Instead of limiting the comics to your main page, take the main page with you to the comics’ posts. Just put everything you need from the main page into sidebars, adjust the template for the comic post layout if needed and roll with it. (This is the one I’d recommend.)

    – Create a frameset for your home page and place the comic area within that. This is probably closest to what you have in mind, but it involves most meddling with php and/or finding a theme that does that (some themes offer special areas for the home page that you might exploit) and still meddling with the php. It’s possible but messy.

    Please note, though, that this whole business of creating individual posts isn’t a bug, it’s a feature. It allows for you to customize individual posts and pages, add commentary and to link to each comic individually if you want to create attention for one of them. It’s how blogs wortk and it’s what WP was built for. Going against that will remain an uphill battle. It’s better to read up on how WP’s architecture is set up and adjust your project so it can work with it.

Viewing 1 replies (of 1 total)
  • The topic ‘How to keep navigation on main page’ is closed to new replies.