Custom template loading under footer?

Hey,

I have followed the instructions found here to create a custom archives page as our exhibitions go back quite a few years,

mostly it has worked only that the content is out of page content?

This is the page in Question

https://www.waterstreetgallery.co.uk/archives/

As you will see at the bottom its out of whack!?

Thanks

This is the page code finished

Hello There,

Thanks for writing in! Your template did not work because it does not follow the template structure of X. You will need to follow these steps:
1.) Please update the contents of your Archive template to have something like this:

<?php

// =============================================================================
// TEMPLATE NAME: Archives
// -----------------------------------------------------------------------------

?>

<?php x_get_view( x_get_stack(), 'wp', 'page' ); ?>

2.) And then please add the following code in your child theme’s functions.php file

function add_archive_lists(){ ?>
  
  <?php if ( is_page_template( 'archives.php' ) ) : ?>

  // you will have to add your custom code here

<?php endif; ?>

<?php }
add_action('x_before_the_content_end', 'add_archive_lists');

This code assumes that you have the archives.php as your template file and please do not forget to add your custom html code in the code above.

Hope this helps. Please let us know how it goes.

Hi,

Thanks,

I have tried the above, and it has removed what was appearing below the footer altogether now.

is this the HTML code ? and also by above do you mean add it to functions . php ?

<?php x_get_view( x_get_stack(), 'wp', 'page' ); ?>

By Date

    <?php compact_archive($style='block'); ?>

Categories:

    <?php wp_list_categories('title_li='); ?>

Thanks

Hello There,

This should be the complete code:

function add_archive_lists(){ ?>
  
  <?php if ( is_page_template( 'archives.php' ) ) : ?>

    <p><strong>By Date</strong></p>
    <ul>
        <?php compact_archive($style='block'); ?>
    </ul>
    <p><strong>Categories:</strong></p>
    <ul>
        <?php wp_list_categories('title_li='); ?>
    </ul>

<?php endif; ?>

<?php }
add_action('x_before_the_content_end', 'add_archive_lists');

Yes, you will have to add this code in your child theme’s functions.php code.

Please let us know how it goes.

Hi,

I have added it to my Pro functions theme Functions.php file and still no joy.

Nothing shows up now on?

Thanks

I have tried both the pro functions file and child. I have now removed it from the pro as this broke it altogether.

In the guide I followed it specified the name to be page-archives.php that is what i named it so I altered the code you gave me to suit.
But still no joy.

Thanks

function add_archive_lists(){ ?>

<?php if ( is_page_template( 'page-archives.php' ) ) : ?>
<p><strong>By Date</strong></p>
<ul>
    <?php compact_archive($style='block'); ?>
</ul>
<p><strong>Categories:</strong></p>
<ul>
    <?php wp_list_categories('title_li='); ?>
</ul>
<?php endif; ?> <?php } add_action('x_before_the_content_end', 'add_archive_lists');

OK, so the reason why nothing was appearing was the page template on the Archives page had set itself back to default somehow!

So I now have it appearing back again but still under the footer.

Thanks so much for your help

Hello There,

Thanks for updating in! Regretfully we could not log in both in the dashboard and in the ftp. It seems that the passwords were invalid. I also have inspected the page and I noticed that since you have installed a caching plugin W3 Total Cache, please clear your plugin cache first before testing your site. You may have got the instructions correct yet still seeing the cache version of the page. This can cause the changes to not take place on the front end. It will eventually show up when the cache regenerates, but it’s not ideal if you’re looking to see your changes immediately. Caching plugins are best to turn on only when you’ve finished building the site.

Please let us know how it goes.

I have an exclusion for my ip with the W3 cache and have also tried disabling it emptying my cache and still same issue.

Apologise for the incorrect login details.

Please find the new ones:

Summary

This text will be hidden

Hello There,

Thank you for providing the correct credentials. I have checked your theme files and I could see that you haven’t remove your code in your page-archive.php file. So I went ahead and remove it to resolve your issue. After making sure everything is correct, I have cleared your plugin cache since you have installed W3 Total Cache. The code is now showing at the bottom of the https://www.waterstreetgallery.co.uk/archives/ page. You will be seeing other page content since you have edited this in Cornerstone. If you want to only display your code, you will just need to delete the page contents via text editor.

By the way, I would highly recommend that you remove page-archive.php file from pro folder and move it to the pro-child theme instead so that it will not be deleted when there is a Pro theme update.

If you need anything else, please let us know.