-
AuthorPosts
-
October 20, 2019 at 10:20 pm #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. :)October 21, 2019 at 6:10 pm #1149925Hello 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!October 23, 2019 at 7:13 pm #1150589Just bumping this up since I posted it three days ago and wasn’t sure if it was seen.
TIA.October 24, 2019 at 1:45 pm #1150881Hi,
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,
IsmaelOctober 29, 2019 at 1:08 am #1151967Thanks 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.
October 30, 2019 at 8:52 am #1152240Hi,
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,
IsmaelNovember 1, 2019 at 5:39 am #1152922Thanks 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?
November 5, 2019 at 3:40 am #1153862Hello, it’s been three days now since I last updated this thread. Would love to make some forward progress on this. Thanks!
November 7, 2019 at 4:54 am #1154515Hello, 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!
November 8, 2019 at 3:47 am #1154820Hi,
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,
IsmaelNovember 8, 2019 at 4:33 am #1154830Hi 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!November 12, 2019 at 6:14 am #1155829Hi,
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,
IsmaelNovember 12, 2019 at 6:40 am #1155839Ismael,
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.November 12, 2019 at 7:35 am #1155851Hi,
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,
IsmaelNovember 12, 2019 at 11:07 pm #1156226Hi 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.November 15, 2019 at 9:00 am #1157091Hi,
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,
IsmaelNovember 21, 2019 at 6:04 pm #1158863Hi 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!
November 22, 2019 at 10:23 am #1159052Hi,
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,
IsmaelNovember 22, 2019 at 6:40 pm #1159273I’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?November 25, 2019 at 3:37 am #1159747Hi,
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,
IsmaelNovember 25, 2019 at 4:18 am #1159756Hooray! 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. :)
November 26, 2019 at 3:01 am #1160159 -
AuthorPosts
- You must be logged in to reply to this topic.