Support » Theme: Colinear » Placing date between headline and text on front page.

  • Nessan Cleary

    (@nessan-cleary)


    Hi
    I need some more help with my website – nessancleary.co.uk. I’ve removed the taglines – Date posted, category and so on – which used to appear under the summary of each post on the front page of the blog when viewed on a desktop computer. But I’d now like to put the date for each post in the gap between the headline and the text. I know that someone’s already asked about this topic on the forum, but they didn’t post the answer.
    However, I notice that the mobile version still has a line with the date and ‘Leave a reply’. So, ideally I’d like to remove this line from the mobile version and have the date appear in the gap between the headline and the summary text in both the desktop and the mobile versions.
    Anyway, if anyone has any ideas on this, then I’d appreciate some help.
    Nessan

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Siobhan Bamber (siobhyb)

    (@siobhyb)

    Automattic Happiness Engineer

    Hi @nessan-cleary!

    It is possible to achieve what you’re after but will require you to experiment a little with the theme’s HTML.

    The first step is for you to set up a child theme.

    In case you’re unsure, the following guides provide a good introduction to child themes, including steps to set one up:

    After you have completed that step, copy the parent’s content.php file to your child theme’s directory and then open it in your favourite text/code editor.

    Locate the following code in that file:

    <footer class="entry-footer">
    	<?php colinear_entry_footer(); ?>
    </footer><!-- .entry-footer -->

    The above code outputs the post meta information that you hid beneath each of your posts. You can move that piece of code below the following line to move it just below the post’s title:

    </header><!-- .entry-header -->

    You may need to use CSS to tweak the style of the post meta information after following the above steps to move it.

    However, I notice that the mobile version still has a line with the date and ‘Leave a reply’.

    I can see that the Jetpack mobile theme is enabled on your site, which is why you’re seeing a different design to Colinear on mobile devices.

    It’s not necessary to enable the separate mobile theme as Colinear adapts to devices of different sizes by default.

    To disable the mobile theme, navigate to Jetpack -> Settings -> Writing and scroll down to the Theme Enhancements and the “Enable the Jetpack Mobile theme” option and turn that off.

    Let me know if the above guidance helps out or if you have any further questions!

    Hi Siobhan,
    Thanks for your very detailed reply – I fell ill last week so it’s taken me a while to have a look at this.
    You gave me more to think about than I was expecting – I didn’t realise that the mobile site would be so different.
    Is there a way to keep the mobile site but lose the the date and ‘Leave a reply’ line? The reason is that I like the mobile site because it handles the menu very neatly and puts the search bar right at the top of the screen and I think this works better on the small screen then relying on the responsive layout.
    Thanks again for your help,
    Nessan

    Siobhan Bamber (siobhyb)

    (@siobhyb)

    Automattic Happiness Engineer

    Hi Nessan,

    I’m sorry to hear you’ve been ill! Hope you’ve made a full recovery now.

    You could use the following CSS to hide the date from the mobile theme:

    .entry-meta .entry-date {
        display: none;
    }

    The following would then remove the “leave a reply” line:

    #reply-title {
        display: none;
    }

    Hope that’s helpful.

    Hi Siobhan,
    Thanks for getting back to me. I’ll have a go at this over the weekend – too much work to catch up on at the moment having been ill last week. It sounds fairly straightforward but I may come back to you next week!
    Best regards,
    Nessan

    Siobhan Bamber (siobhyb)

    (@siobhyb)

    Automattic Happiness Engineer

    Sounds good to me! Hope you’re able to catch up on everything this week.

    Hi Siobhan,
    I think that I need some more help. I finally got around to sorting out the website and followed your instructions, but I’ve obviously missed something. I’ve set up the child theme and enqueued that, which turned out to be easier than expected.
    However, I’ve not had much luck with the entry-footer. I moved it to underneath the header as you suggested but this hasn’t made any difference to the layout so I must have done something wrong.
    Also, the entry-footer code seems to include several lines – date and author, plus the category and tags. But I just want to put the date between the headline and the body text so I’m assuming that there must be a different line of code to do that – so I’d appreciate it if you have any further ideas.
    Thanks,
    Nessan

    OK,
    I’ve made some progress but could do with some advice. I have added this line:
    <?php the_date(); ?>
    to the content.php file in Colinear and this has done exactly what I was trying to do in the first place – put the date between the headline and the text. But this didn’t work when I tried to do it in the Colinear-child theme so I’ve obviously missed something in setting up the child theme – but what?
    Any ideas would be appreciated.
    Thanks,
    Nessan

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    @nessan-cleary are you still having troubles here?

    If changes to your child theme aren’t being reflected on the front end of your site, then that’s a definitely sign it isn’t quite set up right.

    Could you paste the contents of your child theme’s functions.php file into a Pastebin and link back to it from here so I can take a look? Thanks!

    Hi Kathryn,
    Thanks for your help. I’ve pasted the functions.php file into Pastebin – here’s the link:

    https://pastebin.com/4jxYHKyk

    The child theme did work in part for me – when I first set it up some of the changes that I had made to the site disappeared so I had to go back and redo them. But the date edit that Siobhan suggested didn’t work so I obviously missed something.
    Anyway, I’d appreciate any suggestions.
    Nessan

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.