• Hey,

    I want to make a checkbox in my admin panel that will add a custom piece of html code to my page in the <head> section. I can add stuff to the page to check if it’s set.

    But can anyone tell me how to do this ?

    Thank you for your time and attention, Xeross

Viewing 2 replies - 1 through 2 (of 2 total)
  • You could make a quick plugin. This’ll make it whatever’s being echoed in echoIntoHead appear in the <head> section of everyone of your admin pages. It’s not exactly what you want, but it’s a start, and you should look into it yourself. ??

    <?php
    /*
    Plugin Name: Insert bit into head
    Plugin URI: https://linktoyourblog.maybe
    Description: Plugin to add stuff to the Head in administration
    Version: 1.0
    Author: You
    Author URI: https://You/
    */
    
    function echoIntoHead () {
      echo "<meta>This'll be echoed into your administration head tag.</meta>\n";
      return;
    }
    
    add_action ('admin_head', 'echoIntoHead');
    
    ?>

    Change the bits at the top of the file, and what’s being echoed. Copy it into a new file, and save it in your plugins directory. It’ll show up in your plugin’s page for you to activate.

    That’s ugly but took about twenty seconds to knock up. If you wanna make it better, or if you want to learn what it all means, you should check out the writing a plugin article. You’ll need to know PHP first though.

    Thread Starter Xeross

    (@x3r0ss)

    I’m an expert in php close to being considered a professional.
    I’m going to take a look into creating plug-ins as it seems i need custom ones more and more.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Admin Panel]Add checkbox that adds html to page’ is closed to new replies.