Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #341371
    robertlewis00980
    Participant

    Hi CatchThemes Support & Community,

     

    I’m using one of your themes (great work, by the way) and recently built a small web calculator tool (for something like UAE end-of-service benefits). I want to embed it into my WordPress site so that users can calculate without leaving the site.

     

    My challenge: whenever I update the theme, custom code I add sometimes gets overwritten or causes conflict.

     

    Some of my thoughts and questions:

     

    Is it better to package this calculator as a small plugin, rather than inserting directly into theme files?

     

    What hooks or enqueue methods recommended in CatchThemes are safe for custom scripts/styles?

     

    How can I isolate custom templates or blocks so that theme updates don’t corrupt them?

     

    Should I use shortcode or a custom block for embedding the UI? Which is safer long-term?

     

     

    If anyone has experience embedding utility tools inside CatchThemes — especially keeping them update-proof — I’d love to see how you structured it. Thanks in advance!

    #341373
    sujapati
    Keymaster

    @robertlewis: Thanks so much for the kind words. The issue you’re describing is quite common; conflicts often arise due to updates in the theme or WordPress core. Below, I’ve answered your questions in the same order.

    1. Packaging calculator as a small plugin : Yes, packaging calculator as small plugin is definitely a more optimal apporach than inserting directly into the theme.  By doing this, the custom tool will be completely independent of the theme and will be more flexible and portable

    2. Hooks or enqueue methods for custom scripts/styles:  We follow wordpress best practices for enqueuing scripts and styles. For adding custom scripts and styles safely, we use  add_action( ‘wp_enqueue_scripts’, ‘my_theme_scripts’ ); function.

    3. Isolating custom templates or blocks: You can create a child theme where you can override the parent themes templates, and the changes you make will be preserved across theme updates.

    4. Using shortcode or a custom block for embedding the UI: Both options are viable. While shortcodes are easy and faster,  using custom blocks is safer long-term as they are part of the modern WordPress ecosystem and blocks are more reusable and flexible.

    Regards,
    Sujapati

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