badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

gonzalo.cao

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Problems making slider title and excerpt optional #12397
    gonzalo.cao
    Participant

    Don’t ask me why but now it works! You can show a sample at http://www.despensasolidaria.org

    (Maybe I had some kind of cache issue)

    These are the changes I’ve made

    Files edited
    library/admin/theme-options.php
    library/structure/header-extensions.php

    library/admin/theme-options.php

    Inmediately after this (line 594 aprox)
    <a href="<?php bloginfo ( 'url' );?>/wp-admin/post.php?post=<?php if( array_key_exists ( 'featured_post_slider', $options ) && array_key_exists ( $i, $options[ 'featured_post_slider' ] ) ) echo absint( $options[ 'featured_post_slider' ][ $i ] ); ?>&action=edit" class="button" title="<?php esc_attr_e('Click Here To Edit'); ?>" target="_blank"><?php _e( 'Click Here To Edit', 'attitude' ); ?></a>

    add this

        <!-- patch begins -->
        <input type="checkbox" name="attitude_theme_options[featured_post_slider_title][<?php echo absint( $i ); ?>]" value="1" <?php if( array_key_exists( 'featured_post_slider_title', $options ) && array_key_exists( $i, $options[ 'featured_post_slider_title' ] ) ) checked( '1', $options['featured_post_slider_title'][$i] ); ?>/> <?php _e( 'Display post title', 'attitude' ); ?>
        <!-- patch ends -->
    

    Also substitute this (line 793 aprox)

        if ( isset( $input[ 'featured_post_slider' ] ) ) {
    		$input_validated[ 'featured_post_slider' ] = array();
    	}   
        
    	if( isset( $input[ 'slider_quantity' ] ) )   
    	for ( $i = 1; $i <= $input [ 'slider_quantity' ]; $i++ ) {
    		if ( intval( $input[ 'featured_post_slider' ][ $i ] ) ) {
    			$input_validated[ 'featured_post_slider' ][ $i ] = absint($input[ 'featured_post_slider' ][ $i ] );
    		}
    	}
    

    With this

    	if ( isset( $input[ 'featured_post_slider' ] ) ) {
    		$input_validated[ 'featured_post_slider' ] = array();
    	}   
        /** patch begin **/
    	if ( isset( $input[ 'featured_post_slider_title' ] ) ) {
    		$input_validated[ 'featured_post_slider_title' ] = array();
    	}   
        /** patch end **/
    
    	if( isset( $input[ 'slider_quantity' ] ) )   
    	for ( $i = 1; $i <= $input [ 'slider_quantity' ]; $i++ ) {
    		if ( intval( $input[ 'featured_post_slider' ][ $i ] ) ) {
    			$input_validated[ 'featured_post_slider' ][ $i ] = absint($input[ 'featured_post_slider' ][ $i ] );
    		}
            /** patch begin **/
    		if ( intval( $input[ 'featured_post_slider_title' ][ $i ] ) ) {
    			$input_validated[ 'featured_post_slider_title' ][ $i ] = absint($input[ 'featured_post_slider_title' ][ $i ] );
    		}
            /** patch end **/
    	}

    library/structure/header-extensions.php

    Substitute this line (450 aprox)
    if( $title_attribute != '' || $excerpt !='' ) {

    With this one
    if( ($options[ 'featured_post_slider_title' ][$i]==1) && ($title_attribute != '' || $excerpt !='' )) {

    I’d like to insert it into a child theme like other mods I’ve done but I’m not sure how to do it.

Viewing 1 post (of 1 total)