Community Forums › Forums › Archived Forums › General Discussion › Conditional Removal of Author on post/page
Tagged: Author
- This topic has 5 replies, 2 voices, and was last updated 10 years, 1 month ago by
Brad Dalton.
-
AuthorPosts
-
February 4, 2013 at 11:37 pm #18149
SMB-dev
MemberWe have just set up new Manhattan Theme for Job site but now the Author Attribute is showing up on Job Postings and we would rather it not. Blog Posts are fine but not here. I have attempted to remove it via the Code Snippets (http://my.studiopress.com/snippets/author-box/) added to the functions.php but that did not do anything.
This is a sample job listing for reference: http://www.strategicrecruitmentsolutions.com/jobs/product-specialistsoftware-business-analyst
Would really appreciate a point in the right direction to remove this from our Job Listings ?
V/r
“Life is Social” & “Social is the Lifeblood” of a Small Business Owner.
February 5, 2013 at 12:34 am #18153Brad Dalton
ParticipantFebruary 5, 2013 at 7:22 am #18185SMB-dev
MemberYes. We have several Recruiters that will be entering jobs data & we don't want the names to show for the job posting. We do want it on Blog Posts though.
“Life is Social” & “Social is the Lifeblood” of a Small Business Owner.
February 5, 2013 at 8:32 am #18204Brad Dalton
Participant/** Customize the post info function */ add_filter( 'genesis_post_info', 'post_info_filter' ); function post_info_filter($post_info) { if ( !is_page() ) { $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_info; }}
You can use this code to remove post info for the author based on conditional statements. You'll need to modify this code. http://codex.wordpress.org/Conditional_Tags
This statement should work for the category jobs or you can use the cat i.d
! in_category( 'jobs' ) )
This tutorial will also help,http://www.briangardner.com/code/customize-post-info/
February 5, 2013 at 11:53 pm #18385SMB-dev
MemberThis is a sticky one: I have tried multiple combinations of:
But cannot get the Author Name removed from just the (jobs) posting pages using any type of conditional statement
! in_category( 'jobs' ) )
if ( !is_page(4) ) {
!is_single( array( 4, 'jobs' ) )
is_single( 'jobs' )
If I use the remove_action - NP it removes all the data from all posts (not what I wanted)
I settled on using:
** Customize the post info function */
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
$post_info = '[post_date][post_comments]';
return $post_info;
}
This way I just removed the names from the top of the Posts and it looks like this retains the count for Archives and retains the Author Box at the bottom of each article. So I think this will work ok.
It's still perplexing me as to why I could not remove just the Author Name from the jobs posts ?
The issue is identifying the Job / Posts...they are not listed anywhere but in the DB. They do not display in the Admin Posts section so I am not sure of the actual post slug id's other than the jobs/xxxxxxx
This is where the data is coming from:
<div class="post-9900 jobman_job type-jobman_job status-publish hentry entry">
<strong>I very much appreciate your assistance<strong>
Thanks
“Life is Social” & “Social is the Lifeblood” of a Small Business Owner.
February 6, 2013 at 1:21 am #18392Brad Dalton
ParticipantYou could have used Genesis Simple Edits for this or Genesis Simple Hooks plugins.
Maybe jobs is a custom post type and not a category.
By the way, your sitemap page looks a but messed up.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.