-
AuthorPosts
-
January 26, 2018 at 5:33 pm #903444
Hi,
I am looking to reposition the Title Bar to below the first page element. I had achieved this before with php but lost it with a theme update because I didn’t set up a child theme, and can’t seem to find it again :)
What would be the best way of going about this? See here the the title bar is showing at the top, where it should be below the image, which is put in as the first element.
Thanks in advance
January 26, 2018 at 5:55 pm #903454Hey kona123,
I’m having a little trouble understanding exactly what you need. Can you provide a screenshot or be a little more clear on where you need things positioned? Also, if possible in the private section please provide admin and ftp info so we can loo into this further.
Best regards,
Jordan ShannonJanuary 26, 2018 at 11:09 pm #903556Hi Jordan,
Here is a screenshot of how it looked before.
http://www.tvsrbsa.org/wp-content/uploads/2017/10/Screen-Shot-2017-10-25-at-5.57.32-PM.pngvs how the same page is now
Essentially, I would like a featured image to be displayed as a banner on the page. But this does not hold true for every page, as on the homepage I have a video. So I achieved this last time by inserting some code that positioned the Title Bar after the first page builder element.
Thanks!
- This reply was modified 6 years, 10 months ago by kona123.
January 29, 2018 at 5:18 am #904014Hi kona123,
Can you please give us the htpassword as well?
https://cl.ly/0K0C1i3N0O2r and remove this code form you Quick cssBest regards,
Victoria- This reply was modified 6 years, 10 months ago by Victoria.
January 29, 2018 at 5:10 pm #904317Hi Victoria,
Removing that breaks the intended design of moving the page body up to create the floating heading, though it’s very likely there’s better way of doing what I have done. You can see this on the Home Page which has the title bar disabled and in the screenshot linked above.
Whatever it was that was done was done using PHP to insert the Title Bar after the first Avia page builder element/section.
Thanks!
- This reply was modified 6 years, 9 months ago by kona123.
January 30, 2018 at 1:26 pm #904841Hi kona123,
I understand, it’s just that at least the page does not look broken without that code.
Here is how to insert title and breadcrumbs as a shortcodeIf you need further assistance please let us know.
Best regards,
VictoriaJanuary 30, 2018 at 10:11 pm #905181Hi Victoria,
That isn’t how I had done it before, but I tried it anyway, it would take some more css to make it look right, so I am wondering if you know of a way to do this in functions.php? I believe that is how the user I found did it. What I’m looking for essentially is a way to insert the title bar after the first Avia Section (I said element before), on any page that has Breadcrumbs enabled. As you can see, all of my pages have a color section with a background image, title, and two spacers. The title bar was automatically inserted below this for every post and page.
I have been scouring the site to find what on earth I did last time, it was so simple it must’ve been that forgettable.. I suppose this is what I get for not keeping track of things as I do them.
Thanks again for your time
February 1, 2018 at 8:10 am #906015Hi,
The title bar will not be rendered if the page has a transparent header. You have to use the shortcode above. We’ll provide the css modification if necessary.
Best regards,
IsmaelFebruary 1, 2018 at 10:02 pm #906483Hi Ismael,
Thanks for your response. I am not currently using the transparent header option, I’ve used custom css to create the look. As you can see from the screenshot I linked, I am looking for the method I used prior which was very simple and clean.
http://www.tvsrbsa.org/wp-content/uploads/2017/10/Screen-Shot-2017-10-25-at-5.57.32-PM.png
Edit – For clarity, the large photo on top of the page is the background of an Avia Colorblock.Do you know of a way, to automatically, likely through functions, insert the title bar after the first Avia Section (I said element before), on any page that has Breadcrumbs enabled?
- This reply was modified 6 years, 9 months ago by kona123.
February 4, 2018 at 7:45 am #907385Hi kona123,
Here is how to do it
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 4, 2018 at 7:58 am #907389by the way – a little off-topic – i see that breadcrumps title gets a h1 – this is on my opinion a bit to much.
If i want to set a h1 on that page – we got more than one h1 – not a good practice.February 4, 2018 at 10:57 am #907426Choose to show breadcrumb on those pages you like to show!
you can try to change position of av_section_1 and the title container via functions.php of your child-theme:
function change_position(){ ?> <script> (function($){ $('#av_section_1').each(function () { $(this).insertBefore($(this).prev('#main .title_container')); }); })(jQuery); </script> <?php } add_action('wp_footer', 'change_position');
if you have transparency option – in this case the breadcrumb can be displayed – but i have to look in code where the breadcrumb output is prevented in this case.
Edit: on functions-enfold.php on line 824ff (Enfold 4.2.2) ( if you got older Enfold Versions – search for that)
to comment it out://deactivate title bar if header is transparent if(!empty($transparency)) $header['header_title_bar'] = 'hidden_title_bar';
so there is:
//deactivate title bar if header is transparent //if(!empty($transparency)) $header['header_title_bar'] = 'hidden_title_bar';
has the solution – if we could do this via child-theme ? i don’t know (now) how-to
see here in action (with transparency option): https://webers-testseite.de/breadcrump-under-first-color-section/
- This reply was modified 6 years, 9 months ago by Guenni007.
February 4, 2018 at 11:38 am #907454well to have it on sliders and on first-color-section too take instead:
function change_position(){ ?> <script> (function($){ $('div.avia-builder-el-first').each(function () { $(this).insertBefore($(this).prev('#main .title_container')); }); })(jQuery); </script> <?php } add_action('wp_footer', 'change_position');
https://webers-testseite.de/breadcrumb-under-sliders/
or here with your kind of header and logo: https://webers-testseite.de/weber/service/- This reply was modified 6 years, 9 months ago by Guenni007.
February 4, 2018 at 6:30 pm #907565by the way – i was wondering about performance ou your site : your images on top ( f.e. on http://www.tvsrbsa.org/early-bird-pre-order-sale/) are too big ! (think of loading time)
12MB as jpg ( opend it is nearly 70MB)
this here has 117kb (on full resolution – the image hoster shrinks it to 1200px width) and i think that is with its blur more than enought. your second on my testpage link in slider has 144kb.
or here with your kind of header and logo and your background: https://webers-testseite.de/weber/service/
February 5, 2018 at 9:26 am #907799By the way – dear Mods – how could a shortcode solve that problem.
I first tried to do it this way. but if the option of a breadcrumb isn’t set in editor for the page/post the shortcode does not work.
How to insert a shortcode via child-theme. Append it does not work – or do you know a way to do it?The way on top is a clean way – because it uses the existing breadcrumb – and only changes position!
February 5, 2018 at 1:33 pm #907937Hi Guenni007,
What do you mean it does not work as shortcode? The option to show title and breadcrumbs might be not set in theme options. Have you checked that?
Best regards,
VictoriaFebruary 5, 2018 at 2:12 pm #907969Thank you so much Guenni007! That’s awesome and I’ve got it in place now.
Thank you also for taking the time to try it out on your own site, I appreciate it a lot. Also thanks for pointing out the image sizes, I will look into compressing them. Definitely an oversight on my part putting this site together quickly.
I did first try the short code method, but like I mentioned above, it does not look right without even more custom css than I am already using – this is very clean.
Thanks all for your time, very much enjoying the theme and great support.
February 5, 2018 at 2:16 pm #907978Hi,
@Guenni007 thanks for sharing your solution, well done.Best regards,
MikeFebruary 7, 2018 at 2:20 pm #909168so i can destroy the test-page with your images!
If you haven’t transparency headers – everything is ok on updating the parent theme – but with transparency header option
think of commenting that line out in Parent-theme will get lost on update. So you have to do it again in this case.
I don’t know how to do it via child-themeFebruary 7, 2018 at 4:11 pm #909243is it possible to get rid of that transparency test via
avf_header_setting_filter
?it was possible to activate the secondary menu without having elements in it via:
add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 9999, 1); function avf_header_setting_filter_mod($header) { $header['header_secondary_menu'] = 'extra_header_active'; return $header; }
so there must be a filter look like this to have output of breadcrumb even vor transparency headers ?
February 9, 2018 at 1:19 am #910071Hi,
Please try to set the “header_title_bar” settings to “title_bar_breadcrumb”. For transparency, set the “header_transparency” to “header_transparent”.
Best regards,
IsmaelFebruary 10, 2018 at 5:42 pm #910579Thanks – thats it – but i want transparency option is set on page/post editor
So this will be enough:add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 9999, 1); function avf_header_setting_filter_mod($header) { $header['header_title_bar'] = 'title_bar_breadcrumb'; return $header; }
February 10, 2018 at 6:32 pm #910601no – to early
it should be not set globaly
i want to get rid of that check via child-theme
the transparency does not allow breadcrump because://deactivate title bar if header is transparent if(!empty($transparency)) $header['header_title_bar'] = 'hidden_title_bar';
header_title_bar should get the selected value even for transparency is set.
but i think there must be a child-theme solution to uncomment thisFebruary 11, 2018 at 9:37 am #910723yes i know that i can totaly copy the function to child-theme functions.php – but there must be a more elegant way to avoid that transparency check.
February 12, 2018 at 12:55 pm #911073Hi,
You can check for the current value of the “header_transparency” settings. If it is filled or has value, set the header_title_bar to something else.
Best regards,
IsmaelFebruary 12, 2018 at 6:20 pm #911251yes – but i want to have the opportunity to have the choice on page/post editior to set it to be hidden.
(Thats is the following when i uncomment that transparency check on functions-enfold.php)
the following will cause every header to have titlebar.https://kriesi.at/support/topic/position-title-bar-below-first-element/#post-910579
the following does not overwrite:
//deactivate title bar if header is transparent if(!empty($transparency)) $header['header_title_bar'] = 'hidden_title_bar';
but even if it does : I want to preserve the choice on page/post editor to set it to be hidden
if that code here would overwrite the transparency check every transparency header will have forced title-baradd_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 9999, 1); function avf_header_setting_filter_mod($header) { if(!empty($transparency)) $header['header_title_bar'] = 'title_bar_breadcrumb'; return $header; }
so i thought if a rule would be more specific than the transparency check could overwrite the parent check.
Something like if transparency setting is not empty && header_title_bar is not hidden_title_bar than $header header_title_bar should be the value what is set in meta.
But i can not reach it.- This reply was modified 6 years, 9 months ago by Guenni007.
February 14, 2018 at 1:19 am #912005Hi,
Did you check the value of the “header_transparency” settings? Check if it’s empty or if it has a particular string in it. You may need to use the strpos function.
// http://php.net/manual/en/function.strpos.php
Example:
//check if header transparency is set to true $transparency = get_post_meta(get_the_ID(), 'header_transparency', true); if (!empty($transparency)) { $header['header_title_bar'] = 'title_bar_breadcrumb'; } return $header;
Best regards,
IsmaelFebruary 14, 2018 at 8:23 pm #912451We talk past each other – I do not want to change that globally, but have the opportunity to have the choice even on transparent headers to set the titlebar – even to be hidden.
But i want to have the choice even for transparency header to have title bar !
In other words : I do not want to be patronized if I want one or not
or : as if the check from line 824/825 wasn’t there://deactivate title bar if header is transparent if(!empty($transparency)) $header['header_title_bar'] = 'hidden_title_bar';
Test your code – create a page with transparency and choose hidden title-bar. Now the title bar is there.
on all tranparencies now – there is a title-bar.
Without your code and show title-bar and transparency – titlebar is not there.is there a method to get rid of these two lines 824/825 with a filter via child-theme –
or is the only way to have that by copy the whole function to child-theme:if(!function_exists('avia_header_setting')) { function avia_header_setting($single_val = false) { …
February 16, 2018 at 3:54 am #913065Hi,
I apologize for the confusion and I didn’t mean to sound patronizing. Yes, you can copy the whole “avia_header_setting” function in the child theme without the function_exists check. Or maybe, create a new option, example by Josue here.
Best regards,
IsmaelFebruary 16, 2018 at 1:34 pm #913248sorry ismael – i don’t adress this to you but to the code of enfold.
i guess it will be much easier to change the mark on meta-box ( to have hidden title_bar ) than trying to get rid of that transparency check.
What is the worst case could happen : A user set the transparency option and has perhaps on Enfold global options : show title bar.
When he looks to his page – he will check the mismatch – goes to editor again an set the whole thing to hidden_title bar.
So maybe it would be a better idea to not have the transparency check at all._____________
But on that topic here i remembered the change position code ! i i tried to position the header completely to the bottom:
function change_position(){ ?> <script> (function($){ $('#main').each(function () { $(this).insertBefore($(this).prev('#header')); }); $('#header_main').each(function () { $(this).insertBefore($(this).prev('#header_meta')); }); })(jQuery); </script> <?php } add_action('wp_footer', 'change_position');
https://webers-testseite.de/weber/
nice and even the hamburger and “drop-down” menu will go on working :lol
on ipad and an old iphone4s it works –
only the chrome browser has a little time shift on loading the page.- This reply was modified 6 years, 9 months ago by Guenni007.
-
AuthorPosts
- The topic ‘Position Title Bar below first element’ is closed to new replies.