Mark Hendriksen
Mark Hendriksen

Reputation: 1

php code appears on my Wordpress Dashboard

I'm using the php code below for my Wordpress website:

<?php

function cta_fixed() {
     echo do_shortcode('[et_pb_section global_module="2893"][/et_pb_section]');
}

    add_action( 'wp_footer', 'cta_fixed' );

    do_action( 'wp_footer' );

?>

It works as I wanted in the front end. But I also see

[et_pb_section global_module="2893"][/et_pb_section]

In my dashboard. How can I prevent this?

Regards,

Mark

Upvotes: 0

Views: 49

Answers (1)

Tanya Rix
Tanya Rix

Reputation: 89

You should only have add_action()

  function cta_fixed() {
 echo do_shortcode('[et_pb_section global_module="2893"][/et_pb_section]');
   }

add_action( 'wp_footer', 'cta_fixed' );

Upvotes: 1

Related Questions