Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #947139

    i’m still experimenting with some filters – and i wonder that i can not influence the layout from boxed to stretched for a single page.

    first i tried:

    add_filter('avf_skin_options','custom_skin_option');
    function custom_skin_option($styles){
        if( is_page(26) ){
            $styles['color-body_style'] = "stretched";
        }
        return $styles; 
    }

    but that does not do the trick – then i thought maybe it is color scheme spezific so i tried:

    add_filter('avf_skin_options','custom_skin_option');
    function custom_skin_option($styles){
        if( is_page(26) ){
            $styles["Flower Green"] = array( "color-body_style"	=> "stretched" );
        }
        return $styles; 
    }

    but even this does not overwrite the settings on Flower Green preselection on Enfold Options for that page.
    is there a way to change from boxed to stretched for specific pages?

    #948819

    Hey Guenter,

    Thank you for using Enfold.

    I didn’t even know that filter exists :D. Please try this one.

    add_filter('avia_pre_prepare_colors', 'avia_pre_prepare_colors_mod', 10, 1);
    function avia_pre_prepare_colors_mod($options) {
            if( is_page(26) ){
    	    $options['color-body_style'] = 'stretched';
            }
    	return $options;
    }

    Best regards,
    Ismael

    #949243

    thanks Ismael – i will give it a try.
    PS that filter was not in the list i have from https://kriesi.at/documentation/enfold/hooks-and-filters/
    Maybe a global search in enfold folder for “apply_filters” should be necessary. ;)

    #949571

    does not work this way.

    #949574

    I am attempting to do the same thing, but rather than set the body as stretched, just change the primary color of the page. Below is my code in enfold-functions.php. It does not seem to be changing anything.

    /* Load custom color scheme for each template file */
    add_filter('avia_pre_prepare_colors', 'avia_pre_prepare_colors_mod', 10, 1);
    function avia_pre_prepare_colors_mod($options) {
    	if ( is_page_template( 'bendfirepipesanddrums.php' ) ) {
    		$options['colorset-main_color-bg'] = '#821b22';
    	}
    	return $options;
    }
    #950578

    Hi,

    One of these should work but I’m not sure if you can use it to change the option of a specific page because the option is loaded even before the page is queried.

    
    // adjust $avia
    function ava_update_options() { 
    	global $avia;
    	$avia->options['avia']['color-body_style'] = 'boxed';
    	return $avia;
      }
    add_action('after_setup_theme', 'ava_update_options');
    
    // avia_filter_global_options
    function avia_filter_global_options_mod($options) {
    	$options['avia']['color-body_style'] = 'boxed';
    	return $options;
    }
    add_filter('avia_filter_global_options', 'avia_filter_global_options_mod', 10, 1);

    Best regards,
    Ismael

    #951094

    No – please erase that answer- it messes all up in that test page.
    All settings are gone ( except the functions.php entries) but quick css and logo and and.

    PS : no worry it is a test-page so not so important.

    #951100

    All ok now – i got on dynamic_avia two merged css files : after beautfying i can extract the quick css again.

    by the way : if we do not mark that option on performance: “Delete old CSS and JS files?” there are “backups” of the old settings?
    how many will there be saved? that was my salvation now – but it should be limited to a certain number, so that the folder does not inflate

    #951446

    Hi,

    Glad it’s all fine now. I have to check with the development team and get back to you on the CSS and JS files.

    Best regards,
    Vinay

    #951452

    this is not so important – it is just i’m playing with the filters – and it is also for the pages, which I create here as a demonstration for other comrades. Sometimes then one has a boxed layout and then I do not always want to change the setting globally on my testpage to demonstrate something.
    No hurry on that

    #951522

    Hey!

    Ok, I got a reply. The theme will create a maximum of 50 files (which should never amount to more than 25mb of web space) – the equivalent of a few uploaded images :)

    As always it is interesting to see what you come up with.

    Let us know if you have more questions.

    Cheers!
    Vinay

    #1284386

    Hi,
    So has there been any successful function to change the color scheme and layout (boxed/stretched) on a per page basis?
    Thanks, WZ

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Change Color body Style on one page’ is closed to new replies.