additional home page
-
Hi,
I was wondering if it would be possible to add a page on my site that functions as a second home page, in that it allows me to post links – in my case, article titles – that then lead to a separate page of their own with the article text.
I’d like to this in order to distinguish between articles I have had published in mainstream publications and articles I have written myself and am self-publishing on my site.
I’d appreciate any pointers on this.
Thanks!
Jamie
The blog I need help with is: (visible only to logged in users)
-
Hi Jamie,
Yes, you may create such a page. Two ways:
1. Static page with inserted shortcode — Create a new page and insert Display Posts Shortcode into it, customized so that it displays only certain articles. You may then provide a link to that page in a custom menu, as described in the Custom Menus support page.
2. Category page — A dynamic category page will display only those posts that have been assigned a certain category. See, for example, your Commentary category page. Links to such pages may be added to a custom menu. See the Category Pages support page for relevant information, instructions, and links.
doc
-
Many thanks. That’s really helpful. I used the second method. But is it possible to remove the ‘Category: Commentary’ sub heading from the new page?
-
You’re welcome. : ) I think that hiding the category page title would require CSS customization, which is available on the Premium and Business plans. I’ll call for staff attention regarding that. Staff will respond here.
-
-
Hi there,
We’ll need CSS to do this, yes, but as you have the Premium Plan I can help you with that.
Click on My Sites, then click the Customize button next to Themes. Then click on CSS. Add the following code on a new line:
/* Hides page title on Commentary category page */ .category-271 h1.page-title, .category-271 header.page-header::after { display: none; }That will completely hide the title, but just on this category page.
If instead you just want to hide the word “Category” and still display “Commentary” as the title, use this:
/* Replaces category page title Category: Commentary, with just Commentary */ .category-271 h1.page-title { font-size: 0; } .category-271 h1.page-title::before { font-size: 2.1875rem; content: "Commentary"; } -
Great, thanks!
Could I get that code again but this time for ‘Category: Miscellaneous’ instead of ‘Commentary’?
Also, would it be possible to close the gap that deleting ‘Category: Miscellaneous’ leaves at the top of the page?
Many thanks,
Jamie -
Oh and one more question: how do I get the articles that I post on my ‘Miscellaneous’ page off my main ‘Writing’ home page?
Thanks!
-
Could I get that code again but this time for ‘Category: Miscellaneous’ instead of ‘Commentary’?
I had another look at your site’s code, and it appears you can actually use “category-miscellaneous” rather than the category ID (category-875 in this case) to target that specific category. So you can use the same code I gave above for any category. Just replace the category slug.
The category slug refers to the unique identifier for each category in the URL. So if you look at the URL https://jamiemaxwell.net/category/miscellaneous/, it’s the bit after “category/”. This is generated based on the category name, but won’t match it exactly, e.g. it will be only lowercase, spaces are replaced with hyphens, and it will ignore punctuation or special characters in the category name if applicable.
Could I get that code again but this time for ‘Category: Miscellaneous’ instead of ‘Commentary’?
Do you mean when hiding the category title completely? This should do it:
.category-875 header.page-header { display: none; }You can actually just use this instead of the code I gave above – the code in my first reply removes the text and the line underneath it. This code removes the entire page header, so is actually simpler and achieves the same result.
Oh and one more question: how do I get the articles that I post on my ‘Miscellaneous’ page off my main ‘Writing’ home page?
You can’t. Your site’s Front Page, which you have under “Writing” in the menu, displays your site’s main feed. The main feed will always display all posts on your site. This is central to how the WordPress software is designed, so cannot be changed.
But there’s another option. If, instead of your latest posts, you set the front page to display a static page, you can use the Display Posts shortcode to display only specific posts on the front page. The caveat is that it will use the shortcode’s own formatting, so posts might not display the way your theme normally styles them. And the shortcode will display the maximum number of posts available up to a limit of 100 posts, so it won’t use infinite scroll or click-to-load new posts like the feeds on your site does.
If you want to take a look at that option, you can see the docs on the shortcode and setting a static front page here:
-
OK, no worries, thanks. There’s one other thing I really would like to change, though. When I share a link to one of my pieces on social media, part of the text of the article – the first 10 or so words – is displayed in the link image. But I’d really like just the article title to display. Is there a way to control that? Thanks again, Jamie
-
For new posts, make sure to write the text you want to be shared in the Sharing section of the editor, and also in the custom excerpt field under More Options in the editor settings.
The only way to control the text that’s used when an already published post is shared is to set a custom excerpt on the post.
If you set that to the post title, that’s what we’ll send to Facebook and other services when they scan your post to generate a preview. However, keep in mind that this info gets cached on their end, so if they already has a preview for a particular posts, they don’t automatically scan that post again, but just use the existing preview the next time the same post is shared.
You can force Facebook and Twitter to update their caches for already-shared links after you’ve updated the posts with a custom excerpt, using their tools at these links:
https://developers.facebook.com/tools/debug/sharing/
https://cards-dev.twitter.com/validator
Other services like LinkedIn and Google+ do not offer such a tool, so there’s no way to force them to update their previews for links.
- The topic ‘additional home page’ is closed to new replies.