-
Peter
Hello GP Team,
I like the front page or homepage of the Info preset, where each category has its own section.
I’d like to implement the same on my site, however, I do not want to import the Info theme as it would destroy everything on the site and it will wreck the site’s SEO.How can I implement the layout for the front page only? For the articles.
From the site library, Info has Travel Tips, Health, and Global Info separated on its front page.
I’m assuming these are the categories of each article.Another question I would like to ask is my site’s dropdown menu produces several lines (down); how can I turn it into a single line only?
I tried various solutions, including the one from the support archive.
But it didn’t seem to work, as the layout or alignment was not working properly.I hope you can help.
Thank you,
-
How can I implement the layout for the front page only?
Here’s the code of the info home page, you can paste it to your page by switching to code editor:https://pastebin.com/EbCanvH3
You will still need to configure the query loop blocks:
https://generatepress.com/forums/topic/generatepress-info-theme-home-page-category-change/#post-2430886how can I turn it into a single line only?
Not sure what you mean, can you explain a bit more or provide a mockup?
Let me know 🙂
-
Peter
Hi Ying,
Thank you for the quick response.
Regarding my first query, where should I put these codes?
My front page is set to default “your latest posts”.
I am not using a static page. Should I make one?
And will my featured posts, the one you see above, remains after I implement the code?As for my second question, sorry for not being clear.
If you check my site’s main menu, the items “PC Components”, “Reviews” have a dropdown sub-menu.
I wanted to make the submenu line up in a single line or row only.
You can see a similar menu from this site – https://www.techspot.com/
If you place your mouse above Trending, Features, or Reviews from that site’s main menu, all the submenu items are in just one row.
I just need the correct CSS for the sub menu.Thank you,
-
Fernando
Hi Peter,
Let’s discuss question #1 here. Can you open a new topic for question #2?
Yes, you need to create a static page and assign that to your home page. Here are a few steps:
1. Edit the home page.
2. On the top right corner, click on the 3 dots.
3. Click on “Code Editor”. Example: https://share.getcloudapp.com/z8ubJdZy
4. Paste the code by Ying in the Code Editor.
5. Revert back to the Visual Editor in the 3 dots menu.
Let us know how it goes.
-
Peter
Hi Fernando
Okay I will create another topic for question #2.
Meanwhile, I will try the solution for my first question.Thank you,
-
Fernando
You’re welcome, Peter!
-
Peter
Hi Fernando / Ying,
I have created a page and tested the code you provided.
And I am slowly getting a hang of it, editing the elements.
I have a few questions if you don’t mind.In a container or loop, how can I show the most recent posts regardless of the category?
I wanted to make the first container as “what’s new” and just show 5 or 10 of the most recent articles published.
Also, how can I make the “more” button show the page two of the newly published articles?Can you also share the code for the Newsroom homepage too?
Thank you,
-
Fernando
Yes, that’s possible. Just don’t set a parameter for a taxonomy for the Query Loop.
There’s no more button feature yet but it’s planned for the future. What’s there is a pagination feature. Just click on the “+” icon in the Toolbar when you have the Query Loop selected.
Here it is: https://pastebin.com/ujcgZWYp
-
Peter
Hi Fernando / Ying,
I was able to apply the code that you gave, and it worked.
I have some additional questions:1. I named the static page as “Home Page”. When I published the page and set the static page as the Front Page, the title of that page, which is “Home Page”, also appeared. What I did was I delete the page’s title. However, I don’t think that’s the correct way since the page is now untitled, and it left a gap where the title, “Home Page”, is supposed to be. You can check that by visiting the site’s homepage.
2. I use a 4-tiled featured post from a now-discontinued GP child theme. You can also see that from the homepage, just below the menu bar. I wanted to use the featured post from Newsroom. But I noticed that the thumbnails are not “interactive” or don’t have a mouseover effect. Is there a way to apply a mouseover effect similar to the one I am using?
3. Lastly, I noticed that all my custom CSS or additional CSS could be seen by simply “viewing the page source”. Is there a way to hide them?
Thank you,
-
David
Hi there,
1. Edit the page, put back your title.
And then in the editor sidebar settings look for Disable Elements meta box:https://docs.generatepress.com/article/disable-elements-overview/
Check the Content Title to disable it.
2. It is possible with the GenereateBlocks Pro plugin.
3. CSS will always be visible somewhere in the source code or a network request if a user wants to go look for it. You could move your custom css to a Child Theme so its in a network request instead….
…. but you’re using WP Rocket to optimize your CSS and that is inlining all your CSS into the source anyway so the child theme would not make any difference.
- You must be logged in to reply to this topic.