• Hello everyone,

    I’m currently helping my friend to start a website. I wanted to if its possible to customize the footer.php file to display only on specific pages e.g home page (my home page is static).

    let me know if any info is missing.

    Thanks in advance for any suggestions.

Viewing 6 replies - 1 through 6 (of 6 total)
  • you could use conditional tags: https://codex.www.ads-software.com/Conditional_Tags

    Thread Starter iu101

    (@iu101)

    @alchymyth thanks for the replay, one more question where do i need to make the changes to include the conditional tags footer.php or index.php

    I wanted to if its possible to customize the footer.php file to display only on specific pages e.g home page (my home page is static).

    you very likely need to make these changes in footer.php;
    because footer.php also contains html elements neccessary to finish the web page properly, and these are needed in all pages.

    Thread Starter iu101

    (@iu101)

    thanks again for the quick response, here is to the code for my footer.php:

    [code moderated - please follow the guidelines in https://codex.www.ads-software.com/Forum_Welcome#Posting_Code when posting code]

    so i added the following two line in the file :

    <img src="<?php  bloginfo('template_directory') ?>/images/letter2.png">
    <?php is_front_page(); ?>

    to load the image file only on the front page (static home page) but nothing seems to happen, any ideas ?

    thanks

    try:

    <?php if( is_front_page() ) {  ?>
    <img src="<?php bloginfo('template_directory') ?>/images/letter2.png" >
    <?php } ?>

    if you see any changes might depend on the location where you add this new code to footer.php.

    Thread Starter iu101

    (@iu101)

    thank you so much it worked like a charm

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘footer.php’ is closed to new replies.