[Resolved] Infinite Scroll + tables + headerimage rotate

Home Forums Support [Resolved] Infinite Scroll + tables + headerimage rotate

Home Forums Support Infinite Scroll + tables + headerimage rotate

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #156100
    thxandbye

    Hey,
    As always awesome work you’ve done so far, I just have three things I would like to know about:

    First: Is there a way, that you could add native support for the infinite scroll addon from the Jetpack Add-On?
    I got it to work, adding code the the functions.php, but maybe this is a thing that could be supported natively or does it causes problems in some cases? (i din’t experienced any problems so far)

    	add_theme_support( 'infinite-scroll', array(
    		'type'           => 'scroll',
    		'footer'		 => false,
    		'footer_widgets' => false,
    		'container'      => 'main',
    		'wrapper'        => true,
    		'render'         => false,
    		'posts_per_page' => false,
    	) );

    Second: After one update all my tables got a bit weird (adding borders and padding all over the place), it started with an update that is a bit in the past and I fixed it with some custom CSS, but maybe that is a thing, that i can disable within the options?
    The code i added for fixing the tables:

    table, th, td {
    	border: 0;
    }
    
    table {
    	border-collapse: separate;
    	border-spacing: 0;
    	border-width: 0;
    	margin: 0;
    	width: 100%;
    }
    
    th,
    td {
    	padding: 0;
    }
    
    th {
    	border-width: 0 0 0x;
    }
    
    td {
    	border-width: 0;
    }
    

    Third and most minor: Is there any build in option to auto rotate the image in the header? Like every hour or to load a random header each page visit?

    Keep up the good work and keep being awesome!

    … also is it possible to qualify as a showcase website even if it’s heavily modified with CSS?

    best regards,
    Tjark

    My website if you need / want to take a look: http://shin-sekai.de/

    #156207
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Does that block of code for infinite scroll work as is? No other modifications needed? If so, I think it can make its way into core.

    One of our updates did include a little more styling to tables, as tables should only be used for data, and those subtle lines etc.. really help organize it. The CSS you’ve added is perfect to remove those features though.

    There is a pretty easy way to add a random header that changes on each page load: https://generatepress.com/forums/topic/random-rotate-header-logo-per-page-view/

    Your site looks great! All GP sites are welcome to be showcased ๐Ÿ™‚

    #156252
    thxandbye

    Hey, thanks for the answers.

    I used the guideline from jetpack, to add the support myself.
    You can find it right on their site: https://jetpack.me/support/infinite-scroll/
    You might check, if i got everything right.
    And you might also make some options changeable to the user in the config menu. Especially for the footer, since I have created my own via GP hooks, I disabled the onboard footer and the footer option for infinite scroll. But for most people a “true” for the footer would be more useful, so they have access to their footer.(I hope that explanation is somewhat possible to understand)

    Would be awesome if you could look into that. Jetpack is even a pretty wide spread Add-On with over 1 million installations.

    If that’s no problem, I would like to have my site showcased.

    best regards,
    Tjark

    EDIT:
    Got the random header to work (even tough i only have one image added at the moment)
    I modified your code to change the image via css, since the other thing don’t want to work for me.

    <?php
    	$headers = array(
    		'/wp-content/uploads/2015/11/header_angel_beats.jpg',
    	);
    
    	$randombg = $headers[ rand( 0, count( $headers ) -1 ) ];
    ?>
    <style type="text/css">
    	.site-header {
    	background-image: url(<?php echo $randombg ?>);
    	}
    </style>
    #156314
    Tom
    Lead Developer
    Lead Developer

    Awesome, I’ll look into infinite scroll ๐Ÿ™‚

    You can post your site into the showcase thread here: https://generatepress.com/forums/topic/want-your-site-showcased/

    Glad you got the random code working as well!

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