Footer Example | Build Your Own Wicked WordPress Themes

Hi, I am working my way through “Build Your Own Wicked WordPress Themes”.
Some code does not seem to work.
To illustrate the wp_list_pages() function, the author gives this example:

Within functions.php

<?php
function wicked_footer_pagelinks() {
  echo '<ul id="simplepages">';
  wp_list_pages('depth=1&sort_column=menu_order&title_li=');
  echo '</ul>';
}
?>

Within footer-homepage.php

<div id="footer">
  <?php
    wicked_footer_pagelinks();
    // action hook creating the footer 
    thematic_footer();
  ?>
</div><!-- #footer -->

An within home.php

// calling footer.php
get_footer('homepage');

It does not work. I am using Wordpress 5.2.1.

Does anyone have an idea, what could be wrong?

Best and thank you

Can you explain that further? What did you expect to happen? What happened instead?

Yes, sorry: According to the book all pages should listed in the footer…

But they are not? Or are you seeing some kind of error?

It’s rather hard to help someone when we don’t know what the problem is :slight_smile:

Absolutely. :slight_smile:
The page does not load. There is a blank screen.

I think, the problem is the code in the functions.php - because when commenting it out, the page loads.

This is the functions.php code

<?php
function wicked_footer_pagelinks() {
  echo '<ul id="simplepages">';
  wp_list_pages('depth=1&sort_column=menu_order&title_li=');
  echo '</ul>';
}
?>

is there a file with example code available for this book?
Maybe this could help.

Code seems fine to me. Have you checked the log files to see if there is anything there that might explain what’s going on?

You could also try adding this to the very top of your index.php:

<?php

ini_set('display_errors', true);
error_reporting(-1);

That should show any errors that occur while rendering the page, instead of just showing a blank page.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.