Place fixed element on every project of a category
-
Hi Armin and Marius,
i decided to place a fixed object to every project, which allows the user to close a project and go back to the category where the user can find an overview of all the projects.
For now I did it like this: I placed the fixed element in every single project. Is it also possible to place an object like this to all projects of a category kind of automatically?
Thanks for your help!
:wrench:
-
Hi Michael!
At first there came a plugin like Advanced Custom Fields to my mind which lets you create additional fields.
But the problem is that it does not work together with Laytheme because there is no option to enter custom PHP code.
So what might be a solution that you create a button in the custom HTML area. This button is triggered to a little jQuery function which lets you close the project and go back to the overview.
Maybe you don't even need jQuery for this. Does a normal link back to the project page not work?
Let me know if you face trouble!
Best!
Marius
-
Hi Marius,
thanks for your reply and your tipps. For now I did it the simpel way, which is working well: Placing a text link in the gridder, set html class and add the following code in custom html:
.fixed-element{
position: fixed;
top: 20px;
right: 20px;
z-index: 5;
}Everything is working fine that way. The problem is that I am doing the website for another person and I want him to be able to upload a project without placing this link each time. So I am wondering if there's a way to place this link for all projects of one categorie in one step?
-
Hey Michi!
Yes I understand. It can be annoying for clients to make something like this every time.
Maybe you can solve it with the solution I wrote above.
All the best!
Marius
-
@mariusjopen Hi Marius, I have the same question, and I found not the best solution to use a go back/link back idea, if you meant this one:
<script>
function goBack() {
window.history.back();
because if someone just sends a link of one of the project than the person who opens it will not manage to get to the main menu, project page, but to the previously visited one.Anyway my question is this: I have seen it is possible to set id and class in the gridder when I just right click on the background, is this would be a class for that page/project? If yes how could I find the right selector, since I couldn't figure it out...
Here is what I did:
body:not(.id-369):not(.id-569):not(.id-252):not(.id-588):not(.id-494):not(.id-493):not(.id-672) #matex{
display: none;would it be be possible to use a certain category for these pages, or a class so when a new project is created the custom css doesn't need to be rewritten?
-
solved.
body:not(.category-25) #matex{
display: none !important;But what happens when I have a page? would be possible to also give pages categories or sth like that?
I am asking you this because what I am trying to achieve is a website for our studio and basically separate portfolio sites with a different menu, technically these would be one website. different X buttons for the projects that all pointing to the right project page. for instance. It is working out so far, but again I will face the same difficulty with pages. If there would be categories for pages than I could just say put the page into the xy category if you want a menu button or whatever.
Thank for any tip in advance :) -
Dear @lortnok
thank you for sharing your solution with us!Each page has a page ID. You could use this instead.
But categories is not possible :-/Best!
Marius
-
@mariusjopen yep, that is not the best, but thanks
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it