On mobile, I want to display what page my users are on. I have 6 top pages at the moment.
Home, Projects, Blog, Contact, Privacy Policy and Impressum. Both Projects and Blog have posts in them. Projects is a custom post type as well.
When a user clicks on Contact, title should change to contact. If they go to Project and click on a post, the title should say projects. I hope I make it clear.
I don’t mind working with if
statements either if that’s a solution.
Here is an image of what it would look like:
I hope I am making myself clear. Does anyone have a solution?
I have tried it with get_the_title()
to echo the title, but this does not give me proper results. When I’m on my Contact Page, it does say Contact. But once I’m on my home, project or blog page, it gives me the title of some post item, and not the title of the page as I want.
To give more context of what I want:
Imagine it like a breadcrumb, but instead, I only want one part of it. So instead of
Home > Contact
or
Home > Project > Some Post Title
I want only “Contact” or “Project”. How would I go about that?
So now I have this code:
Which almost works. The only Problem I am having is, when I’m on the Project and Blog page, where you can select a post. It doesn’t show “Projekte” or “Blog”.
When I’m clicking on a Project Post, it shows “Projekte”. But when I’m on a Blog Post, it does not show “Blog”.
Any ideas on how to fix that?
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com