Skip to content

Hide element on specific page with custom css #2054

Answered by gpsblues
Astrosheepjpg asked this question in Help
Discussion options

You must be logged in to vote

Hi,

I didn't realize it was a homepage-type page :(
In this case, it's more complex because you would be affecting all pages:

main.page .hero {display: none;}

However, you can try other solutions:

  • Create a custom page template, eg page-simple.hbs that does not include the .hero section. You can follow this tutorial: https://getpublii.com/dev/how-to-create-custom-templates/ (editing the config.json file, duplicating + modifying + renaming page.hbs).

  • Modify page.hbs by adding a unique class/id for each page and then use that unique class/id to hide the section. We tackled a similar case in this post: #1706 (comment).

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Astrosheepjpg
Comment options

Comment options

You must be logged in to vote
2 replies
@Astrosheepjpg
Comment options

@gpsblues
Comment options

Answer selected by Astrosheepjpg
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants