How to keep close a sub-menu under homepage? [closed]

To do that, you have to set hidden attribute to the sub menu. CSS #wrapper .fusion-vertical-menu-widget.left .menu .sub-menu { display: none; } to toggle display on the menu on hover over servizi, you can add jQuery hover to the menu item. jQuery var subMenu = jQuery(“#wrapper .fusion-vertical-menu-widget.left .menu .sub-menu”); jQuery(“#menu-item-12049”).hover(function(){ subMenu.show(); }, function(){ subMenu.hide(); }); … Read more

Echo piece of code from file

You can do this by putting your piece of code in a function and call it where required just like any template tag. <?php function the_logo(){ ?> <div id=”logo”> <?php if( get_theme_mod( ‘mlwd_logo_image’) ) : ?> <img src=”https://wordpress.stackexchange.com/questions/337491/<?php echo esc_url(get_theme_mod(“mlwd_logo_image’)); ?>” alt=”Logo”/> <?php else: ?> <h1> <a href=”<?php echo home_url(); ?>” title=”<?php bloginfo(‘name’); ?>”> <?php … Read more

how to show logged in members username in wordpress content

It looks like $current_user->user_firstname contains some tag content. I would replace that line with: <h5>Hi <?php echo esc_html($current_user->user_firstname); ?></h5> or <h5>Hi <?php echo strip_tags($current_user->user_firstname); ?></h5> One of those (or either) may solve your problem outright.

How to create more templates to the same theme?

Create .php file with name like template-blogs.php, inside file write a Template Name in php comment, include header & footer. here is the sample of test template <?php /* * Template Name: Test Template */ get_header(); ?> <div class=”content_area”> <!—Write Your PHP Code Here—> </div> <?php get_footer();

admin_post hook not working

You’re missing a ‘ in your code and your function name is different. function my_maybe_add_redirect( $entry, $form ) { wp_redirect( ‘https://www.google.com/’, 301 ); exit(); } add_action( ‘admin_post_submit_images’, ‘my_maybe_add_redirect’, 10, 2 );

Anchor link to every product

You can use the woocommerce_loop_product_link filter to modify the archive product urls. // Add to (child) theme functions.php function my_prefix_modify_woocommerce_loop_product_link( $url, $product ) { /** * Adds the id of the product wrap element from single product view * as an anchor parameter to the WooC archive loop product url * e.g. http://www.mystore.com/my-product#single-produt-wrap-id * update … Read more