- This topic has 25 replies, 3 voices, and was last updated 4 years, 8 months ago by Leo.
-
AuthorPosts
-
August 14, 2019 at 8:24 am #984098LeoStaffCustomer Support
For the different logo on home page, you can use this filter:
https://docs.generatepress.com/article/generate_logo/
https://codex.wordpress.org/Conditional_Tags#The_Main_PageAdding PHP: https://docs.generatepress.com/article/adding-php/
As for different colors on the home page, we can use CSS for that.
What are you looking to change?
August 14, 2019 at 8:33 am #984108SteigIs there a way to make posts page be driven by CSS changes? I have a second church that is asking for this same approach, which is why on staging the posts page got moved to the extension 001-001. I would then just increment the numbers for different churches. I’d need to load a different logo to the posts page and probably change the navigation bar color. The home page would just stay constant with some marketing language.
August 14, 2019 at 1:35 pm #984335LeoStaffCustomer SupportIs there a way to make posts page be driven by CSS changes?
What changes are you referring to?
If you add body.blog in front of the CSS selector then it would only apply to the main posts page.
An example to change the navigation color on the blog page would be:
body.blog .main-navigation { background-color: #000; }
Changing the logo would require the filter I mentioned above.
August 18, 2019 at 5:06 pm #987521SteigI’d like to go back to the post from Leo on Aug 10 with the suggested code for when the posts header logo is clicked, it would refresh that page. It’s not quite working the way I need it to.
add_filter( 'generate_logo_href', function( $url ) { if ( is_home() ) { return 'URL ON POSTS PAGE'; } return $url; } );
Here’s the code. I replaced the ‘URL ON POSTS PAGE’ with the actual URL assigned to the posts page. I’d think that would be pretty static, but when on that page, and I’ve used the menus to narrow the view of the posts being looked at, clicking the logo just takes the viewer back to the static howe page. My goal is to keep the viewer in the silo of the posts page they currently are viewing.
Could you modify the code to do that?
*edit*
Maybe instead of making the posts page header logo clickable at all, another category menu could be introduced that says “All Posts” that would return the viewer to the all posts again?August 18, 2019 at 8:33 pm #987558LeoStaffCustomer SupportNot sure if I fully understand.
The code isn’t working at all.
Can you link me to the posts page?
August 18, 2019 at 9:46 pm #987574SteigI’ve updated the URL to point to the posts page. When at the main posts page, click the logo to reload and everyone reloads OK. Then click on the categories to filter the view and then click the logo. The goal is to take the viewer back to that top level. But instead, it take the viewer to the static home page.
August 19, 2019 at 9:58 am #988127LeoStaffCustomer SupportWhat if we change the logo URL for posts page, all archives and single posts?
add_filter( 'generate_logo_href', function( $url ) { if ( is_home() || is_archive() || is_single() ) { return 'URL ON POSTS PAGE'; } return $url; } );
You can find all the available conditional tags from WordPress here:
https://codex.wordpress.org/Conditional_TagsAugust 19, 2019 at 6:53 pm #988427SteigOK, that worked well. The posts page currently draws the logo that shows at the top from the Site Identity section of the theme. How can I change that to just be a logo that I link too in the media folder?
August 19, 2019 at 10:03 pm #988486LeoStaffCustomer SupportLike to use a different logo image?
If so this should help:
https://docs.generatepress.com/article/generate_logo/August 20, 2019 at 6:06 am #988764SteigThe problem is that I’m using categories as a way to split up the posts into different groups. Those categories turn in into the menu choices you’ve seen in the navigation bar.
This filter swaps out the logo based upon the category. Is there a different way to do it?
August 20, 2019 at 8:40 am #989019LeoStaffCustomer SupportThis filter swaps out the logo based upon the category.
That’s only because the example is using
is_category()
as conditional tags.You can use the exact conditional tag as above to match the URL filter:
https://generatepress.com/forums/topic/move-blog-summary-page-to-secondary-location/page/2/#post-988127 -
AuthorPosts
- You must be logged in to reply to this topic.