Support » Theme: Vantage » Auto change logo and background image every month

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi ngrudev

    Thanks for reaching out.

    Anything is possible with custom development. Unfortunately, I don’t know off-hand of a function that could be used for the two tasks you’ve described. I did a quick search for a plugin but couldn’t find one to recommend. Sorry.

    Thread Starter ngrudev

    (@ngrudev)

    I also checked for a plugin, but cant find what i need. It seem to be good idea for development 🙂

    For the site logo, if you use the Customizer > Site Identity logo then a plugin would work, assuming one existed. For the background it would be trickier, only the boxed layout uses the core WordPress background image, the full-width background image is a theme setting so that would require custom development. Thanks for your feedback, I’ll make a note of it. If we receive further requests we can investigate these features in the future. Sorry, we can’t help at the moment. A service like codeable.io is an option if you wanted to pursue the custom development route. Thanks for your understanding.

    Thread Starter ngrudev

    (@ngrudev)

    Thanks for your attention and having in mind the idea. I appreciate it!

    I will be happy to see this functionality in future.

    Thank you!

    Thread Starter ngrudev

    (@ngrudev)

    I think I made it. It worked perfectly. Now I will make a cron sheduler to run the function every day to save resourses.

    //auto change logo and masterhead background image depending on month
    add_action('init', 'update_logo');
    function update_logo() {
    	$month = date("n");
    	$my_fields = get_option('theme_mods_vantage-child');
    	if ($month == 12 || $month == 1 || $month == 2) { 
    		$logo = 7078; //christmas logo post ID
    		$retina_logo = 7077; //christmas retina logo post ID
    		$background = 'https://images2.luga.bg/2016/12/back_1080_christmas.jpg'; //christmas masterhead background image url address
    	}
    	else { 
    		$logo = 6979; //standard logo post ID
    		$retina_logo = 6981; //standard retina logo post ID
    		$background = 'https://images2.luga.bg/2016/12/back_1080.jpg'; //standard masterhead background image url address
    	}
    	$my_fields['theme_settings_logo_image'] = $logo;
    	$my_fields['theme_settings_logo_image_retina'] = $retina_logo;
    	$my_fields['vantage_page_masthead_background_image'] = $background;
    	update_option('theme_mods_vantage-child', $my_fields);
    }

    Awesome! Really glad to hear you were able to write something for the job. Thanks for sharing 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Auto change logo and background image every month’ is closed to new replies.