The MU forums have moved to WordPress.org

Add custom HTML to the Control panel (9 posts)

  1. grantmx
    Member
    Posted 15 years ago #

    I want to add some extra HTML to the control panel for all users to navigate back to the main site, but when I added the code I needed in admin-header.php it broke the the CSS file and my control panel was naked. But the code was there fine. Just looked crazy.

    Can this even be done and why would the CSS file break? And all of the CSS files were linked properly.

    Also note, I also added a few styles to wp-admin.css

  2. tdjcbe
    Member
    Posted 15 years ago #

    Telling us specifically what you did would be helpful else all we can do is make guesses. Please upload any html to pastebin or into a txt file and provide a link.

  3. grantmx
    Member
    Posted 15 years ago #

    Sure. I was more so looking for an answer to whether one could add extraneous HTML to the control panel and what is the best approach, but nonetheless, here is the code I added.

    <div id="topBar">
    <span style="float: left; margin-left: 10px; margin-top: 15px;"><a href="http://you129.com/" style="color: rgb(209, 202, 177);">‹ Back to you129.com</a></span>
    <ul>
        	<li><a href="http://you129.com/myaccount/">My Account</a></li>
            <li><a href="http://video.you129.com/my_video.php" >My Videos</a></li>
            <li><a href="#">My Blog</a></li>
            <li><a href="http://you129.com/wiki/">Help Wiki</a></li>
    </ul>
    </div>

    Added this right above <div id="wphead"> where I need it to be. I changed nothing else, save a few styles to the above mentioned CSS document.

    No link right now as to my site is live and it'll break the cp of all my users.

  4. dsader
    Member
    Posted 15 years ago #

    What style for the id="topBar"? Float it, too.

    If it were me I'd add the menu and its style via the "admin_head" and or the "admin_footer" hooks. Using "admin_header_navigation" is an option too if you don't need the default links to wordpress.

    Example
    http://www.bigalex.it/plugins/adminbar/

  5. grantmx
    Member
    Posted 15 years ago #

    Yeah, I put it in the admin-header, but when I uploaded everything the stylesheet broke for the users control panel. Didn't make any sense. The CSS linking was correct. Did I miss something?

  6. dsader
    Member
    Posted 15 years ago #

    Float the divs, use the hooks.

  7. chaty1
    Member
    Posted 15 years ago #

    Index.php is not a page it is a map that puts the page togeather. you need to create a file and have index.php direct to it

  8. chaty1
    Member
    Posted 15 years ago #

    The best way is create a create a html theme or you can try a hack and put your index.php into a wordpress single file and call the single file index.php this might allow you to replace files with files you created in wordpress.

  9. chaty1
    Member
    Posted 15 years ago #

    oops forgot to mention wordpress has plug ins to change control panel.

About this Topic