HTML Code

This topic contains 3 replies, has 2 voices, and was last updated by  ab-themes 8 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14813

    Pdiddy2aop
    Participant

    Hello,

    I would like to know how I can embed html code into a text box so that the code shows up on my website? Right now the text just shows up as a bunch of code;

    For example you can check this site, http://drnickelberry.com/index.php/one-on-one-coaching/

    in the middle of the page, under the title: Why we are the best you can see the code I inserted.

    How do I embed code on this website template?

    #14837

    ab-themes
    Keymaster

    You cannot embed code with the page builder. Page builder strips HTML (security measures so that someone wouldn’t exploit it and insert malicious code).

    This looks like some kind of custom subscription code.

    The best solution would be to create a custom shortcode for this, and then just place the shortcode in that place.

    You can see how we did the text element (.php file), in the elements folder, and using that as a template create a new element called Custom subscription (custom_subscription.php), and place your code there. Then just call that element on your page, and it should render fine.

    Hope this helps.

    #14883

    Pdiddy2aop
    Participant

    ok I am not that advanced to know how to do that. My hope is that you could give me a little more detailed steps on how to do this. I really need the ability to put embed code into this site.

    I am not sure how to create a custom shortcode, or where inside my template to begin this process. It is possible to get a screenflow or something that gives a visual on how to do this?

    #14898

    ab-themes
    Keymaster

    In the elements folder create custom_subscription.php and in that php file (using notepad++ or sublime text) add this

    
    <?php
    
    /*********** Shortcode: Custom subscription ************************************************************/
    
    $tcvpb_elements['custom_subscription'] = array(
    	'name' => esc_html__('Custom subscription', 'ABdev_vozx' ),
    	'description' => esc_html__('A custom subscription code.', 'ABdev_vozx' ),
    	'type' => 'block',
    	'icon' => 'pi-text',
    	'category' => esc_html__('Content', 'ABdev_vozx' ),
    	'attributes' => array(''),
    );
    function tcvpb_custom_subscription_shortcode( $attributes, $content = null ) {
    	extract(shortcode_atts(tcvpb_extract_attributes('custom_subscription'), $attributes));
    
    	return '<!-- BEGIN: Benchmark Email Signup Form Code -->
    	<sup><!– BEGIN: Benchmark Email Signup Form Code –><br><script type="text/javascript" id="lbscript662554" src="https://www.benchmarkemail.com/code/lbformnew.js?mFcQnoBFKMRb3WQ6eu7tgeZXUawFafLCg1OyPLEJbElSFnnfVOE3TQ%253D%253D"></script><noscript>Please enable JavaScript <br />Powered by <a href="http://www.benchmarkemail.com" target=_new style="text-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:10px;color:#999999;">Benchmark Email</a></noscript><br><!– END: Benchmark Email Signup Form Code –></sup><br><noscript>Please enable JavaScript <br>Powered by <a href="http://www.benchmarkemail.com" target=_new style="text-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:10px;color:#999999;">Benchmark Email</a></noscript><sub><!-- BEGIN: Benchmark Email Signup Form Code --><br><noscript>Please enable JavaScript <br>Powered by <a href="http://www.benchmarkemail.com" target=_new style="text-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:10px;color:#999999;">Benchmark Email</a></noscript><br><!-- END: Benchmark Email Signup Form Code --></sub><br>
    	<!-- END: Benchmark Email Signup Form Code -->';
    }
    

    This should give you a new shortcode called Custom subscription in the creator, that you can add, and this code should be added, and should be working. Just be careful not to have any odd quotes inside (curly quotes or stuff like that. Al the quotes must be either single ' or double ").

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

The topic ‘HTML Code’ is closed to new replies.