WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
Add Filter to blog-info in footer for infinite scrolling (3 posts)

  1. LimeCanvas
    Member
    Posted 1 year ago #

    There's already a filter for the credits in the footer() function in jetpack/modules/infinite-scroll/infinity.php

    Could you add a filter for the blog-info too so that we can control the popup footer completely?

    Something like this?

    function footer() {
    		// Bail if theme requested footer not show
    		if ( false == self::get_settings()->footer )
    			return;
    
    		// Bail if there are not enough posts for infinity.
    		if ( ! self::set_last_post_time() )
    			return;
    
    		// We only need the new footer for the 'scroll' type
    		if ( 'scroll' != self::get_settings()->type || ! self::archive_supports_infinity() )
    			return;
    
    		$credits = '<a href="http://wordpress.org/" rel="generator">Proudly powered by WordPress</a> ';
    		$credits .= sprintf( __( 'Theme: %1$s.', 'jetpack' ), function_exists( 'wp_get_theme' ) ? wp_get_theme()->Name : get_current_theme() );
    		$credits = apply_filters( 'infinite_scroll_credit', $credits );
    
    		$home_link = sprintf( __( '<a id="infinity-blog-title" href="%1$s" title="%2$s" rel="home">%2$s</a>', 'jetpack' ), get_home_url(), get_bloginfo( 'name' ) );
    		$home_link = apply_filters( 'infinite_scroll_home_link', $home_link );
    		?>
    		<div id="infinite-footer">
    			<div class="container">
    				<div class="blog-info">
    					<?php echo $home_link; ?>
    				</div>
    				<div class="blog-credits">
    					<?php echo $credits; ?>
    				</div>
    			</div>
    		</div><!-- #infinite-footer -->
    		<?php
    	}

    Thanks,
    Wil.

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    Thanks for the suggestion. We'll consider making this change in a future Jetpack update.

    In the meantime, you'll have to use CSS to customize that part of the footer, as I suggested here.

  3. Laszlo Espadas
    Member
    Posted 11 months ago #

    add_filter( 'infinite_scroll_credit', 'your_footer_text' );
    
    function your_footer_text() {
    return '<a href="http://link_to_site">Credit Link</a>';
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.