Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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.

    #1324303

    Hey 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:
    using_shortcode_wand_for_special_heading.jpg
    after using the element popup you will have the element shortcode:
    the_shortcode_for_special_heading.jpg
    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:
    the_shortcode_function_created_for_special_heading.jpg

    //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:
    the_shortcode_used_for_special_heading.jpg
    and here is the result:
    the_result_shortcode_used_for_special_heading.jpg
    Please give this a try.

    Best regards,
    Mike

    #1324358

    I’ll give that a try, thanks @Mike.

    #1324386

    Hi,

    Thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

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