Community Forums › Forums › Archived Forums › General Discussion › Showcase Pro: Static page for home and /news/ for blog?
Tagged: blog home, static home
- This topic has 6 replies, 3 voices, and was last updated 8 years ago by carasmo.
-
AuthorPosts
-
October 27, 2016 at 9:10 pm #195408CanonicalMember
I have Settings -> Reading -> Front page displays -> A static page selected in WP admin. I created two pages:
1) one I assigned to Front Page to be the home page
2) the other (/news/) I assigned to Posts page to be my blogI know the front_page.php template is what is controlling the home page (#1) above. But I cannot find the code for the blog Posts page. I'm guessing since Showcase Pro doesn't seem to have a template for the blog, it is defaulting to some Genesis Framework index.php or something which I cannot/should not modify. I can change functions.php tweaking the hooks used by the Post page blog home page, but doing so screws up the single posts format.
What template is used for the blog home page, category, and archives pages that display teasers for multiple single posts?
October 28, 2016 at 5:27 am #195423Victor FontModeratorYou are incorrect about front-page.php. When you change the front page to display a static page, you are no longer using the child theme's front-page.php template. Front-page.php is a widget driven template that only displays if you assign widgets to it.
The blog page template is in the Genesis Framework. Again, all you do is assign the blog template to the a standard page and you're done. You should never change anything in WordPress reading settings for displaying Genesis pages. Read your theme's setup instructions. It's all explained in them. http://jtgrauke.com/documentation/showcase-pro/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?October 28, 2016 at 7:08 pm #195461CanonicalMemberI respectfully disagree...
I AM using the child theme's front-page.php even though I changed the front page to display a static page. It is being used by default because of the order of precedence that the framework uses to find a template for the home page. I have tweaked the code in the child theme's front-page.php to add some additional functionality AND I created those widgets that I wanted to use that come as part of the template out of the box. So 80% of the home page is like the demo and 20% is new functionality. But that is not my problem. My "front page" is working perfectly.
My problem is that I ALSO want to have a blog home page live at /news/ AND I don't like the default blog format that is being rendered by the Genesis Framework for that blog home page, category pages, archive pages. I want to move some things around and add some additional HTML elements for all of those (blog home page, category pages, archive pages). I would like to do this in a single template that used to override the framework for blog home page, category pages, archive pages, but I don't know the order of precedence that the framework uses to determine which template to apply to those pages.
I "believe" if a specific template is assigned in the Edit Page screen in admin then it will use that. But if not, then it looks for other child template names (archive.php? blog.php? other?). If it can't find any of those then I "believe" it defaults to some file like index.php in the framework.
I'm trying to determine what files it looks for and in what order for blog home page, category pages, archive pages. I don't mind creating a new template (say archive.php) that doesn't come with the child them, but really don't want to have to manually assign it to every new category, archive, tags, etc. type page where I might want to list teasers for and links to say 10 posts.
I've read every word of the docs for the child theme probably 25-30 times. While they give you the basics for setting up the theme to look like the demo, it doesn't answer this question. This particular child theme seems to be written for a static home page with NO blog. All blog functionality seems to be provided through the framework which I cannot modify.
October 28, 2016 at 9:28 pm #195465carasmoParticipantWith Genesis you don't actually have to touch the Reading > Settings (but you can). You can just use the blog template by creating a blog page and then use that by using that template on the page in attributes panel. The reading > settings way is I prefer, since that is the main query.
A child theme gets the parent theme loop, from genesis > structure > loops genesis_standard_loop() in the parent framework. You don't actually touch that. You don't create a page, typically, unless it's an archive for a CPT (and even then it's not necessary for many situations). You can move anything and add anything with hooks and filters from your functions.php or include or plugin using conditionals so that you only work on archives.
https://my.studiopress.com/docs/hook-reference/
http://my.studiopress.com/docs/hook-reference/#loop-action-hooks
https://www.web-savvy-marketing.com/2014/01/how-to-use-genesis-hooks/
https://www.lynda.com/Genesis-training-tutorials/5727-0.html
https://knowthecode.io/?s=GenesisHere's an example of moving the image and affecting all archives but not single posts/pages in an archive in the main query (not CPTs)
/** * * * Helper function for all archives (usually make an include of the helpers in another file) * */ function is_archive_of_some_kind () { return ( ( ( is_archive() ) || ( is_category() ) || ( is_home() ) || ( is_tag() ) ) || is_author() || is_date() || ( is_search() || ) ) ? true : false ; } /** * * * Example move the archive image from the content to above the content * */ function prefix_archive_loop() { if ( ! genesis_is_root_page() && is_archive_of_some_kind() ) //Remove the image from the entry_content at the original priority remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); //Move the image into the entry-header add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 ); } add_action( 'genesis_before_loop', 'prefix_archive_loop' );
October 29, 2016 at 9:02 am #195474carasmoParticipantOctober 29, 2016 at 11:25 am #195478CanonicalMemberThanks carasmo.
I think I had most of this figured out. I actually had the /news/ blog home page looking the way I wanted it by using remove_action/add_action in functions.php to move certain things around (like from genesis_entry_header to genesis_entry_content) and add additional <div>s that I needed. But then I noticed that some of the changes had negatively affected the format of the individual post page.
I was having a stupid moment. I think you've given me what I needed to make the changes affect ONLY the archive type pages that loop and show multiple posts but not affect the single post pages.
Thanks!
JimOctober 29, 2016 at 1:28 pm #195483carasmoParticipantCool. Don't forget the is_singular exit early since I noticed that even with the conditional I used, it was affecting my single posts.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.