Community Forums › Forums › Archived Forums › Design Tips and Tricks › Post Excerpt Official Code Giving Fatal Php error
Tagged: post excerpts, read more
- This topic has 9 replies, 4 voices, and was last updated 12 years ago by
Susan.
-
AuthorPosts
-
March 20, 2013 at 4:11 am #29647
mohsin
MemberHi,
I wanted to change the "[Read More...]" text ....
From this page:
I used this filter...
** Modify the Genesis content limit read more link */
add_filter( 'get_the_content_more_link', 'custom_read_more_link' );
function custom_read_more_link() {
return '... [Continue Reading]';
}
But this filter gives PHP error...
What could be the issue?
I could solve this by remove read more and adding my own read more text...
but i thought i should post here as this is official code which may need some fix to make it work with latest GENESIS ?
or i am missing something?Thanks for your support and time in advance. 🙂
Mohsin
March 20, 2013 at 5:38 am #29651Brad Dalton
ParticipantYou have modified the code incorrectly.
Can you link to your site please.
March 20, 2013 at 6:41 am #29663mohsin
MemberHi Brad,
Thanks for your reply. Sorry site is not live yet.
I have not modified the code. I am using the code as it is from this page:
Still giving me error!
Parse error: syntax error, unexpected T_STRING
March 20, 2013 at 6:56 am #29667Brad Dalton
ParticipantWhat theme are you using and where did you paste the code?
Are you referring to this code?
/** Modify the WordPress read more link */ add_filter( 'the_content_more_link', 'custom_read_more_link' ); function custom_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>'; }
March 23, 2013 at 10:23 am #30708mohsin
MemberHi Brad,
Thanks for your response. Sorry for the delayed response. I am Using Minimum theme and i putting this code in functions file.
No, not that code, but the code behind that block, means second block...
/** Modify the Genesis content limit read more link */
add_filter( 'get_the_content_more_link', 'custom_read_more_link' );
function custom_read_more_link() {
return '... [Continue Reading]';
}March 23, 2013 at 11:21 pm #30828Brad Dalton
ParticipantApril 6, 2013 at 11:06 pm #33651Carla the Moose
MemberI just submitted a help ticket for this same problem.
I pasted the code from the Code Snippets page into my child functions file. My dashboard turned white, as did my website. No error codes, but clearly there's an error.
All I did was remove the brackets on this: [Continue reading]
I wanted to resurrect this thread and will post back when support responds to my ticket with a solution. I can't access my website at all. I'm guessing the fix will involve accessing the child functions file via FTP, but I've only ever used Cpanel and have no clue how to do that.
I mentioned in the ticket that there needs to be instructions on how to use this code.
April 7, 2013 at 7:14 am #33678Susan
ModeratorCeeKing - it's not recommended that you "resurrect" a thread - you are less likely to have someone catch it as an update, as it doesn't show as a new thread.
To access your site via FTP, use these instructions by Nick The Geek . If you are only familiar with doing it by Cpanel, you can still fix the error by uploading a fresh PHP file, and replacing the one currently in your theme folder.
April 7, 2013 at 12:43 pm #33756Carla the Moose
MemberThanks, Susan. Other forums really jump on people when new threads are started for topics that have been recently addressed. But I'm glad to know that I can just start a new one here. I wasn't posting here for help, but just wanted to follow up and offer a solution once I learned how to fix this problem.
Support sent me that same link you gave me. It was very straight forward. I downloaded FileZilla for free, logged in to my Synthesis account and obtained my FTP username, password, and domain, and was up and running quickly. It was easy finding the child file, so I deleted the code in functions.php that caused the problem, uploaded it, and the problem was fixed.
But I feel that the Code Snippet page needs to provide some instructions. Like the OP, I simply pasted the code into the file, and suddenly my entire dashboard and website shut down. The changes I made weren't the cause of the problem, so it may be a matter of where I pasted the code. PHP is very finicky.
Hopefully this will help someone who searches for some help and finds this thread. I came here for help, but found an incomplete thread.
April 7, 2013 at 1:41 pm #33768Susan
ModeratorThanks, CeeKing for posting back. The reason we ask people to start another thread is because it's a community forum, there may be a number of people looking for threads to help people, and we search for "Threads with No Reply", so if someone adds a new question or update to an existing thread, it might be missed.
In many cases with valid code snippets, the issue with how people copy and paste the code  - ' (quotation marks) for example, have a nasty habit of turning from straight to "curly" without anyone noticing, and that can be a BIG issue.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.