Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8361477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:42:40+00:00 2026-06-09T11:42:40+00:00

My issue is that I’m constantly getting parse errors when running this code, and

  • 0

My issue is that I’m constantly getting parse errors when running this code, and no matter how much I’ve looked into it I’m lost!

The idea behind this code is to create an auto updating jQuery gallery that pulls the information from the posts to add the images, captions, links and titles. I’ve got the code pulling the latest 5 articles from the category :blog.

Here’s my code:

<?php
$posts = query_posts('category_name=blog&showposts=5');
while (have_posts()) : the_post();
if ($posts) {
    foreach ($posts as $post):
      setup_postdata($post); ?>
      <li><img src= "<?php echo $full_img[0]; ?>" alt="<?php the_title (); ?>" title="<?php the_title (); ?>" data-description="<?php the_content (); ?>"/></li>
<?php endforeach;
  }
?>

This is sthe syntax for the gallery:

<li>
<img src="../gv/path/to/image.jpg" alt="image" title="Pretty Picture" data-escription="Some more information about the photo" />
</li>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:42:41+00:00Added an answer on June 9, 2026 at 11:42 am

    Some things to consider

    • You have two loops ( while, foreach ) while this shouldn’t be necessary. More on query_posts
    • data-description="<?php the_content (); ?> This part is prone to errors. Note that the_content returns HTML code and you will end up with something like this date-description="<p><b>Description</b></p>"
    • Some variables are not initialised such as $full_img
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running into another issue that I just seem cant to find any information what
I have an issue that seems like very flaky behavour, is this a problem
I am having an issue that coming from PHP 5.3.2 to 5.3.3 the code
This is an issue that recently came up for me while writing a new
I am having an issue that I have spend way too much time trying
I'm having an issue that's killing me. Here's my code: $('.somediv.btn-2').live('click', function() { if
I have a bizzare issue that I haven't been able to resolve no matter
I have this weird issue that jquery.load sometimes fails on chrome. I'm not gonna
I have an issue that's been bugging me this morning. I'm building an ASP.NET
I ran into an issue that can only be explained with my fundamental lack

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.