• Resolved 4thfront

    (@4thfront)


    Thanks for the great theme you made! If I create pages with it plus Elementor and add a short HTML copy/paste that Gumroad provides to embed their payment-processing on to my pages … do I need a child theme first to preserve my site’s design and content … for whenever your theme or WordPress or my plug-ins need to be updated?

    Sorry if this is a dumb question. I am new to WordPress and have no code or design experience. Just a vision for a website for a startup business.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author David Vongries

    (@davidvongries)

    Hi @4thfront,

    sorry for the delay here.

    Thank you for your kind words! ??

    Yes, you’d add the code snippet to your website using a hook from your child-theme’s functions.php file. Depending on where your code needs to go (probably either in the footer or head area of your website) you would do something like this.

    function your_prefix_function() { ?>
        your gumroad snippet
    <?php } 
    add_action( 'wp_head', 'your_prefix_function' );

    If the code needs to go in the footer, simply replace wp_head with wp_footer in the snippet above.

    You’re absolutely right, just pasting the code snippet into the main theme, a theme update will override your changes. That’s where a child theme comes in handy.

    You can grab the child-theme here and even create your own, branded child theme – https://wp-pagebuilderframework.com/child-theme-generator/

    Please let me know if you have any further questions.

    Best,
    David

    Thread Starter 4thfront

    (@4thfront)

    @davidvongries

    Thanks so much for your answer and code help, David. Just to clarify, if I don’t add the Gumroad shortcode through WP’s direct editor into the theme file … but instead use a site builder’s code widget, do I still need the child-theme first?

    I fear that I may be misunderstanding this whole issue because Site Origin says that code additions done through their Page-Builder plug-in are saved outside of the theme directory or the theme files … so a child theme is not needed.

    But if I pair the Elementor site-builder plug-in with your theme/framework … then use Elementor’s Shortcode Widget or its HTML Widget to add Gumroad’s shortcode to one or more pages, does that code addition get saved into your theme’s files or somewhere else?

    Thanks again.

    Theme Author David Vongries

    (@davidvongries)

    Hi @4thfront,

    if you’ve added the code through a plugin like Elementor or SiteOrigin, you don’t need a child theme.

    There’s actually an option available in our Premium Add-On that allows adding code snippets to the head section and footer area of the website. That wouldn’t require a child theme either as the data is being stored in the database instead of being added to the theme. Same goes for the Elementor/Site Origin method or any other plugin method ??

    Best,
    David

    Thread Starter 4thfront

    (@4thfront)

    Perfect, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘when do you not need a child-theme?’ is closed to new replies.