Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #732049

    I’m trying to apply a fullwidth submenu with my blog categories to all my blog pages (i.e. not just the main blog page where the submenu was made but all the individual pages and all the category filtered pages). I haven’t been able to find a clear solution on the forum. Presumably there isn’t a way to do this in the theme itself. Is there a way I can add something to my Childtheme’s function.php to enable it?

    Cheers!

    Thomas

    #733163

    Anyone out there?

    #733849

    Hi,

    Thank you for using Enfold.

    You have to modify the archive.php template file if you want to add the submenu element in the category pages. Use the do_shortcode function in combination with the full width sub menu element shortcode.

    // https://developer.wordpress.org/reference/functions/do_shortcode/

    Example:

    echo do_shortcode("[av_submenu which_menu='center' menu='' 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]");
    

    Best regards,
    Ismael

    #735245

    Thanks Ismael. I’m not that experienced with php, where should I place the code exactly in the archive.php file? Wherever I place it at the moment it is showing an error (even before i’ve added the shortcode for the submenu)? Thanks for your help. Thomas

    #736918

    Hey!

    Instead of editing the archive.php file, please add this hook in the functions.php file.

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	if(is_archive()) {
    		echo do_shortcode("[av_submenu which_menu='center' menu='' 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]");
    	}

    Cheers!
    Ismael

    #736954

    Thanks Ismael,
    i tried adding that to my child theme’s function.php file and it’s showing as having a syntax error on the last line? Any ideas?
    Thanks again!
    Thomas

    #736968

    Hi!

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	if(is_archive()) {
    		echo do_shortcode("[av_submenu which_menu='center' menu='' 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]");
    	}
    }

    Try it like that, let us know if it works.

    Regards,
    Basilis

    #736972

    Great. Thank you so much. That worked perfectly!

    It’s showing on the other category pages but is there a way to also have a submenu at the top of the individual article’s page. I also noticed that the individual articles’ permalinks don’t have the section name in front of the article title, so in my case “journal”. Is there a way to implement these?

    Thanks again.
    Thomas

    #736987

    Hi!

    That goes a lot far away from the support we can offer.
    Please do consider if you still need that to hire someone who will help you get it further.

    Thanks a lot for your understanding and patience

    Best regards,
    Basilis

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