Forum Replies Created
-
AuthorPosts
-
September 6, 2018 at 12:28 pm in reply to: How to display author name only on posts from specific categories #223021
swann83
MemberOk, I wrote this and it works.
add_filter( 'genesis_post_info', 'post_info_filter' ); function post_info_filter($post_info) { if ( in_category( array( 10,2640,4678,7084 ) ) AND ( is_single() ) ) { $post_info = 'di <em>[post_author]</em> <br/> [post_date] [post_comments] [post_edit]'; } else { $post_info = '[post_date] [post_comments] [post_edit]'; } return $post_info; }
Thank you so much for your time, braddalton.
Swann.
September 6, 2018 at 10:18 am in reply to: How to display author name only on posts from specific categories #223016swann83
MemberThank you, braddalton. I appreciate it.
I'm sorry my English isn't good enough. I haven't been able to make it quite clear that I have very limited technical knowledge. I'm fairly satisfied with the current configuration, but it would be best if I could display the entry meta with authors name on single posts only (from those categories) and the standard entry meta without authors name (only date, comments and edit) in the entry header, including front and blog pages.
Thanks,
Swann
September 6, 2018 at 6:24 am in reply to: How to display author name only on posts from specific categories #223008swann83
MemberSorry, how do I do that? The first method seems to be fine.
add_filter( 'genesis_post_info', 'post_info_filter' ); function post_info_filter($post_info) { if ( in_category( array( 10,2640,4678,7084 ) ) ) { $post_info = 'di <em>[post_author]</em> <br/> [post_date] [post_comments] [post_edit]'; return $post_info; } else { $post_info = '[post_date] [post_comments] [post_edit]'; return $post_info; } }
I just want the author name not to be visible in the homepage.
Thanks.
September 6, 2018 at 6:08 am in reply to: How to display author name only on posts from specific categories #223006September 6, 2018 at 5:03 am in reply to: How to display author name only on posts from specific categories #223002swann83
MemberGreat! It works.
What can I do to keep only author name from being displayed in excerpts in the homepage? I want to display it just in the single post view.
Thanks,
Swann
September 6, 2018 at 3:05 am in reply to: How to display author name only on posts from specific categories #222994swann83
MemberOk, it works only if I declare it once. If I use both of these codes then an error occurs: Cannot redeclare post_info_filter() (previously declared in....
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] [post_comments] [post_edit]';
return $post_info;
}add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {if ( in_category('f1') ) {
$post_info = '[post_author] [post_date] [post_comments] [post_edit]';
return $post_info;
}}
As I said I need [post_date] + [post_comments] + [post_edit] to be displayed in all categories and posts, by default, and also [post_author] in all posts from only two categories (F1 and News). And by the way, I need that info (post author) to be displayed just in the default output of single posts, not visible below the excerpts in the homepage.
Thanks,
Swann
September 5, 2018 at 7:57 am in reply to: How to display author name only on posts from specific categories #222946swann83
MemberI have Simple Hooks, that is very important for my site. Is it creating conflicts? How can I solve them?
September 5, 2018 at 7:00 am in reply to: How to display author name only on posts from specific categories #222943swann83
MemberUnfortunately, it doesn't work:
add_filter( 'genesis_post_info', 'post_info_filter' );
if ( in_category('f1') ) {
$post_info = '[post_author] [post_date] [post_comments] [post_edit]';
return $post_info;
}Any idea what I'm doing wrong here?
Thanks.
September 4, 2018 at 12:15 pm in reply to: How to display author name only on posts from specific categories #222929swann83
MemberYes, thank you.
This is exactly my customization in my theme’s functions.php file:
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date] [post_comments] [post_edit]';
return $post_info;
}I've tried to add this ("f1" is the category whose posts I want the author name to be displayed in) but it doesn't work:
add_filter( 'genesis_post_info', 'post_info_filter' );
if ( is_category('f1') ) {
$post_info = '[post_author] [post_date] [post_comments] [post_edit]';
return $post_info;
}I'm not sure I'm good enough to use conditional tags but anyway I don't know if it could work for my purpose (I want author name not to be displayed in the homepage, above excerpts, but just in the single post).
Thanks.
April 14, 2017 at 12:08 am in reply to: How can I manually change posts order in my homepage? #204769swann83
MemberThat drag & drop feature actually exists in "Post Types Order" plugin, but it doesn't seem to work with Genesis.
April 13, 2017 at 3:31 am in reply to: How can I manually change posts order in my homepage? #204721swann83
MemberThank you for the answer. Well, I don't need a different sorts parameter. I just need a kind of drag and drop feature to re-order my posts arrangement day by day, without changing date – 'cause this would change permalink and produce lost pages and disadvantage in organic search results. I remember a drag and drop feature like that, used in newspaper magazine website (built in WP) I worked for.
-
AuthorPosts