Styling blog post page

Hello,

Please reference a post I had made a few weeks back (commenting close on that topic so I opened a new one).

Summary: Changing location of meta data on blog posts by making changes to wp-sidebar.php and _content-post-header.php under the child theme.

My goal is to remove the the meta data from under the blog title and have the following outline for the blog post pages:

On the left are social icons, in the middle the blog post, and on the right the author details and meta data.

I wanted to reattempt this but editing the files mentioned above under the child theme has no effect. Could it be due to something new with the Gutenberg editor?

Any advice would very much appreciated!

Hi @ayham,

Thanks for reaching out.

Gutenberg should have no effect since it’s directly added to templates. May I know what editing you’re applying to the templates? It should work as how the post meta are working.

Perhaps it’s related to && !is_page(array(123, 456))? Because that means you’re only applying it on two specific pages and changes will not appear on other pages.

Cheers!

Thanks for getting back soon on this!

The editing is in regard to this line of code

<?php x_renew_entry_meta(); ?>

which I remove from _content-post-header.php and put in wp-sidebar.php, both under the child theme.
My goal is to remove the meta data from under the title of a blog post page so that I can place it in a side bar. However there seems to be no effect when I do the change described.

Any ideas? “Post Meta” is turned on under ‘Theme Options --> Blog’ in Pro editor.

Thanks!

Hi @ayham,

You mean the meta isn’t disappearing under the title? But it works okay when placed on sidebar?

Would you mind providing the site’s URL and admin login credentials so I could check? Make sure the child theme is active too.

Thanks!

Hello!

I feel a bit uneasy about providing credentials.

To answer your question. No. It does not work. There seems to be no effect when I edit those files. Any ideas why that could be?

Thank you!

Here’s a little update.

  1. I was able to remove the meta data from under the header using the following in the global CSS in pro

.single-post .p-meta {display: none;}

Though I would still prefer to be able to achieve the same through editing the php files. That’s better for site performance/speed right?

To be clear, by meta data I mean ‘Author / date / category / leave a comment’

  1. I observed that the right sidebar does not appear on all blog posts. To test I entered ‘recent comments’ into the ‘blog sidebar’ sidebar from the widget area under admin and the recent comments only appear on only some of the blog posts, not all. I don’t know why but my guess would be that the sidebar is not active on a blog post if it had been edited in pro. Could this be?

Thanks!

Hi @ayham,

Unfortunately, we could only provide a further recommendation after we gather more information about the issue you’re getting. For that, I recommend contacting a developer and provide them with the procedures so they could implement and troubleshoot it. It’s more related on customization which we can’t really cover here in the forum.

Thanks!

I understand.

One last question. Other than wp-sidebar.php is there another file I may need to experiment with to place the post meta in the sidebar?

Thank you.

Hello Ayham,

It should be just the wp-sidebar.php that you will need to edit if you want to further customize the file contents.

You can them make use of the Unlimited Sidebar feature in case you want to use different sidebars on your site.

Hope this helps.

Hello

One last note on this. If I make the changes described above, basically:

<?php x_renew_entry_meta(); ?>

which I remove from _content-post-header.php and put in wp-sidebar.php

but in the main theme (instead of the child theme), it works. I cleared the cache and that’s not the problem. What could be the reason the child theme is not taking the change? There are other functions I add to functions.php in the child theme that work.

Thanks!

I just tried inserting <?php x_renew_entry_meta(); ?> in the child theme’s wp-sidebar.php and it works. Ensure that the folder structure is correct.

Thanks.

That was it! It works. My file structure was wrong. Thank you for pointing this out. I appreciate you taking the time to try and respond.

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.