INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

LImit results on a home page

LImit results on a home page

(OP)
Hi,
I am a basic user of HTML and CSS and i have made myself a website about movie reviews. When i open the home page all the movies that are in the database are being shown on the home page. My question is how can i limit the number of movies on the home page?

RE: LImit results on a home page

Make the database queries return less results would be one way.

But given this is the HTML & CSS section, you could set the ones you don't want to see to display: none;


So; ... if you want a better answer YOU need to provide far more information BUT I am going to go out on a limb and suggest that;

You open your WordPress dashboard, go to Settings -> Reading and change the number of posts per page.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: LImit results on a home page

(OP)
Thanks for that, but i am mainly looking to just see like the most recent 4 updates. So for example i upload lets say 5 movies and i just want to see on the home page the last 4 i uploaded. I know the way you suggested but that is a bit different. If you want more information just tell me what you need and i will provide it.

RE: LImit results on a home page

Quote:

If you want more information just tell me what you need and i will provide it.

Server side scripting source, generated HTML source, or URL would be a start.

RE: LImit results on a home page

(OP)
http://www.rescore.io/ So this is the URL and it is taking quit some time to open because it has to generate all these movies and the graphs for their reviews and i was wondering is it possible to just make it so i only see the 4 most recently added to the database movies or maybe the most searched ones but i want to limit the results to at most 4 on the welcome page. If you can help me i would greatly appreciate it. Thank you.

RE: LImit results on a home page

This page does not look complicated so the trouble is in the back end. Does your SQL have "LIMIT 10" in it?

You may want to head to the section of Tek-Tips that relates to your backend scripting language and database.

RE: LImit results on a home page

The SERVER side code is what we need OR

You go ask in whatever forum category your website server just happens to run on. this section is for HTML and that cannot get information from a database.

If it is a content management system (Wordpress, Joomla, Drupal, etc.) with a 'theme' ask whomever designed the theme how it is done.

For us, looking at the HTML that appears in a browser tells us very little (meaning nothing) about the back-end system that powers your site and how it can be modified.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: LImit results on a home page

(OP)
Basically i am using github and what i am asking is just how the algorithm would look. That is my problem. I will give you a scenario - i upload 5 movies and i want to see on the front page the last 4 movies that i have uploaded and every time i upload a new movie i want that movie to take the place of the movie that i have uploaded first (basically i upload movies 1 2 3 4 5 and after i upload them i just want to see movies 2 3 4 5 on the homepage and when i upload movie 6 i want to see movies 3 4 5 6). How does that look like in CSS/HTML. That is my question. It doesn't have to be exactly right i just need to see it so i can understand it and think of my own solution.

RE: LImit results on a home page

There is no algorithm presented in your HTML. This is an HTML forum.

If your algorithm is managed in JS, go to the JS forum here.

If your algorithm is managed in PHP, go to the PHP forum here.

...

Your generic mention of github makes me wonder if you know what is driving the data in your app. Can you point us to the github project you are using?

RE: LImit results on a home page

As spamjim suggested, the "algorithm" could be as simple as limiting the amount of results returned from the database query. i.e "LIMIT 4"

However, simply limiting the results will not give you pagination and the ability to view more than the first 4 results.

Without the back-end code to your site, we simply cannot suggest anything at all.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close