Community Forums › Forums › Archived Forums › Design Tips and Tricks › Open Read More in a new tab News Pro Theme
- This topic has 28 replies, 2 voices, and was last updated 9 years, 10 months ago by
Erik D. Slater.
-
AuthorPosts
-
June 12, 2015 at 1:13 pm #156003
CDM
MemberI understand bout the dynamically realated files warning. But it's the syntax error that has me stumped
Thanks
I really appreciate your time
CD
June 12, 2015 at 1:36 pm #156005Erik D. Slater
MemberBy all means, send me your functions.php file to [email protected] and I can take a little looksy.
You may want to start Googling for a solution to that error message though ... since the code I provided doesn't do anything complex or file-related ... it simply returns a line of text a-la HTML 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 12, 2015 at 1:53 pm #156009CDM
MemberWow.. This time when I pasted it from your original I didn't get an error message!!! Okay.. I'm going to try it again.. with "Read more..."
add_filter('excerpt_more', 'eds_excerpt_more', 10, 1);
function eds_excerpt_more($more) {
return 'Read more...';
}June 12, 2015 at 3:10 pm #156014Erik D. Slater
MemberWell, I can tell you that the problem you had was likely related to Dreamweaver ... since the file you sent me looks absolutely fine 🙂
When testing the code, don't forget to set the Content Type to Show Excerpt.
Erik D. Slater: Digital Platform Consultant • LinkedInJune 12, 2015 at 10:36 pm #156053Erik D. Slater
MemberSooo ... it turns out you're actually using the Genesis - Featured Page widget ... not the Genesis - Featured Posts widget!! Oh yes ... it makes a difference 🙂
The best solution I have for you there is the following:
add_filter('the_content_limit', 'eds_the_content_limit', 10, 1); function eds_the_content_limit($content) { return str_replace('class="more-link"', 'class="more-link" target="_blank"', $content); }
I'm not sure I like this solution because it will be applied to all cases where you choose to display content with a content limit, i.e. the Featured Posts and Featured Page widgets, as well as the regular blog listing.
But ... it definitely works 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 12, 2015 at 10:59 pm #156055Erik D. Slater
MemberNow ... on a more design-centric philosophical note - which I deliberately ignored here because I like to try to solve the problem in hand without questioning an OP's intentions - I generally advise against the forcing of opening same-site links in a new tab or window. Clearly, the Genesis widgets were written in such a way that they don't facilitate the feature at all ... and there is a good reason for that.
As mobile usage outstrips desktop, a user's experience may be affected as they go through multiple pages on a single site. If a new window is forced upon them in their browser app, it could lead to some performance and usability issues. On desktop though, it is generally annoying when pages within the same website don't open in the same tab/window ... unless the user chooses to do so.
The general rule with any website is to make that emotional connection with your visitors. Nobody cares about the life or journey of an author unless there is some kind of empathy. Priority should always be given to the user journey.
For external links, I personally have no issues with forcing the opening of a new tab/window ... since it is a different website ... and responsibility passes to the new location. But for internal links - despite my contributions here - I think this entire thread is moot 🙂
Erik D. Slater: Digital Platform Consultant • LinkedInJune 13, 2015 at 10:38 am #156100CDM
MemberAh... excellent point!!! about the mobility issues. I hadn't thought about that.. Thanks so much for your help and time Erik.
CD
June 13, 2015 at 11:58 am #156108CDM
MemberIT WORKS!!!!! Yay!!!! Thanks so very much.. I tested it on my dev site after I found it worked on my scrap site. I'll send you an email with the link
CD
June 13, 2015 at 12:52 pm #156118Erik D. Slater
Member -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.