Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #163031

    I have two testsites running. 2 pages are basically completely identical, but one has a script error somewhere. Notice the footers, visible (correct) on one and invisible (wrong) on the other.

    Good link: http://goo.gl/YuqNYk
    Bad link: http://goo.gl/5jXrlu

    Please let me know what could be wrong and what I must do to correct it.
    Thanks in advance!

    #163036

    Hi DavyE,

    Can you once again make sure that you choose to display socket and footer widgets? http://i.imgur.com/HIjJcm9.jpg

    Regards,
    Yigit

    #163044

    I have once again made sure the socket and footer widgets are set to display. In the page itself it’s set to “Enfold Default” and in the Enfold theme settings it’s set to “Display the footer widgets & socket”. So I’m very sure it’s supposed to show.

    Look closely and you’ll notice the web address below the name (right of the logo) is visible on the good link and invisible on the bad link. So I assume the error is located around there, maybe.

    I’ve performed an online test of the page to see if there are errors and I’ve seen some PHP errors, if I understood correctly. I just can’t figure out where the error is located. I think it’s the closing of a php tag or something.

    #163050

    I’ve basically added this to that single-portfolio.php file:

    <?php 
    				// DYNAMIC CONTENT
                  echo "<div style='float:left; border:1px solid #E1E1E1; margin-right:5%; margin-bottom:20px;'>";
    			  	if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                  the_post_thumbnail( );
                  } 
    			  
    				the_title( '</div><h3>', '</h3><p>' ); 
    			   
    				echo strip_tags (
    				get_the_term_list( get_the_ID(), 'customers_entries' )
    				);
    				$customers_website = simple_fields_get_post_value(get_the_id(), array(3, 1), true);
    				echo "</p><p><a href='$customers_website' target='_blank'>$customers_website</a></p>";
    				?>

    This is supposed to make sure that the logo (featured image), the title and a custom field of that specific page are automatically shown on the page in a specific way. If I delete that piece of code, the page is back to normal (empty content though).

    What I’m trying to achieve is to have a few elements of the portfolio page to be shown, then see all of the page content (which doesn’t seem to load now) and then the footer etc.

    The strange thing is, the “Good link” has the exact same piece of code and there’s no error there.

    • This reply was modified 11 years, 2 months ago by DavyE.
    #163375

    Hi!

    Please check this line of code:

    the_title( '</div><h3>', '</h3><p>' );

    Is this correct? Why is there a closing div?

    Best regards,
    Ismael

    #163502

    Because of the previous part:

    echo "<div style='float:left; border:1px solid #E1E1E1; margin-right:5%; margin-bottom:20px;'>";
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail( );
    } 

    the_post_thumbnail is put in between a div. Atm the div has inline styling, but that’s just temporary. PHP is definitely not my specialty. That piece of code is only 10 rules or so and there is already some error. I’ve just checked the log and even on the “good link” there is an error. Guess I’ll have to find a better way to achieve this.

    I can look on the internet, BUT my new question depends on the theme, so I’ll ask that here. Maybe better in a new topic?

    • This reply was modified 11 years, 2 months ago by DavyE.
    #163935

    Hello!

    Can you please post the whole single-portfolio.php code? You can use pastebin.com.

    Regards,
    Ismael

    #163965
    <?php
    global $avia_config;
    	/*
    	 * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    	 */
    	 get_header();
     	 if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
    	 ?>
    		<div class='container_wrap main_color <?php avia_layout_class( 'main' ); ?>'>
    			<div class='container'>
    				<div class='template-page template-portfolio content  <?php avia_layout_class( 'content' ); ?> units'>
            
                  <?php 
    				// DYNAMIC CONTENT
                  echo "<div style='float:left; border:1px solid #E1E1E1; margin-right:5%; margin-bottom:20px;'>";
    			  	if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                  the_post_thumbnail( );
                  } 
    				the_title( '</div><h3>', '</h3><p>' ); 
    				echo strip_tags (
    				get_the_term_list( get_the_ID(), 'customers_entries' )
    				);
    				$customers_website = simple_fields_get_post_value(get_the_id(), array(3, 1), true);
    				echo "</p><p><a href='$customers_website' target='_blank'>$customers_website</a></p>";
    				?>
                     
    				<?php
    				/* Run the loop to output the posts.
    				* If you want to overload this in a child theme then include a file
    				* called loop-page.php and that will be used instead.
    				*/
    
    				$avia_config['size'] = avia_layout_class( 'main' , false) == 'entry_without_sidebar' ? '' : 'entry_with_sidebar';
    				get_template_part( 'includes/loop', 'portfolio-single' );
    				?>
    
    				<!--end content-->
    				</div>
    
    				<?php
    				//get the sidebar
    				$avia_config['currently_viewing'] = 'page';
    				get_sidebar();
    				?>
                    
    			</div><!--end container-->
    		</div><!-- close default .container_wrap element -->
    <?php get_footer(); ?>
    #164159

    Hello!

    Here’s the error:

    PHP Fatal error:  Call to undefined function simple_fields_get_post_value() in /.../wp-content/themes/enfold/single.php on line 23
    

    Regards,
    Josue

    #165232

    Thank you so much Josue! Found the culprit and fixed it.

    Mind letting me know what you used to find it so I may do this myself if it ever happens again?

    #165261

    Hey!

    You can find it in your PHP Log.

    Cheers!
    Josue

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Unknown error on page. How to find out?’ is closed to new replies.