How To Perform An Action Only On Certain Pages In ClipBucket

16 views October 18, 2016 Saqib Razzaq 0

Sometimes you want to display a message or perform an action on more than one pages. In that case you can either go and edit files regarding all those pages or you can simply write code at one place and have that action work on all those pages. For this tutorial we will show you how to display a “Hello world” message to user on certain pages.

To show on main page only:

If (THIS_PAGE == 'index') {
echo “Hello World”;
}

To sow on watch videos page only:

If (THIS_PAGE == 'watch_videos') {
echo “Hello World”;
}

To show on every page except watch videos:

If (THIS_PAGE !== 'watch_videos') {
echo “Hello World”;
}

To show on every page except Admin Area:

If (!BACK_END) {
echo “Hello World”;
}

Was this helpful?