Archived topic
How to show slider only front page.
1 reply · Started by somi on February 28, 2018
1. Go to Appearance > GP Hooks > After Header
<?php if ( is_front_page() && is_home() ) {
// Default homepage ( both the front page and the recent posts page)
} elseif ( is_front_page() ) {
// Static homepage
} elseif ( is_home() ) {
// Blog page
} else {
// Everything else
}?>
We are going to use this above coding.
And we need to modify a little bit like the coding below.
<?php if ( is_front_page() && is_home() ) {
echo 'Default homepage ( both the front page and the recent posts page)';
} elseif ( is_front_page() ) {
?>
[metaslider id="19534"]
<?php
} elseif ( is_home() ) {
echo 'Blog page';
} else {
} ?>
Do not forget check 'Execute PHP' check box.
Hi there,
I'm not sure what your question is?
There are a few examples here that might help: https://docs.generatepress.com/article/using-hooks-conditional-tags/