Here are two simpler options:Option 1: Use JavaScript for Redirection in a Code Snippet
If you’re able to add JavaScript, here’s a simple approach that won’t add anything to the visible content:
- Go to the page’s settings in your CMS and look for an option to add a “Custom Code” or “JavaScript” section in the header (many themes or page builders have this).
- Add this code:
<script> setTimeout(function(){ window.location.href = "https://ridgetopcollection.com/kmg-kiosk-start-screen/"; }, 200000); // Redirect after 200 seconds </script>
This code redirects the page after 200 seconds without displaying any extra space on the page.
Hi Subrata, that looks very straightforward but in WordPress using Astra theme I see NO option to add Custom Code or Javascript to a particular page. The only thing I can do is toggling between the Visual Editor and the Code Editor. I used the latter to add the html code that now creates the extra lines. What is your second idea? It has to be possible to add the code to just specific pages, not the whole site! So adding it to the header in Astra will not work. I apologise, I am not a programmer:(
Found a simple solution: I suppressed the vertical scrollbar with this code before the page layout HTML on each page that has the redirection code after the page code:
<span class=”tagcolor”><span lang=”NL” style=”font-size:11.5pt;
line-height:107%;font-family:Consolas;color:mediumblue”><!DOCTYPE<span lang=”NL” style=”font-size:11.5pt;line-height:107%;
font-family:Consolas;color:red”> html></span></span>
<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;color:mediumblue”><<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;
color:brown”>html<span lang=”NL” style=”font-size:11.5pt;line-height:107%;
font-family:Consolas;color:mediumblue”>></span></span></span>
<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;color:mediumblue”><<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;
color:brown”>head<span lang=”NL” style=”font-size:11.5pt;line-height:107%;
font-family:Consolas;color:mediumblue”>></span></span></span>
<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;color:mediumblue”><<span lang=”NL” style=”font-size:11.5pt;line-height:107%;font-family:Consolas;
color:brown”>style<span lang=”NL” style=”font-size:11.5pt;line-height:107%;
font-family:Consolas;color:mediumblue”>></span></span></span></span>
<span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; font-family: Consolas; color: brown; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>body <span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; font-family: Consolas; color: black; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>{</span>
<span class=”csspropertycolor”> overflow-y<span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; color: black; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>: hidden<span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; color: black; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>;</span> <span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; color: green; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>/* Hide vertical scrollbar */</span></span>
<span lang=”NL” style=”font-size: 11.5pt; line-height: 107%; color: black; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;”>}</span></span></span>
<span class=”tagcolor”><span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;
color:mediumblue”></style<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:mediumblue”>></span></span>
<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:mediumblue”><<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:brown”>/head<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:mediumblue”>></span></span></span>
<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:mediumblue”><<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:brown”>/html<span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;color:mediumblue”>></span></span></span></span>
Perhaps crude but it does the job
<span class=”tagcolor”><span lang=”NL” style=”font-size:11.5pt;font-family:Consolas;
color:mediumblue”> </span></span>
Hi @ruud1955, Follow this methord
Using a Plugin (Easiest Way)
- Install a Plugin:
- Go to your WordPress admin dashboard.
- Navigate to
Plugins > Add New.
- Search for “Insert Headers and Footers by WPCode” or “Custom CSS and JavaScript” plugins.
- Install and activate the plugin.