New Landing How can we help? Themeforest Theme Support Dante Create a shortcode and let it be persistent after theme update

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Dante
  • #242715
    lucasbracher
    Member
    Post count: 8

    Hi there!

    I created a shortcode based on Recent Posts shortcode and I would like to be able to use this shortcode when upgrading the theme, i.e., I would like this shortcode don’t be deleted when updating the theme.

    How can I write it properly on child theme?

    Thanks in advance!

    #242731
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Just write your shortcode in functions.php file to revernt from update.
    Thanks
    Mohammad

    #242985
    lucasbracher
    Member
    Post count: 8

    Hi, Mohammad! Thanks for your quick answer!

    I just need another help: how can I reference the file style.css inside dante-child? Apparently this file is not being loaded by browser.

    Thank you!

    #243005
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    You can use this in your child theme functions.php file:

    	/* LOAD PARENT THEME STYLES
    	================================================== */
    	function dante_child_enqueue_styles() {
    	    wp_enqueue_style( 'dante-parent-style', get_template_directory_uri() . '/style.css' );
    	
    	}
    	add_action( 'wp_enqueue_scripts', 'dante_child_enqueue_styles' );

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register