Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Portfolio page faulty display

  1. #1
    Join Date
    Jul 2013
    Posts
    34
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Portfolio page faulty display

    Hello,

    I'm continuing testing and trouble shooting a new update of a WordPress theme. The old version of the theme is here (sample page):
    http://terrybraunstein.com/portfolio/
    and it displays the Portfolio page in a proper GRID design as it should be.

    and the new version is here:
    http://sg.terrybraunstein.com/portfolio/
    and this displays the Portfolio page as if it would be a Blog

    I checked carefully the proper settings and selected its correct Template (Portfolio)

    Portfolio Page grid shows only when you open one of the posts, e.g. this one:
    http://sg.terrybraunstein.com/portfolio/who-is-she-2013-2014/ and close it clicking on the X in the upper right. Clicking again on Portfolio in the Menu shows the Blog design again.


    I installed a WordPress plug in, Query Monitor, and there is a PHP error showing up when opening this page :
    http://sg.terrybraunstein.com/portfolio/who-is-she-2013-2014/
    but I don't know anything about PHP so that error message does not say anything to me. Here is the screen-shot of the error message:

    Click image for larger version. 

Name:	php error sg.terry1.jpg 
Views:	218 
Size:	47.2 KB 
ID:	5916

    What could be the reason that the Portfolio page is not displaying properly in the new version?
    Last edited by jscheuer1; 07-28-2016 at 03:04 AM. Reason: format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    PHP errors can be difficult to deal with, yet they often are quite literal. Too much so sometimes.

    It means what it says. The PHP interpreter found an undefined variable by the name of url. Because of this, it assumed it was a string - 'url'. Not a big help. But that pretty much assures that url at that point is expected to be passed or that it was meant to be a string. Since I'm not seeing the code, it could be a string that as a property of some object or array is meant to signify something. That's usually what that sort of error means. But it could be meant to be a literal string (unlikely).

    Give this some time to sink in. Then give me any further thoughts.

    Also, if I could see the PHP code that's producing this error, I might be able to contribute more.

    It's also possible that this is just a non-fatal error in the PHP code and that the actual problem lies elsewhere.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2013
    Posts
    34
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    I'm attaching a zip file with all the php files mentioned in the error message:
    Notice Use of undefined constant url - assumed 'url' 1 wp-content/themes/yin_and_yang/includes/portfolio.php:67 load_template('~/wp-content/themes/yin_and_yang/includes/portfolio.php')
    wp-includes/template.php:531
    locate_template()
    wp-includes/general-template.php:167
    get_template_part('includes/portfolio')
    wp-content/themes/yin_and_yang/single-portfolio.php:326 Core


    PHP files.zip

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Got them. It's late here. And as I think I indicated, not sure I will be able to solve this from that - just that it will give me a better chance. I'll have a look tomorrow, or over the weekend.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    You say you have recently upgraded the Yin & Yang theme but have you also upgraded the version of Wordpress it's running on? If you've only updated the theme, maybe that's the problem? You might need to upgrade the core Wordpress files too. Same for any other plugins you're using. It might be worth disabling all addons and then gradually add back and test between each additions to see if you can narrow down any conflicts.

    Another thought: the Yin & Yang theme is a premium Wordpress download so if your help period from the developer has expired since your time of purchase, it might be a good idea to extend the support package you have with them as their existing customer. Changes and modifications by the original developer (who will be more of an expert in Wordpress than we are) can be built in to the core and should be compatible with future updates (both in Wordpress core files and in the theme) but small ad-hoc updates and fixes by outside coders in the here-and-now will be more general and may need further adaptations as your core changes in the future. Just something to bear in mind.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. The Following User Says Thank You to Beverleyh For This Useful Post:

    mr108 (07-28-2016)

  7. #6
    Join Date
    Jul 2013
    Posts
    34
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    You say you have recently upgraded the Yin & Yang theme but have you also upgraded the version of Wordpress it's running on?
    Yes, I did.

    Same for any other plugins you're using.
    All updated as well.

    It might be worth disabling all addons and then gradually add back and test between each additions to see if you can narrow down any conflicts.
    I did that as a part of trouble shooting, even when all plugins are disabled the portfolio pae does not display properly.

    Another thought: the Yin & Yang theme is a premium Wordpress download so if your help period from the developer has expired since your time of purchase, it might be a good idea to extend the support package you have with them as their existing customer.
    I may suggest this to my friend (the owner of the site and the theme) whom I'm helping now if I don't succeed...


    Changes and modifications by the original developer (who will be more of an expert in Wordpress than we are) can be built in to the core and should be compatible with future updates (both in Wordpress core files and in the theme)
    The old theme is 5 years old, so big changes were needed to be made to make the theme up to date with the latest standards, which means that some things had to be rebuilt from ground up, so a simple update of the theme does not work.
    Last edited by mr108; 07-28-2016 at 11:25 AM.

  8. #7
    Join Date
    Jul 2013
    Posts
    34
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Somehow this line in the portfolio.php file maybe giving some clue?

    In the error message it says:
    Notice Use of undefined constant url - assumed 'url' 1 wp-content/themes/yin_and_yang/includes/portfolio.php:67

    and the line 67 is:
    <img class="preview-img" src="<?php echo esc_url($image[url]); ?>" alt="<?php the_title_attribute(); ?>" />

  9. #8
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    Quote Originally Posted by mr108 View Post
    .
    .
    and the line 67 is:
    <img class="preview-img" src="<?php echo esc_url($image[url]); ?>" alt="<?php the_title_attribute(); ?>" />
    In PHP all variables begin with the '$' sign so "url" in that line isn't seen as a variable by PHP. I suspect it should be:

    Code:
    <img class="preview-img" src="<?php echo esc_url($image[$url]); ?>" alt="<?php the_title_attribute(); ?>" />

  10. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Actually, in PHP, the square bracket notation is most likely to contain a quote delimited string representing a key in an array. That's most likely the case here, although it's slightly possible the $ was intended*. Also, when error reporting is off and PHP is in one of its less strict modes, a string is assumed and there's no problem. In more strict environments, it can be a fatal error, either in PHP itself, or because the resulting string includes the error message, which breaks the intended output.

    Anyways, we can fix that, but there could also be other problems, in fact three, of the four files in the zip, three have this same loose syntax. Once I have them all located and fixed, I'll send you the repaired set of files. Keep the zip you already sent me as a backup just in case.



    * more often found in loops, like a foreach loop. I don't see any obvious loop in the sections of code involved here. Also, if that is the case, usually it's a more generic term, like $key. Further, I think the original error message stated it assumed 'url', not $url, though of course that isn't necessarily definitive. That said, one almost has to assume this code worked in its development environment. That would almost assure its missing quotes, not missing a $, as no level of PHP will automatically supply a missing $, though loose PHP settings will allow for missing quotes with no error.
    Last edited by jscheuer1; 07-28-2016 at 09:22 PM. Reason: add * info
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  11. #10
    Join Date
    Jul 2013
    Posts
    34
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by styxlawyer View Post
    In PHP all variables begin with the '$' sign so "url" in that line isn't seen as a variable by PHP. I suspect it should be:

    Code:
    <img class="preview-img" src="<?php echo esc_url($image[$url]); ?>" alt="<?php the_title_attribute(); ?>" />
    I tried this but it does not work, no change. Thanks anyway.

Similar Threads

  1. code for links on buttons and text on one page linking to selection on portfolio page
    By mr108 in forum Looking for such a script or service
    Replies: 2
    Last Post: 08-08-2013, 09:40 AM
  2. Replies: 0
    Last Post: 07-12-2011, 05:03 PM
  3. Header frame on my portfolio page
    By AndyWhyteUK in forum Looking for such a script or service
    Replies: 2
    Last Post: 01-31-2011, 09:35 AM
  4. Replies: 10
    Last Post: 11-19-2009, 02:56 PM
  5. Need help with a Faulty Table
    By Wizzap in forum HTML
    Replies: 3
    Last Post: 03-21-2008, 02:54 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •