- This topic has 29 replies, 6 voices, and was last updated 4 years, 1 month ago by Tom.
-
AuthorPosts
-
January 11, 2017 at 9:51 am #263037TomLead DeveloperLead Developer
GP can only control code added by itself – it can’t control text you’ve added manually into the post.
January 11, 2017 at 1:05 pm #263111TimHello Tom,
I think I have been confusing in what I am asking for by manually adding the Author and Date in the post or I miss understand what the PHP code is doing
Here is an unstyled post that might be clearer
http://aaa.greaterthanthesum.com/types-trust-networks/Here is what I want to do
https://nimbus.everhelper.me/client/notes/share/719865/9gurmklveg8af9f4nqs9
https://nimbus.everhelper.me/client/notes/share/719882/skg1nkun65qaxmfvqkvwIs this what the PHP code does? If so it is not working
Thanks
January 11, 2017 at 7:55 pm #263187TomLead DeveloperLead DeveloperThat un-styled post helps.
So, this function is currently active on your website?: https://gist.github.com/generatepress/cf95fae85d5e7773d97a
How are you adding it?
January 12, 2017 at 10:31 am #263443TimMy fault, did not realize I had to activate “Code Snippet” snippet, it’s working now
Thanks
January 12, 2017 at 12:21 pm #263492TomLead DeveloperLead DeveloperYou’re welcome π
February 15, 2020 at 12:48 am #1165917MilosHi Tom, when i want to activate this code, i see this message:
Cannot redeclare function generate_entry_meta.
I use this code https://gist.github.com/generatepress/cf95fae85d5e7773d97a
Can you help me? Thanks
February 15, 2020 at 9:16 am #1166355TomLead DeveloperLead DeveloperHi there,
There’s an easier way to do it now:
add_filter( 'generate_header_entry_meta_items', '__return_empty_array' ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array( 'date', 'author', 'categories', 'tags', 'comments-link', 'post-navigation', ); } );
Let me know π
March 1, 2020 at 7:04 am #1181422MilosThanks Tom. When I activate this code, meta data are in the bottom – thats ok, but in header under title I have an error:
Warning: Invalid argument supplied for foreach() in …wp-content/themes/generatepress/inc/structure/post-meta.php on line 279
March 2, 2020 at 12:17 am #1181913TomLead DeveloperLead DeveloperHi there,
Can you try the updated code?: https://generatepress.com/forums/topic/move-author-date-to-the-bottom-after-content/page/2/#post-1166355
Let me know π
March 3, 2020 at 11:51 am #1183938MilosHi Tom, now it is better, but the date and author is not in the line, can you fix it?
And second problem, after I activate this code, on archive post date and author is missing π Its possible make changes only on post page and let the others as it was?
March 3, 2020 at 5:36 pm #1184193TomLead DeveloperLead DeveloperCan you link me to the post where they’re not in line?
For the second question, try updating the code to this:
add_action( 'wp', function() { if ( is_single() ) { add_filter( 'generate_header_entry_meta_items', '__return_empty_array' ); add_filter( 'generate_footer_entry_meta_items', function( $items ) { return array( 'date', 'author', 'categories', 'tags', 'comments-link', 'post-navigation', ); } ); } } );
March 4, 2020 at 12:09 am #1184346MilosFor example in this article: https://www.autovylet.cz/dovolena-v-polsku-u-baltskeho-more/
March 4, 2020 at 8:29 am #1184950TomLead DeveloperLead DeveloperTry this CSS:
footer.entry-meta .byline, footer.entry-meta .posted-on { display: inline-block; }
March 4, 2020 at 11:20 am #1185135MilosNow its ok, thanks.
March 4, 2020 at 7:34 pm #1185395TomLead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.