This topic has 19 replies, 2 voices, and was last updated 9 years by mitchcan.

  • Author
  • #70042
     mitchcan
    Participant

    I know what you’re thinking… “are you freakin’ kidding me? another question on page parts?”

    In my defense, if there was a single resource for all of the locations I could hook in to, I promise I wouldn’t ask so much. I really like Kleo, but in my last theme there was an entire plugin that listed every single hook opportunity, where it was and how to use it… great stuff that made it easy (and made for less questions). 🙂

    Anyhoo, I think I’m confused. (I know, nothing new, right?) 🙂

    I thought ‘kleo_before_content’ was an area on TOP of the content and sidebar(s). But when I have

    COPY CODE
    add_action('kleo_before_content','kleo_before_content_sidebar');
    function kleo_before_content_sidebar() {
    	echo '<div id="before-content-sidebar">', do_shortcode('[widgets_on_pages id="wop-2"]'), '</div>'; 
    }
    

    it generates a 40px x 4430px block down the left side of the page. It doesn’t matter if it is a sidebar page or a fullwidth page, it’s there either way.

    Did I mistakenly understand where this area is? or did I code the name in wrong? or is that just the way it is?

    In this case, I was just looking for the ability to put a custom ‘sidebar’ in the area that ran across the TOP of BOTH the main content and the (traditional) sidebar(s). Like ‘kleo_before_main_content’ goes just above the content.

    Does such a thing exist? 🙂

    Thanks.

    #70044
     mitchcan
    Participant

    hey, I think I found it in going through old code.

    kleo_before_main right?

    sheeesh all the names got me a little confuddled. Please LMK if I am missing any others, but I’ll work with what I gots until then. 🙂

    Thanks.

    #70052
     mitchcan
    Participant

    Here’s all I could find. I went through page-parts and other places looking for others. Am I missing any?

    kleo_before_main — above content incl SB, below header/menu (above breadcrumb if apply)

    kleo_before_content — adds sidebar-like column to the left of main-content (hmm?)

    kleo_before_main_content — above the main content only, not SB (incl above page title if apply)

    kleo_after_main_content — below the main content only, not SB

    kleo_after_content — adds sidebar-like column to the right of main-content (hmm?)

    kleo_after_main — below content incl SB, above footer

    I’m curious on the kleo_before_content and kleo_after_content … is this the intended functionality for those?

    I now have a nice, neat list. 🙂 Please LMK if there are others.

    Thanks.

    #70181
     Abe
    Keymaster

    Hi there, yes that is the list with actions and we will definitely add a nice list to the documentation. To display something before the content and the sidebar you should use “kleo_before_content action” since it adds content right before the content and sidebar

    Let me know if I understood your question right or you need any extra details.
    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #70184
     Abe
    Keymaster

    I added it to the docs with what I got now and will continue to update it: https://archived.seventhqueen.com/documentation/kleo#hooks

    Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #70325
     mitchcan
    Participant

    OK, thanks. A nice reference point in the docs will be helpful.

    A question on kleo_before_content

    For me, using this seems to add a vertical, almost sidebar-like section on a post/page, just before (beside) the main_content and sidebar areas. I was expecting this area to be a *horizontal* area, above both the main and the sidebar(s), but BELOW the breadcrumb (being that _before_main was already there ABOVE the breadcrumb).

    Can _kleo_before_content work like I was expecting? Or is this simply not the case?

    Thanks.

    #70360
     Abe
    Keymaster

    yes that is exactly what kleo_before_content hook does, it allows you to add something before main and sidebar content and it should be horizontal all the way.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #70371
     mitchcan
    Participant

    welp, then I have broken something. 🙂

    I get a *vertical* placement for both kleo_before_content and kleo_after_content. If I add a widget in those areas, it acts likes another vertical sidebar, breaking the page into halves or thirds, vertically.

    What should I look at that might be causing this?

    Thanks.

    #70580
     Abe
    Keymaster

    Give a link to your page to take a quick look

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #70595
     mitchcan
    Participant

    Well, I’ve commented out that code in functions because it was making the pages wonky.

    I’ll go back in and activate it and then put some content in those areas on a single page, and then add a link here.

    #70654
     mitchcan
    Participant
    This reply has been set as private.
    #70655
     mitchcan
    Participant
    This reply has been set as private.
    #71016
     Abe
    Keymaster

    very strange.. Please update the file located in page-parts/general-before-wrap.php with the one attached. This should fix your issue and this change will be included in the next update too.

    In addition to the code above, now you will add the content in a container like:

    COPY CODE
    
    	echo '<div class="container" id="side-before-content-sidebar">', do_shortcode('[widgets_on_pages id="wop-3"]'), '</div>';  //you could put a shortcode here if you want, too.
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
    #71039
     mitchcan
    Participant

    Yeah, it was really weird. Thanks for looking at it, I’ll update here once I have applied the fix.

    But hey, my apologies in advance for asking a dumb question, but I don’t see an attached file anywhere. Where would I see the file? Am I looking in the wrong spots?

    Thanks.

    #71100
     Abe
    Keymaster

    Just reattached it. Don’t know what happened 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #71135
     mitchcan
    Participant

    OK, so that worked fine. Thanks.

    However, wouldn’t we need to do the same thing with the kleo_after_main_content also? I ask because while the attached resolved the before issue, even though I added a container to the after also, it is still a display problem.

    I would mess with general-after-wrap like what was done with general-before-wrap, but I’m not sure exactly what to do, so any help there would be great.

    Thanks.

    P.S. Do I get some kind of award for having your post number 10,000? 🙂

    #71164
     mitchcan
    Participant

    I see you already pushed 3.0.6 with the before-wrap change, cool. I still need to fix the after-wrap. Thought I’d try this… so in general-after-wrap, would I put

    COPY CODE
    <section class="container-wrap main-color">
    	<div id="main-container" class="<?php echo $container; ?>">
    		<?php if($container == 'container') { ?><div class="row"> <?php } ?>
    
    			<div <?php echo $section_id;?>class="template-page <?php echo $main_tpl_classes; ?>">
    				<div class="wrap-content">

    on Line 20 after </div><!--end main-page-template-->

    or would there be anything else I’d need to do?

    I’m working without an net on a live site (tsk tsk) 🙂 so I just don’t want to screw it up.

    Thanks.

    #72390
     Abe
    Keymaster

    Sorry for the late reply. If you want to put something after the content and sidebar you can use kleo_after_main

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #74229
     mitchcan
    Participant

    Hey, just to update this and close it out. It looks like I don’t have any more issues with this. It was a good exercise though, after digging through all the code, I found a total of 10 places that it looks like I can hook into. Cool. 🙂

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    #74231
     mitchcan
    Participant

    Ignore that image, I resolved that issue too. Thanks.

Viewing 20 posts - 1 through 20 (of 20 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?