Adding widgets, or custom code, above the front page

Posted in: Newspaper
Post count: 9

I have spent so many hours on this and I can’t find a solution.

I want to keep the front page as it is, in terms of how it displays the latest posts, meta data, and the click ‘more’ button, but directly above that I want to add some custom information which may be best suited for an html widget. The issue is not so much about the information I want to add, but how to set it all up so I can add something there.

(I want to display editors picks and the most recent posts with one line each containing the post subject and date above the usual home page display of all posts.)

I have tried so many suggestions online, and nothing works. I have created a sticky post that sits above everything, which is in the perfect spot, but I can’t hide the meta data as if I use this method, I don’t want the author, date , comments, post count, etc, showing.

I have tried setting a static page, but I can’t find any information on how to display the posts on the static page exactly how they are displayed for the default show all posts front page. I don’t want the widget style recent posts, I want the standard front page style up until I add the read more tag, including any images I may have in the post at the time (so all posts are showing with no thumbnails, or a condensed layout)

In blogger, you can just drag a widget above the list of posts, and it is so very simple, but in wordpress, you can’t have a widget there, only the front page, headers, footers and the side bars. (I don’t want my information above the side bar, I want it above the front page under the header)

Well, if someone can help me out, that would be great. I have the second latest version of wordpress, and the latest version of Newspaper.

  • This topic was modified 10 years by Laron.
Post count: 22421

Hello,
Unfortunately if you want to place a widget on the homepage you will have to edit the theme files as there is no setting for it in the theme. You can edit the page template itself or even create a custom page template you can add code to. https://forum.tagdiv.com/topic/overriding-page-pagebuilder-latest-php-in-child-theme
Then after you create your new page template (a copy of one of the existing template), you can use a do_shortcode function in the file to add content to it: https://developer.wordpress.org/reference/functions/do_shortcode/
You can also use standard html and php if you have the proper coding knowledge. If you need help with the code needed, you will have to get some hired help as we cannot offer any custom work at the moment.
Thank you!

Post count: 9

Thanks for your response. This is important as it’s what makes my website unique, but not only that, it provides navigation in a very quick way for regular visitors. Based on feedback, my visitors prefer me having quick links near the top of the posts which are easily accessible. (so best here, than on the side menu)

I have a coding educational background, I just haven’t used it for a very long time, so I was hoping for a quick answer, but it looks like I will have to do some manual work here. I am finding it really time consuming setting everything up! But it’s enjoyable. I am new to wordpress, which is part of the problem. I have been with blogger for six years

When saying all that, it may be best for me to try and get the sticky post option working, and hiding all the fields. Then I can simply update that post whenever I want to make the changes I need without impacting the front page, and list of posts below that. I thought that you may have had a regular question from clients around hiding fields in sticky posts so would have been able to tell me the CSS code specific to your themes fields such as comments, the date, author, etc. I wan to hide everything though and just have what is in the contents of the sticky post/page displayed.

Post count: 9

I want to add that I have looked at the code in loop-single.php and worked out how to hide all the meta data in a sticky post for the purpose of achieving what I want, as explained in my original post above.

I placed, .sticky .td-module-meta-info {display: none;}, within the custom CSS on the Newspaper theme control panel.

However, I can’t have the subject/title showing as the title has nothing to do with what I am wanting to achieve here, but I can’t work out a way to remove it yet. I am still working on it. I could remove the title from the page in the page editor under admin, but I want it there so that myself and other authors of my site can see what it is for. I will post my solution if I find it.

Post count: 9

Alright, actually doing this my self is faster than searching for the solution which is a bit strange.

I have worked out how to hide the title, just like before I placed it in the custom CSS under the Newspaper theme control panel. This is what I put in there,.sticky .entry-title {display: none;}.

So all I can see now is the text I am putting on the actual page. My next step is to find the code that will display the titles and date, of the latest 5 or so articles, one line break after the other. As well as working out how I will do the editors picks in a similar way. (I want that code sitting on the sticky page)

  • This reply was modified 10 years by Laron.
Post count: 9

So, I have ran into a problem. I can’t run PHP on the sticky post through the ‘text’ view within post admin. I just found a plugin to enable me to do this, and I will try that now. (https://wordpress.org/plugins/insert-php/)

Post count: 9

So this is probably the last post I need to make on this thread, but I want to provide a screen shot of what I was trying to achieve with the sticky post. Note that this is not the final design/colors/layout, as I am working through sections of the setup, one little bit at a time — slowly. <BR><BR>

Post count: 22421

Ok,

I seem to get the general idea of what you are trying to achieve. My I suggest a much simpler way of doing it with the theme settings?
If you only require a list of your latest posts at the top of the blog page, why not create a static page using one of the blocks to show the content and simply adding a block called latest posts on top and filtering it to show the latest posts and chose one of the block styles that comes close to your design. It’s much easier this way. You can maybe use this block: http://demo.tagdiv.com/newspaper/block-7/ and hide the featured images with css.
Here is an example of how it will show:
http://screencast.com/t/KkjNdZ1Q You can also use css to remove a bit of the spacing.
If this is a viable solution for you, then I can help with any required css.

I hope this helps.
Thank you!

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.