[Support request] option_generate_blog_settings filter not working for single post

Home Forums Support [Support request] option_generate_blog_settings filter not working for single post

Home Forums Support option_generate_blog_settings filter not working for single post

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1913519
    boaz

    Hi, im trying to hide the meta author/date/categories in post belonging to certain categories,
    Any reason why this code shouldnt work (its not working for me)

    add_filter( 'option_generate_blog_settings', 'custom_page_settings' );
    function custom_page_settings( $options ) {
     if ( in_category( array(1031,1032,1020,1016,1033,1017,1015,1046,1041,1043,1034,1018,1035,1040,1044,1036,1037,1045,1022,1038,1014,1051,1,1050,1042,1054,1039,1053,1021,1048,1052,1049,1047))){
    
    		$options['author'] = false;
    		$options['date'] = false;
    		$options['categories'] = false;
    			
    	}	
      
        return $options;
    }

    thanks

    #1913554
    Elvin
    Staff
    Customer Support

    Hi there,

    I believe the variable/s for single post pages has to be the FF:

    $options['single_date'], $options['single_author'] and $options['single_categories'].

    See more here – https://docs.generatepress.com/article/option_generate_blog_settings/#options-%E2%80%98single_date%E2%80%99

    #1913639
    boaz

    Well done ! that worked for me

    #1914778
    Elvin
    Staff
    Customer Support

    Glad worked for you. No problem. 😀

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.