Community Forums › Forums › Archived Forums › General Discussion › How to display Edit button on each page when logged in?
- This topic has 18 replies, 2 voices, and was last updated 10 years, 4 months ago by jenniferpinkley.
-
AuthorPosts
-
November 16, 2013 at 2:54 pm #73453jenniferpinkleyParticipant
Hi, I use the Lifestyle theme on two sites, and when I'm logged in, I have an Edit link on each page and blog post. One a third site (http://www.scci.org) there is not an Edit link when I'm logged in. This particular site is very large and I would like that link to display to make it easier to edit. Can someone help me figure out why the link isn't showing up?
http://www.scci.orgNovember 16, 2013 at 11:03 pm #73512nutsandboltsMemberCheck functions.php for this:
add_filter ( 'genesis_edit_post_link' , '__return_false' );
If it's there, remove it and the edit link should come back. If it's not there, you can add this to functions to make the edit link show up:
// Show the edit button function include_post_edit_button() { if ( is_single()) echo edit_post_link(‘[edit page]‘); } add_action(‘genesis_after_loop’, ‘include_page_edit_button’, 1);
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 9, 2013 at 9:14 am #77830jenniferpinkleyParticipantHi, thanks for the suggestion. I finally had time to try this. I didn't have the add_filter line, so I added the code and it created the following error for my entire site:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Any other suggestions? Thanks!
December 9, 2013 at 10:26 am #77843nutsandboltsMemberThat's odd. If anything, it would have thrown a fatal PHP error (which shouldn't happen either) - usually an internal server error is hosting related. Have you contacted your host's tech support to try to get the site back up?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 9, 2013 at 12:05 pm #77859jenniferpinkleyParticipantAfter I initially saw the error, I took out the code and resaved the functions.php file in its original form. When i refreshed the pages they then seemed to work again. But now I'm also seeing in internal server error again. What could I have done to cause this? It's too much of a coincidence that i happen to edit a php file for the first time and the site breaks. This is hosted on iPage and I haven't been real impressed with them, I'm not a programmer so I don't know what else could cause this.
December 9, 2013 at 3:01 pm #77878jenniferpinkleyParticipantI finally managed to get the site working again and tried again to insert that code. The code is what was causing the internal server error, there is evidently something wrong with the syntax. When I finally figured out how to look at the error logs, the error is listed as:
20131209T132719: scciorg.ipage.com/wp_1212/wp-admin/admin-ajax.php
PHP Parse error: syntax error, unexpected '[' in /wp-content/themes/lifestyle/functions.php on line 156I just stuck it at the end of the file, should it be in a specific location?
December 9, 2013 at 3:07 pm #77880nutsandboltsMemberThere was actually an error in the code I posted before. I know this one looks almost identical, but try copying and pasting this one instead. It works on a test site for me with no errors:
// Show the edit button add_action(‘genesis_after_loop’, ‘include_page_edit_button’, 1); function include_post_edit_button() { if ( is_single()) echo edit_post_link('[edit page];'); }
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 9, 2013 at 4:51 pm #77905jenniferpinkleyParticipantI tried that and it didn't add the Edit button.
December 9, 2013 at 4:51 pm #77907nutsandboltsMemberAre you using the Simple Edits plugin by chance?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 9, 2013 at 4:53 pm #77909jenniferpinkleyParticipantYes
December 9, 2013 at 4:54 pm #77910nutsandboltsMemberWhat's in your post info box under Simple Edits?
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 9, 2013 at 4:56 pm #77911jenniferpinkleyParticipantI think this is what you're asking about, it's in the first field when I click Simple Edits:
[post_date] By [post_author_posts_link] [post_comments] [post_edit]
December 12, 2013 at 1:03 pm #78579jenniferpinkleyParticipantAny more ideas about how to display the Edit link?
December 12, 2013 at 1:44 pm #78588nutsandboltsMemberDo you have the WordPress admin bar visible when you're viewing the front end of the site? If so, it should have an Edit Post button. I know that's not exactly what you're looking for but it achieves the same goal.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 12, 2013 at 2:34 pm #78606jenniferpinkleyParticipantNo, I actually don't see the admin bar at the top of the screen either. That's the problem, there's no easy way to edit a page except to go to the dashboard and search for a page. If I could get the admin bar to display that would be fine too.
December 12, 2013 at 2:35 pm #78607nutsandboltsMemberLook in Users > Your Profile to see if the box is checked to Show Toolbar When Visiting Site.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 12, 2013 at 2:40 pm #78612jenniferpinkleyParticipantYes that is turned on.
December 12, 2013 at 2:41 pm #78614nutsandboltsMemberHmm, that's very strange. Almost makes me wonder if you've got a plugin or something overriding the edit links.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+December 12, 2013 at 2:58 pm #78628jenniferpinkleyParticipantI've had some weird problems with this site. I just turned off all of my plugins and the admin bar/edit link still doesn't display. Thanks for your help anyway, I guess I'll just go through the dashboard for edits.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.