-
AuthorPosts
-
September 18, 2013 at 4:52 pm #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/5jXrluPlease let me know what could be wrong and what I must do to correct it.
Thanks in advance!September 18, 2013 at 4:59 pm #163036Hi DavyE,
Can you once again make sure that you choose to display socket and footer widgets? http://i.imgur.com/HIjJcm9.jpg
Regards,
YigitSeptember 18, 2013 at 5:18 pm #163044I 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.
September 18, 2013 at 5:26 pm #163050I’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, 3 months ago by DavyE.
September 19, 2013 at 5:29 am #163375Hi!
Please check this line of code:
the_title( '</div><h3>', '</h3><p>' );
Is this correct? Why is there a closing div?
Best regards,
IsmaelSeptember 19, 2013 at 11:08 am #163502Because 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, 3 months ago by DavyE.
September 20, 2013 at 7:44 am #163935Hello!
Can you please post the whole single-portfolio.php code? You can use pastebin.com.
Regards,
IsmaelSeptember 20, 2013 at 9:24 am #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(); ?>
September 20, 2013 at 6:51 pm #164159Hello!
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,
JosueSeptember 23, 2013 at 5:38 pm #165232Thank 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?
September 23, 2013 at 7:18 pm #165261Hey!
You can find it in your PHP Log.
Cheers!
Josue -
AuthorPosts
- The topic ‘Unknown error on page. How to find out?’ is closed to new replies.