• Resolved jeff.frankens

    (@jefffrankens)


    Hello everyone! I’m going to try to make this as easy as possible by taking screenshots.

    I am using dessign.net’s wonderful Swiss Design Theme.

    I plan on changing some things to the CSS but I should be able to do that myself… My problem is I have a slight problem making a change to single.php file. I do not have any experience with PHP so apologies in advance…

    This is what the front page looks like:

    Front Page

    Great!

    When I click one of the links to the portfolio which is a post under a certain category it looks like this:

    Post

    Not so great. I’m wanting to remove the “small feature” images from the left so I can make the right container the full main area. The CSS I can handle, however…

    When I took out this code (which is the right one because when I take Featured Small out the space is still there but it doesn’t grab the posts) from the single.php file.

    <?php
           global $post;
           $myposts = get_posts('numberposts=5&category_name=Featured Small');
           foreach($myposts as $post) :
             setup_postdata($post);
           ?>

    I get this page and error webpage:

    Parse error: syntax error, unexpected T_ENDFOREACH in /home/jeffreyf/public_html/wp-content/themes/SwissDessign/single.php on line 63

    Here

    Any suggestions?

    Website is Jeffreyfrankens.com if anyone needs to look at it.

    Thanks a lot everyone!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jeff.frankens

    (@jefffrankens)

    Is it possible some php section isn’t being closed once thats taken out somehow?

    this line in your removed code section:

    foreach($myposts as $post) :

    is the start of a code section which ends with:

    endforeach;

    that is what the error message refers to, as this line is now without its starting line.

    you need to identify and remove all code down to and including the first endforeach; after your removed section.

    Thread Starter jeff.frankens

    (@jefffrankens)

    It worked! Thanks a lot.

    Learn something new every day.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Making slight change to single.php (post) file’ is closed to new replies.