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*

Showing excerpt in Recent Work widget

Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #9768
    Daniel
    Participant

    I want to show the excerpt in Recent Work widget (as a similar way that Services widget).
    Could you help me with CSS or code to put in a Child Theme?

    Web site

    Thank for your excelent support

    Regards, Daniel

    #9800

    hi DD

    You need code customization for it but while doing this updating to the new version you customization code will be lost.
    Its better to add the content as you like on the feature recent widgets and give a link to a specific page to display the full content.
    Regards
    Sunil

    #9802
    Daniel
    Participant

    Thanks Sunil, Could you explain little more your recommendation of “add the content as you like on the feature recent widgets”?

    The final work may be look as follows:

    Example

    If you want to help me with some code don’t worry about new version because I have a Child Theme.

    Thanks a lot.

    #9827
    Daniel
    Participant

    Dear Sunil, I hope you can help me, it is very important for me to achieve this with Attitude Theme.

    Thanks !

    #9887

    Hi DD
    you can change the code from attitude->library->widgets->attitude_widget.php

    On line no 319 there is a function

    function widget( $args, $instance ) {
     		extract( $args );
     		extract( $instance );
    
     		global $post;
     		$title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : '';
     		$text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance );
     		$page_array = array();
     		for( $i=0; $i<6; $i++ ) {
     			$var = 'page_id'.$i;
     			$page_id = isset( $instance[ $var ] ) ? $instance[ $var ] : '';
     			
     			if( !empty( $page_id ) )
     				array_push( $page_array, $page_id );// Push the page id in the array
     		}
    		$get_featured_pages = new WP_Query( array(
    			'posts_per_page' 			=> -1,
    			'post_type'					=>  array( 'page' ),
    			'post__in'		 			=> $page_array,
    			'orderby' 		 			=> 'post__in'
    		) );
    		echo $before_widget;
    			if ( !empty( $title ) ) { echo $before_title . esc_html( $title ) . $after_title; } ?>
    			<p><?php echo esc_textarea( $text ); ?></p>
    			<div class="column clearfix">
    				<?php 
    	 			while( $get_featured_pages->have_posts() ):$get_featured_pages->the_post();
    					$page_title = get_the_title();
    					?>	
    					<div class="one-fourth">
    						<?php 
    						if ( has_post_thumbnail( ) ) {
    							echo '<a title="'.get_the_title().'"href="'.get_permalink().'">'.get_the_post_thumbnail( $post->ID,'gallery').'</a>';				
    						}
    						?>
    						<h3 class="custom-gallery-title"><a href="<?php the_permalink(); ?>" title=""><?php echo $page_title; ?></a></h3>
    					</div><!-- .one-fourth -->			
    				<?php endwhile;
    		 		// Reset Post Data
    	 			wp_reset_query(); 
    	 			?>
    			</div><!-- .column -->
    		<?php echo $after_widget;
     		}
     	}

    You need to edit here and custom code in your own way.

    Regards
    Sunil

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