While coding a Wordpress site, I wanted to add a back button for posts and pages.
Hierarchical pages should obviously point back to their parents, but what of non hierarchical pages?
If a user navigated from the "Gallery" page to the "About" page - I would like the sites "back" button to return him to the "Gallery" page. This could be easily implemented using JavaScript but why use user-side scripting when you can generate the code on the server side?
The obvious solution would be to use the referring URL as a target for our "back" button. We must now avoid two special cases:
Hierarchical pages should obviously point back to their parents, but what of non hierarchical pages?
If a user navigated from the "Gallery" page to the "About" page - I would like the sites "back" button to return him to the "Gallery" page. This could be easily implemented using JavaScript but why use user-side scripting when you can generate the code on the server side?
The obvious solution would be to use the referring URL as a target for our "back" button. We must now avoid two special cases:
- The page is a sub-page and the back button should point to its parent.
- The previous URL was an off-site URL, and the back button should not appear at all.
$ref_url = wp_get_referer(); $ref_parse = parse_url($ref_url); $my_parse = parse_url(get_permalink()); if (($ref_url==get_permalink() || empty($ref_url)) && $post->post_parent) { $show_back_to_parent=true; $ref_url = get_permalink($post->post_parent); } if ($ref_parse[host]==$my_parse[host] || $show_back_to_parent) { echo $ref_url; }
Hi, this is exactly what I need but how would this be implemented? I'm a complete novice.
ReplyDeleteHello,
ReplyDeleteGreat idea!!!
I have one question. How to display button for off-site URL?
Premium templates Wordpress for every taste here https://wordpresstemplates.ch/
ReplyDeleteOnce installed and running you'll have a WAMP icon down in the system tray in the bottom right-hand corner of your screen (it looks like a semi-circle)click the WAMP icon down in the system tray and select phpMyAdmin - if the phpMyAdmin page displays then this tells us that the webserver is running and the php script can connect to our MySQL database so you're up and running.https://edkentmedia.com/website-design-toronto
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteDrivers for it, you can download here: https://huaweidrivers.com/
ReplyDeleteI like survey objectives which comprehend the cost of passing on the astounding solid resource purposeless out of pocket. I really worshiped inspecting your posting. Thankful to you! seo services calgary
ReplyDeleteGreat client service is moving above and over and above of responsibility. Moving above and beyond only helping someone. That modest extra mile. It is going far above what your usual job duties are. Whatever they're looking to receive as service as towards service or their product, you exceed to allow it to happen to get your own client. And it's really more than simply providing the support, it's genuinely believing in your product or your ceremony and helping the customer in order that they see that the value from that too. You can find Details on This Issue on This Sitehttps://servicecenterguru.com
ReplyDeleteOften, this isn't necessary, but it also means that any plugins and themes (templates) created for the platform are also open source! Imagine a world-wide community working together to add more features and functionality to WordPress - you're not limited to only being able to use specific employees or developers to produce customizations, which means it's a powerful CMS system ready to do what you need it to, it's flexible, and easy to customize.https://medijo.lt/etiketes/
ReplyDeleteThis is such a great resource that you are providing and you give it away for free. hosting companies in south africa
ReplyDeleteNext you will need to get hosting for your website. I would recommend something from Godaddy or 1and1 because they have good customer service and give you a free domain or free hosting with the purchase of one or the other. managed wordpress services
ReplyDeletevery interesting keep posting. GreenGeeks review
ReplyDeleteWordPress likewise allows you to get an expert plan to make your site look extraordinary - frequently for nothing out of pocket. neuronto deepl wordpress plugin
ReplyDeleteIts an incredible joy perusing your post.Its brimming with data I am searching for and I want to post a remark that "The substance of your post is magnificent" Great work. ranking
ReplyDeleteNice collection. keep posting such things. Very useful information. Thank you. we also provide best service for Greengeeks Review in USA with money back guarantee. if you want more information then you can visit on our website.
ReplyDeletexn-pick casino【WG】best online casino,trulette
ReplyDelete【n-pick casino】,【WG98.vip】⚡,best online casino,trulette,trulette,free poker online,trulette,mister bonus no deposit,vip 메리트 카지노 주소 slot machine
Hello Everyone !
ReplyDeleteOffering fresh & Valid Tools with Tutorials & Fullz/Pros/Leads.
All stuff will be genuine, Guaranteed & verified.
Cheap prices & Fastest Delivery
For more details :
WA - +92-317-2721122
TG/ICQ - @killhacks
Email - exploit(dot)tools4u at Gmail(dot)com
Wickr/Skype - @peeterhacks
Contact us for any query 24/7
Huge stuff we are offering
SSN+DOB+DL Fullz with Complete Info
High-Credit-Scores-Pros/Fullz
Dumps-With-Pins Track-101&202
C.C Fullz with C.V.V & SSN Info
Business E I N Fullz
Office365 Logs/Leads
Hac-king Tools, Tutorials, Ebooks & Easy Video Tuts
Complete package of SPA-MMING with all necessary gadgets
Loan & Car-ding Methods/Tutorials/Cash out/Transfers
2021/2022 Fr**d B**le updated
Cracker&Flasher For BTC
RDP's-SMTP's-C-panels-Shells
Web-mailers-Brutes-Crackers
SQLi-Injector/Server-Penetration
Kali-Linux-Master-Class Full Package
Premium-Logs (Amazon, E-bay, Coinbase, Netflix)
Logs/I.P's/Proxies/Server I.P's
Just-contact-us-for-your-desired-stuff
We will try our best to provide you Legit & Genuine Stuff
TG/ICQ - @killhacks
Wickr/Skype - @peeterhacks
WA - +92-317-2721122
Email - exploit(dot)tools4u at Gmail(dot)com