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

  • SEARCH
  • Home
  • 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 7587525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:41:44+00:00 2026-05-30T19:41:44+00:00

I am generating a news section with php and I want to make continue

  • 0

I am generating a news section with php and I want to make continue reading like blog posts. When a user clicks continue reading i will make all the news article slide down.
Here is the code I have:

<?php foreach ($news as $newsItem) : ?>
    <div class="news-item" id="news-<?php echo $newsItem->id; ?>">
        <a href="#" class="image"><img src="/path/to/my/image" 
            alt="<?php echo $newsItem->photo; ?>" /></a>
        <h4><a><?php echo $newsItem->title; ?></a></h4>
        <p><?php echo $newsItem->content; ?></p>
        <a class="read-more" href="<?php echo ROOT_PATH; ?>front/site/news">Read more</a>
    </div>
<?php endforeach; ?>

$('body').on('click', 'a.read-more', function(){
    // what should happen here?
})
  • 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-05-30T19:41:46+00:00Added an answer on May 30, 2026 at 7:41 pm

    First, your jQuery snippet should look like:

    $(function() { // Only when DOM is ready
      $('a.read-more').on('click', function() {
        // Your code
      }
    });
    

    Then, you need to decide whether you use lazy-loading of content or not. Two solutions :

    1. You simply load the whole article and hide the read-more section on page load.
    2. You use AJAX to load content from your database (using your news id)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While generating XML files with SimpleXml, I got challengefull problem. I want to make
Im generating a file to present to the user for download, but the server
I'm generating a self-signed SSL certificate to protect my server's admin section, and I
For generating random string i written code like this But if the function is
After generating a type dynamically and calling TypeBuilder.CreateType, I want to create a delegate
When generating my DAL files with SubSonic, I'd like the names of the files
hi i am using pfeed for generating news feed in my project. how can
Im generating various strings and then I want to save files with generated strings
Im generating a plain txt file from Physics editor. It contains all the vertices
am generating pdf using Zend_pdf its saving after creating I want to open it

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.