• Resolved Nancy Rector

    (@nanrector)


    Is there a way I can set some of my defaults behind the scenes so I don’t have to do it every time. Things I would love to set the default of are LIMIT, FIELD SETTINGS, HTML TAG, PAGINATION

    Not sure if any of those can be preset or not in the code. I can do it if I’m pointed in the right direction.

    Thanks!
    Nancy
    http://www.ourpeacefulplanet.com

    • This topic was modified 8 years, 11 months ago by Nancy Rector.
    • This topic was modified 8 years, 11 months ago by Nancy Rector.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Content Views

    (@pt-guy)

    Dear Ms. Nancy Rector,
    You can set default value for any settings of View, but it will require coding skills.

    Please add this code to file functions.php of your active theme:

    
    // Content Views - Global settings for Views
    add_filter( 'pt_cv_view_settings', 'cvp_theme_view_settings', 100, 1 );
    function cvp_theme_view_settings( $args ) {
    	$prefix = 'pt-cv-';
    
    	$args[$prefix . 'limit'] = '20';
    	
    	return $args;
    }
    

    To set values for other settings, please var_dump the $args value, you will see the relevant keys.

    Best regards,

    Thread Starter Nancy Rector

    (@nanrector)

    Thank you so very much! I’m not a coder but I dabble and get do this. Very much appreciated. Ü
    Nancy

    Thread Starter Nancy Rector

    (@nanrector)

    I’m not as smart as I thought… can’t figure this out as a non coder. Could you show me what to put in the code you gave me if I want to set the default for

    1. HTML Tag
    2. Under Pagination: Items Per page

    Thank you so much!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Setting defaults’ is closed to new replies.