fabian.schmid
Member
Posted 1 year ago #
I've put the the_meta-tag (custom fields) in my index-file of the WordPress installation. But I do not want to display the custom fields on static pages, but only on posts of my blog. I'm searching a function that distinguishes between a page (like impressum e.g.) and a post (like this is my first post, welcome to my blog e.g.). Can someone help me?
Thanks in advance...
fabian.schmid
Member
Posted 1 year ago #
I thougt it was this function firstly, but I tried it and it didn't work
<?php if(!is_page()){
the_meta();
} ?>
Can you help me?
That should work. What happens? Do you definitely have something in the custom fields for the post? Test it with:
<?php if ( !is_page() ) { echo '<p>Not a Page!</p>'; } ?>
fabian.schmid
Member
Posted 1 year ago #
The custom fields are displayed on every post and on every page too, but since they're empty in the page-pages, there are only the bullets (because it's structured with ul and li...
And thanks for the hint I'm gonna test it when I'm at home...
fabian.schmid
Member
Posted 1 year ago #
Oh how dumd I am! I've put the_meta(); in sinlge.php and page.php with the built in theme editor and in index.php.
I'm sorry for your effort...
Can you mark this post as resolved then, please?