Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #1149665

    Hello,
    With help I received here, I created custom code to put the same header image on all my 175+ blog posts. The same header image is on all the category pages.

    However, right now I’m in a position where I’d like to change the header image for let’s say – one post at a time.

    Specifically I’m using LearnDash and it sets up all the courses, lessons and topics as if they are posts.
    I have figured out a way to add some code so that I have the advanced editor to use on these pages. But These pages are acting like “posts,” in that the same menu and header image is automatically inherited and going on all of them (adding a slider or menu in the editor just adds extra ones) – whereas I want to customize it for each course page.

    I would like to get some custom code to do this – However, I don’t want to remove the existing header (and menu) that automatically goes all my blog posts and the Articles + Videos page.

    I really just need this for the course pages.

    Here’s a past post where there was some discussion about this this is set up – https://kriesi.at/support/topic/advanced-layout-editor-for-blog-post-page/
    Will post site info. below. TIA. :)

    #1149925

    Hello Kriesi Team,
    I just renewed my support for another six months, so am bumping this up and looking forward to getting a reply to my question (above) soon so I can move forward.
    Thanks so much!

    #1150589

    Just bumping this up since I posted it three days ago and wasn’t sure if it was seen.
    TIA.

    #1150881

    Hi,

    Thank you for the inquiry.

    You can use the is_singular(‘sfwd-courses’) conditional tag to display a slider only on the course pages.

    This is the previous snippet:

    // https://pastebin.com/Gm8U9Z14

    Thread: https://kriesi.at/support/topic/advanced-layout-editor-for-blog-post-page/#post-994194

    You can duplicate the snippet and change the function name “ava_after_main_container_mod” to something else. Then adjust the this line:

     if(is_single()) {
            echo $output;
        }
    

    ,.. to:

     if(is_singular('sfwd-courses')) {
            echo $output;
        }
    

    Best regards,
    Ismael

    #1151967

    Thanks for the help!
    I did as you suggested, using the current snipped (the old one you posted from before has been updated) and it worked to add the header I want (the Love It, Live It, Learn It one), but it also kept the existing header image – so on the course pages, now there are two.

    How do I get ride of the old / first header? I’ll put a link and code below.

    #1152240

    Hi,

    Thank you for the update.

    but it also kept the existing header image – so on the course pages, now there are two.

    We should update the conditional tag in the previous snippet. Please look for this line inside the first action hook.

    if(is_single()) {
    

    .., then replace it with:

    if(is_single() && !is_singular('sfwd-courses')) {
    

    This will prevent the initial slider from displaying in the courses page or post.

    Best regards,
    Ismael

    #1152922

    Thanks for the suggestion Ismael, I did what you said but it went back to showing the original header image, instead of the one I wanted there. AND – on blog post pages, it started showing the TWO header images – yikes! I changed it back to what we had for now. Do you have another idea?

    #1153862

    Hello, it’s been three days now since I last updated this thread. Would love to make some forward progress on this. Thanks!

    #1154515

    Hello, it’s been six days now since I posted the last update and question, would love to get some help on this, please see update above. Thanks!

    #1154820

    Hi,

    Sorry for the delay. Just got back. Did you apply the changes in the older snippet? It’s supposed to hide the second slider in the default posts, and hide the first slider in the course posts.

    Best regards,
    Ismael

    #1154830

    Hi Ismael,

    I did all the changes you suggested, and posted my results above, which weren’t successful. BTW, that old snippet from way back is a little different now, so it’s important to use the existing code. My site info. is above – do you mind checking/testing it for me? So far what you’ve suggested that I’ve tried hasn’t worked.
    Thanks!

    #1155829

    Hi,

    Sorry for the delay. Where did you add the second snippet? We can’t find it in the functions.php file, so we just modified the first snippet and applied the conditional tag that we suggested above.

    if((is_single() && !is_singular('sfwd-courses')) || is_archive()) {}

    Best regards,
    Ismael

    #1155839

    Ismael,
    I don’t recall removing the second snippet I added, there should have still been a duplicate there in the functions.php file?
    I just checked the page we are trying to create the header image for, and now it has NO image at all. I’ll put the link below again for you to see.

    #1155851

    Hi,

    There is only one “ava_after_main_container” hook in the functions.php file. Please add the second one containing the new slider for the courses page.

    and now it has NO image at all.

    The first slider is not displaying in the courses page anymore because we added the above conditional tag in the first snippet. It is what you requested previously because you wanted to use another slider for the courses page.

    Best regards,
    Ismael

    #1156226

    Hi Ismael,
    I very carefully added the snippet that was there before, and it seems like it works! Thanks for the help. I’d like to leave this thread open a little longer just to make sure.

    #1157091

    Hi,

    Awesome! Glad it works. We’ll keep the thread open as long as you wish. Please don’t hesitate to give us an update if anything comes up.

    Best regards,
    Ismael

    #1158863

    Hi Ismael,
    This is very urgent this time. I’m getting closer to needing to launch this online course, so I’m hoping you can respond right away.
    I need to have the same “Love it, Live it, Learn it” header on ALL the lesson and module pages within all the courses.

    Do you have some insight for code on how we can do that?

    Thanks!

    #1159052

    Hi,

    Thank you for the update.

    We can’t access the modules from the courses page. Can you give us a direct link to a lesson and module page?

    What is the name of the plugin that you’re using for these modules? A link to the plugin’s documentation will surely help because we need to know the exact name or slug of the custom post type.

    Best regards,
    Ismael

    #1159273

    I’m using LearnDash. All the lessons and modules are visible under the LearnDash LMS area in the Dashboard. All this information was provided in the original questions (also see some links in the PC above).

    The slugs/post types are:
    $supported_post_types[] = ‘sfwd-courses’;
    $supported_post_types[] = ‘sfwd-lessons’;
    $supported_post_types[] = ‘sfwd-topic’;
    $supported_post_types[] = ‘sfwd-quiz’;

    However, I changed the name of lessons to – modules
    and topics to – lessons, in the settings, not sure if that matters?

    #1159747

    Hi,

    Thank you for the info.

    We modified the conditional tag in the functions.php file. It should now display the appropriate banners in the corresponding post types.

    Best regards,
    Ismael

    #1159756

    Hooray! Thanks for fixing this Ismael, it looks good!
    I’d like to keep the thread open a little while longer just in case something else comes up as I’m getting the course set up.

    Thanks again. :)

    #1160159

    Hi,

    You’re welcome! We’ll keep the thread open. Have a nice day!

    Best regards,
    Ismael

Viewing 22 posts - 1 through 22 (of 22 total)
  • You must be logged in to reply to this topic.