Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Al142

    (@al142)

    Thanks

    Thread Starter Al142

    (@al142)

    Great. Thank very much for your reply.

    Is it okay to change it this way? Another word, if I move code out of the elseif() section, will it accidentally cause problems to other section?

    Here is the code excerpt from functions.php

    function bavotasan_add_js() {
    	$bavotasan_theme_options = bavotasan_theme_options();
    	$var = array();
    
    	if ( is_singular() ) {
    		if ( get_option( 'thread_comments' ) )
    			wp_enqueue_script( 'comment-reply' );
    	} elseif (  !is_page()  ) {
    		//$var['loader'] = BAVOTASAN_THEME_URL . '/library/images/ajax-loader.gif';
    		//$var['more_text'] = '<em>' . __( 'No more posts.', 'carton' ) . '</em>';
    
    		//wp_enqueue_script( 'masonry', BAVOTASAN_THEME_URL .'/library/js/masonry.js', '', '3.1.1', true );
    	} 
    
    	// move code here
    	$var['loader'] = BAVOTASAN_THEME_URL . '/library/images/ajax-loader.gif';
    	$var['more_text'] = '<em>' . __( 'No more posts.', 'carton' ) . '</em>';
    	wp_enqueue_script( 'masonry', BAVOTASAN_THEME_URL .'/library/js/masonry.js', '', '3.1.1', true );
    	//end move code

    Thanks again for your help.

    Sincerely,

    -Al

    Thread Starter Al142

    (@al142)

    Lester – Thanks again for fast response.

    Just to clarify: if I remove is_page(), from the following line

    if ( !wp_is_post_revision( $post ) && ( is_single() || is_page() ) ) {

    Is it correct to assume that the view value will be counted only when user open single.php?

    Thank you very much for your time.

    Sincerely,

    -Al

    Thread Starter Al142

    (@al142)

    Thanks Lester for a quick reply.

    Do you mean the view value only get count when visitor view single post page (can filter by if is_single() )

    or it get count when visitor view any pages? i.e. home page, archive page etc. (can filter by if is_page())

    If I would like to have the view count only when visitors see Single post page, where should I change in plugin code?

    Thanks again for your time and consideration.

    -Al

    Thread Starter Al142

    (@al142)

    Thanks

    Hi Swennet,

    May I also have code you mentioned above? Thanks very much.

    -Al

Viewing 6 replies - 1 through 6 (of 6 total)