Forums

Add custom profile header (3 posts)

  1. denzel2364
    Member
    Posted 2 years ago #

    Hi Guys,

    I have this code from WordPress which allows the upload of a header in the backend of wordpress. However, if one user uploads it updates everyones headers.

    How can i make it different for every profile?

    //make changeable header
    
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '/setta.jpg'); // %s is theme dir uri
    define('HEADER_IMAGE_WIDTH', 780);
    define('HEADER_IMAGE_HEIGHT', 373);
    define( 'NO_HEADER_TEXT', true );
    
    function default_admin_header_style() {
    ?>
    <style type="text/css">
    #headimg {
    
    }
    
    #headimg h1, #headimg #desc {
    	display: none;
    }
    
    </style>
    <?php
    }
    
    function header_style() {
    ?>
    <style type="text/css">
    #header{
    	background: url(<?php header_image() ?>) no-repeat;
    	height: 349px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    	margin: auto;
    	margin-top: 40px;
    
    }
    
    #headimg {
    	height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    	width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    }
    </style>
    <?php
    }
    
    add_custom_image_header('header_style', 'default_admin_header_style');
  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You can't. It updates the header for the entire site.

  3. denzel2364
    Member
    Posted 2 years ago #

    ah... i was hoping for a different answer but hey :-)

    Thank you esmi

Topic Closed

This topic has been closed to new replies.

About this Topic