为投资组合中的每个项目分配唯一的标识(PHP?)
我的网站有一个具体问题,该网站是使用 HTML、CSS、Masonry 和一点 PHP 构建的。
在我的主页上,您可以看到我正在使用JQuery Masonry来展示我的作品。每次我添加一个项目时,布局都会像预期的那样重新排序。很难预测某些项目将落在网格中的哪个位置(因为不同项目的高度各不相同)。
单击图像后,您将进入项目页面,顶部有项目导航(上一个项目/下一个项目)。这里没有花哨的 PHP 或 CMS。每当我上传新项目时,我都会手动更新上一个和下一个项目链接。这通常意味着更新每个项目页面(18 页)上的链接。我这样做是因为当砌体在主页上重新排列项目网格时(添加新项目后),上一个和下一个项目链接将过时且不正确。例如,上传新项目后,当我单击“下一个项目”时,它会将我带到错误的项目,因为主页上的网格与以前不同。
我从第一行开始从左到右对图像进行排序。
我想要一个 PHP 包含用于项目导航,但我不太了解 PHP。该代码将实现类似“单击下一个项目链接后转到 x 项目”的功能
I have a specific problem regarding my website that I built with HTML, CSS, Masonry, and a little bit of PHP.
On my homepage, You can see that I am using JQuery Masonry to display my work. Every time I add a project, the layout is reordered quite a bit, as expected. It is very hard to predict where certain projects will land in the grid (since the height varies from project to project).
After you click an image, you are taken to the project page, with a project navigation at the top (Previous Project / Next Project). There is no fancy PHP or CMS going on here. I manually update the prev and next project links whenever I upload a new project. This usually means updating links on every project page (18 pages). I do this because when masonry rearranges the project grid on the homepage (after adding a new project), the prev and next project links will be out of date and will not be correct. For example, after uploading a new project, when I click "next project" it will take me to the incorrect project because the grid on the homepage is different than it was before.
I order the images from left to right, starting on the first row.
I would like to have a PHP include for the project navigation, but I do not know PHP very well. The code would achieve something like, "after clicking on the next project link go to x project"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,这是我能找到的最基本的 PHP 分页教程。它甚至不使用数据库,只是一个数组:
PHP 中的数组分页
尽管我怀疑如果您花一天时间学习 PHP 脚本的基础知识,您会对自己有很大帮助。这是非常简单的第一语言:
PHP - 一个简单的教程
Ok here is the most basic PHP pagination tutorial I could find. It doesn't even use a database, just an array:
Array Pagination in PHP
Although I suspect you would be helping yourself a great deal if you sat down for a day and learnt the basics of PHP scripting. It's quite a simple first language:
PHP - A simple tutorial