-
AuthorPosts
-
June 2, 2019 at 11:18 am #1106328
Hello,
I added a fullwidth submenu to all my pages, but the following pages don’t show it:
single blog post
archive
category.So we tried this code:
add_action( ‘ava_after_main_title’, ‘ava_after_main_title_mod’ );
function ava_after_main_title_mod() {
$the_id = null;if( is_archive() ) {
$the_id = 8416;
} else if( is_category() ) {
$the_id = 8420;
} else if( is_single() ) {
$the_id = 8412;
}// } else if( avia_get_option(‘blogpage’) == get_the_ID() ) { // the blog page
// $the_id = 8412;
// }$post = get_post( $the_id );
if( ! $post instanceof WP_Post || $post->ID == get_the_ID() ) {
return false;
}$content = Avia_Builder()->compile_post_content( $post );
echo $content;
}However, with this code the sidebar elements on the above pages showed on the very bottom of the page, instead of in the sidebar.
Would you be so kind and let me know how to add a fullwidth submenu to those pages?
AND: Any single blog post doesn’t show my PICTURE on top!
Thanks a lot.June 2, 2019 at 11:07 pm #1106461Hey NoraGTS,
Thanks for the login and page links, I checked each page but didn’t see your submenu on them, I assume this is because you are not happy with how it’s working. Yet I did see your code in your functions.phpI have not seen your function before, in the past this is the function that has worked for me:
add_action('ava_after_main_title', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { if(is_single()) { echo do_shortcode("[av_submenu which_menu='center' menu='25' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [av_submenu_item title='Menu Item 3'] [/av_submenu]"); } }
I tested this on your site and it works for “posts”, because that is what it is built for. It can be modified for archives.
But I believe your main issue is that the submenu is pushing your sidebar down. When using any “full width” element this is the expected action.
Unfortunately, we only have a few Hooks and none after the header and before the sidebar, I just tested them again with no luck.
I would recommend trying to create your posts with the Advanced Layout Builder and adding the submenu element and a widget element in a 1/3 column while your main content is in a 2/3 column.
Basically manually creating your post pages, but for your archive pages perhaps you can edit your template.
Sorry I was not more help.Best regards,
MikeJune 2, 2019 at 11:15 pm #1106468What is weird is, that it works fine on my BLOG page. Meaning, that on the page BLOG I have a fullwidth submenu, AND a sidebar, and both work perfectly together.
So I don’t understand why it’s not working for the single blog post, the archive or the category.
I don’t know why the fullwidth submenu isn’t showing – because I havn’t changed it NOT to show. Something must have gone wrong and I don’t know what. I appreciate your code, but creating a page for each single post is not an option.
However, what if I just NOT show a sidebar on a single blog post, the archive or the category pages. That way I could have the fullwidth submenu without any problem, correct?
Would you know how to set it to show on each of the 3 pages automatically, but no sidebar?
Thanks NoraJune 2, 2019 at 11:28 pm #1106479Hi,
I would recommend setting your theme option to no sidebar as the default, and then try adding this code to the end of your functions.php file in Appearance > Editor:add_action('ava_after_main_title', 'ava_after_main_title_mod'); function ava_after_main_title_mod() { echo do_shortcode("[av_submenu which_menu='center' menu='25' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [av_submenu_item title='Menu Item 3'] [/av_submenu]"); }
Best regards,
MikeJune 2, 2019 at 11:39 pm #1106484Do I need to get rid of any old codes in my function.php?
AND will this work for all 3 pages – single blog post, archive AND category?
Thanks NoraJune 2, 2019 at 11:43 pm #1106485I did that but the fullwidth submenu is still not showing. Neither on a single blog post, nor on any archive or category page.
AND my single blog posts don’t show any image on top.:-(
June 2, 2019 at 11:51 pm #1106488Hi,
I commented out your old function and added the new one, now the submenu shows on all 3 of the links above.
Please clear your browser cache and check.
I’m not sure which image should show on your single blog posts at the top, please advise.Best regards,
MikeJune 2, 2019 at 11:55 pm #1106491OH NO, now it shows double on ALL other pages – on every single one, and if I set the top image on some pages to look different for desktop or mobile, it shows BOTH images.
The BLOG POST IMAGE is not showing, meaning, if a post has a preview image it doesn’t show on the single blog post.
June 3, 2019 at 12:08 am #1106495Could you PLEASE bring back the old function – right now it’s really bad. The fullwidth submenu is showing TWICE on all other pages, and the top image is showing twice if I set it differently for desktop or mobile. And my BLOG page should be excluded from this code altogether, because this is the only page where I NEED to show a sidebar.
The BLOG POST IMAGE is not showing, meaning, if a post has a preview image it doesn’t show on the single blog post.
June 3, 2019 at 12:17 am #1106498I believe I resolved it myself. However, last time I did that it worked for 1 day, and then it didn’t anymore, although I didn’t change anything. So weird…
ONLY PROBLEM REMAINING: The BLOG POST IMAGE is not showing, meaning, if a post has a preview image it doesn’t show on the single blog post.
AND: the font in my single blog post is bigger than usual. Can you tell me how to reduce it?June 3, 2019 at 12:23 am #1106499Unbelievable, it worked for 1 minute, and now the fullwidth submenu disappeared again on the single post, archive and category page.
How is this possible. It was there, I swear, and now it’s gone again. Although I didn’t change anything. I’m getting a little desperate here…
Sorry Mike, I had to get rid of the code you set up, because this duplicated the submenu on ALL other pages, and it showed all the content I excluded for mobile/desktop twice as well. See above…June 3, 2019 at 12:23 am #1106500June 3, 2019 at 12:27 am #1106503Oh I think we did the same at the same time. Did I undo something that you just did? Because the submenu is not showing anymore on those 3 pages, although it did for a minute or so.
June 3, 2019 at 12:46 am #1106506Did I undo something you did? The submenu showed for a minute or so, and now it’s gone again on single post, archive and category. The function code, did I add it correctly? I’m really confused right now…
June 3, 2019 at 1:48 am #1106510Hi,
Sorry, I think we are both on the site at the same time, and I saw your message about the doubled submenus so I restored your code.Best regards,
MikeJune 3, 2019 at 9:11 am #1106625Thanks so much. Everything looks good now.
One last question: Would you know why my DATE on a single blog post, in archive an category doesn’t display in the center, but as if there was still a right sidebar? It’s shifting to the left side, whereas the rest of the content on the page is displayed in the center!
Thanks NoraJune 4, 2019 at 12:12 am #1106865Hi,
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#top.single span.text-sep-date { display: none !important; } .html_elegant-blog #top.single .post-entry .post-meta-infos { float: none !important; }
Best regards,
MikeJune 4, 2019 at 12:23 am #1106867Thanks, this works well on the single blog post post.
But the archive and the category page still shows the date to the left instead of centered.Also, the font size on a single post page is really big – much bigger than the rest of the font, which is set to 15px.
So I tried the following: I reduced the font in the GENERAL STYLING section to 13px, but then the body font reduces 2px as well. Even if I set the <body> to 15px in extended styling, it remains smaller. Is there a way around to reduce JUST the font size of a single blog post?Thanks so much!
June 4, 2019 at 4:25 am #1106904Hi,
Please try this css instead:#top span.text-sep-date { display: none !important; } .html_elegant-blog #top .post-entry .post-meta-infos { float: none !important; }
Best regards,
MikeJune 4, 2019 at 7:45 am #1106937Thanks so much.
Last questions, I promise:
1. In ARCHIVE it shows next to the date: FROM ADMIN (is thre a way to get rid of this?)
2. When flipping in between blog posts, there is this arrow to the left and right of each entry to flip to the next entry. Is there a way to change the background color to #71a4de when clicking on it?
3. I have a problem with the single blog post on MOBILE. The footer and the socket look all strange, they are displayed centered as well, and the padding to the left and right of the main text is quite big. And the font is also bigger than anywhere else. I set the font to 15px but it appears to display 18px.
THANKS Nora- This reply was modified 5 years, 5 months ago by NoraGTS.
June 7, 2019 at 3:33 am #1108118Hi,
Sorry for the late reply, I tried looking at your archive page for the author name next to the date, but I don’t see it, please link directly to a sample page so we can examine.
#2: Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:#top .avia-post-nav { background: #71a4de !important; }
#3: for your mobile footer, when I look the pading and margin matches the rest of your site, and the footer text seems to be 14px, which the headings seem to be 18px. PLease post a screenshot of what you see so we can be sure we are looking at the samething.
Best regards,
MikeJune 7, 2019 at 8:08 am #1108166Ok, thanks so much!
I added some information in the private section.
ONE MORE QUESTION: Is there a way to show the CATEGORIES on top of a BLOG, so you can flip in between categories?
THANKS NoraJune 8, 2019 at 3:32 am #1108359Hi,
For the author, please try this css:#top span.blog-author.minor-meta { display: none !important; }
I’ve been reminded that it helps other people when searching and mods when assisting, if we keep each thread under two pages and within a single issue. As the submenu issue has been solved, please open a new thread for your next issue.
Thank you for your understanding.Best regards,
MikeJune 8, 2019 at 8:47 am #1108418I understand Mike, but in that case I’m afraid that the fact that a single blog entry is showing the way it is, is due to the programming with the fullwidth submenu – because this problem only appeared AFTER adding the function. So if I start a new thread I need to explain the whole procedure – not? Please correct me if I’m wrong.
Thanks NoraJune 8, 2019 at 2:09 pm #1108437Hi,
When I look at your current questions now, I don’t see one that is related to the sub-menu.
When I look at your padding it seems average, but this css should help:@media only screen and (max-width: 767px) { #top > div.container_wrap.container_wrap_first.main_color.fullsize > div { padding: 0px !important; } }
Best regards,
MikeJune 8, 2019 at 2:36 pm #1108441No, it’s not the padding actually. ON MOBILE the single blog page doesn’t show like in mobile view, but in desktop view.
It’s as if the submenu coding changed the mobile view of a single blog post. Please look at the private section!June 8, 2019 at 6:24 pm #1108470Hi,
Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:@media only screen and (max-width: 767px) { #footer .flex_column { margin: 0; margin-bottom: 20px; width: 100% !important; } }
Best regards,
MikeJune 9, 2019 at 9:19 am #1108562Thanks, however the headers of the footer don’t show the borders and it’s centered, the socket seems different and the font is still bigger than normal. it’s really as if the system doesn’t realize that you’re on a smartphone.
However, if this is the best we can do I can live with it – it’s just different than a normal smartphone view of other pages…
Can you take a look at it on a smartphone?June 12, 2019 at 4:35 am #1109327Hi,
Sorry for the late reply, to add the lines above and below of the widget title, Please try this code in the General Styling > Quick CSS field or in the WordPress > Customize > Additional CSS field:h3.widgettitle { border-style: solid; border-width: 1px 0 1px 0; padding: 10px 0 10px 0; }
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.