Hi there,
I’m one of the lead developers for X. I’m sorry you’re having trouble here. First, I need to start by saying I don’t appreciate your accusation against our team for not being familiar with the product. I’ve reviewed this case, and aside from an unfortunate typo that we later corrected, everything we’ve communicated thus far as been accurate. What you’re asking for here is assistance with custom development. Custom development is not covered by the scope of support we can offer, but we do try to help as much as we can in these situations.
I do thank you for being a loyal customer, and we do appreciate how you’ve continued to use X to support your clients. Your main concern here seems to be that there is a problem with our theme in regards to what you’re trying to accomplish.
Guys, there has to be a solution. We cannot be the only client on the face of the planet that has used the x theme and needs to insert custom javascript into a page.
The distinction here is that you’re not adding custom javascript. You can always add custom javascript (the code itself) under “JS” on each page edited with Cornerstone, or in Theme Options. What you’re actually trying to do is add custom markup that loads it’s own javascript.
We offer the classic raw content element, and and of the “Content Area” elements where custom code can be placed. How it behaves on the front end is entirely dependent on what the code is meant to do. It’s also entirely theme agnostic. It works the same with all themes, but could potentially conflict with theme features depending on what you want to implement.
If this is something you need to do on a regular basis I would recommend that you learn a bit more about how WordPress hooks and filters work: https://codex.wordpress.org/Plugin_API
Specifically, the best case would be using the wp_head
and wp_footer
hooks, or a custom shortcode For example, here’s some code that would go in functions.php
of a child theme:
function my_custom_head_code() {
// Whatever you run here happens inside the <head> tag. It's where you can load additional stylesheets.
}
add_action('wp_head', 'my_custom_head_code');
function my_custom_footer_code() {
// Whatever you run here happens after the page is finished outputting, but before the closing </body> tag. It's an ideal place to add custom scripts.
}
add_action('wp_footer', 'my_custom_footer_code');
function my_custom_shortcode( $atts, $content = '' ) {
// Whatever you put here will output anywhere you add a [my_custom_shortcode] to your content. This is ideal if you want to ensure code only runs on specific pages in specific contexts.
}
add_shortcode('my_custom_shortcode', 'my_custom_shortcode');
Here are some more links to the Codex explaining in depth what’s going on there.
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer
https://codex.wordpress.org/Function_Reference/add_shortcode
It always works this way with WordPress regardless of what theme you’re using. Some themes (like X) offer places to add custom javascript, but that means it has to be pure javascript. You can’t put HTML in place for custom javascript. When your customization is more involved like this, it’s best to use the WordPress plugin APIs to get where you need to be.