Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23653

    I have a display on one of my pages that refreshes every 5 minutes.  However, in order to see the refreshed page on my web site, I have to manually refresh the page.  Can I add an HTML meta tag or something to automatically refresh the page?  Somethin like this:  meta http-equiv=”refresh” content=”5″>

    #23656

    Hello, redshi10bg!

    Thanks for posting your question about adding code to your website to refresh your page automatically. I have reviewed a forum online that explained how to do this. For instance, adding the following code to your head.php file:

    <?php
    if(is_page(##))
    {
    echo ‘<META HTTP-EQUIV=”REFRESH” CONTENT=”300″>’ ;
    }
    ?>

    This code will cause the page with ID: ## to refresh every 5 minutes if that is the current page loaded. This will require you to know the page ID. You can find the page ID by setting your Permalinks setting to Plain and then visit the page that you want to refresh automatically. Grab the page_id from the URL (https://example.com/?page_id=##) and then you can revert your Permalinks setting.

    To add the code to your head.php file, you will need to hover over the WordPress Dashboard Admin menu option: Customize and then click on CSS/HTML Editor. Then proceed to select your theme from the right side “Select theme to edit:” drop-down menu. Now find the head.php file in the list below the drop-down and click on the template file’s link. Add the code above (modifying the ## to replace with the page_id you want) inside of the “<head> </head>” tags, like this:

    <head>
    <meta charset=”utf-8″>
    <meta http-equiv=”x-ua-compatible” content=”ie=edge”>
    <meta name=”viewport” content=”width=device-width, initial-scale=1″> <?php wp_head(); ?>
    <?php
    if(is_page(##))
    {
    echo ‘<META HTTP-EQUIV=”REFRESH” CONTENT=”300″>’ ;
    }
    ?>
    </head>

    Be sure to click the Update File button below the editor, to ensure you save those changes made.

    Alternatively, you can FTP to your website’s server and locate the head.php file in the theme directory to add that code. For instance: /home/userna5/public_html/wp-content/themes/boldgrid-theme/templates/head.php. However, this may vary depending on your website’s home directory location and theme being used. I recommend the process I outlined above using the built-in CSS/HTML Editor. I hope this helps!

    Sincerely,

    Carlos E

    #23655

    That’s what I was looking for.  thank you!

    #23654

    Hey, Robert Ray!

    Awesome, thanks for the feedback! I’m glad we could assist you with that. Feel free to select it as the best answer.

    Sincerely,

    Carlos E

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to auto refresh a web page’ is closed to new replies.