Tagged: ALB, special heading
-
AuthorPosts
-
October 10, 2021 at 6:04 pm #1324297
Hi:
I like the special heading element form ALB as the main heading for a page (h1). This is particularly useful for a page template for something like portfolio entries. However, it’s a hassle to have to retype the page title for a portfolio entry into the element every time. I tried using a shortcode to render the page title inside the heading of the special heading element, but it breaks — note, it does not break inside a text block, just special heading.Is there a way to enable special heading to take a shortcode? Perhaps this leads to too many issues? If there’s not a way to do it, I would say a feature enhancement is to have a configuration for the element that lets you check a box to display the page heading as the ‘Special heading’ text. That would be a handy feature.
Thanks for listening.
October 10, 2021 at 7:19 pm #1324303Hey ilowelife,
Try adding the special heading with the call to the title as a shortcode instead, for example use the shortcode wand to get the special heading shortcode:
after using the element popup you will have the element shortcode:
now we can create our shortcode function replacing the word “title” with the WordPress call". get_the_title() . "
please note the double quotes around the call:
//use this as the shortcode: [page_title] function page_title_sc( ){ echo do_shortcode("[av_heading heading='". get_the_title() . "' tag='h1' style='' subheading_active='' show_icon='' icon='ue800' font='entypo-fontello' size='' av-medium-font-size-title='' av-small-font-size-title='' av-mini-font-size-title='' subheading_size='' av-medium-font-size='' av-small-font-size='' av-mini-font-size='' icon_size='' av-medium-font-size-1='' av-small-font-size-1='' av-mini-font-size-1='' color='' custom_font='' subheading_color='' seperator_color='' icon_color='' margin='' margin_sync='true' padding='10' icon_padding='10' headline_padding='' headline_padding_sync='true' link='' link_target='' id='' custom_class='' template_class='' av_uid='' sc_version='1.0' admin_preview_bg=''][/av_heading]"); } add_shortcode( 'page_title', 'page_title_sc' );
here I added it to a text element in an Advanced Layout Builder page with the real title hidden with the layout option:
and here is the result:
Please give this a try.Best regards,
MikeOctober 11, 2021 at 5:41 am #1324358I’ll give that a try, thanks @Mike.
October 11, 2021 at 11:05 am #1324386 -
AuthorPosts
- You must be logged in to reply to this topic.