• Hello,

    Hope you are well. You theme is really good.

    I hope it’s okay to ask for a suggestion from you.

    I created a page of a list of posts.

    And the style=”position: relative; height: 604.017px; visibility: visible;”> is missing from

    <div id=”boxes” class=”js-masonry” data-masonry-options=”{ “columnWidth”: 320, “itemSelector”: “.masonry” }

    Where should I change in order to add style=”position: relative; height: ….”> back?

    The code is same with index.php but when I put it as a page, for example page-products.php, it did not arrange to meet full width of screen.

    Thanks very much for your time and consideration.

    -AL

Viewing 2 replies - 1 through 2 (of 2 total)
  • That CSS is added by the Masonry script. That script doesn’t load on pages, since it is only needed on the home page and category pages. You would have to change where that script is enqueued in functions.php to make it work.

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘style in the id="boxes" missing’ is closed to new replies.