Community Forums › Forums › Archived Forums › General Discussion › Featured Widget Amplified help
Tagged: featured widget amplified, genesis, plugin, widget
- This topic has 37 replies, 2 voices, and was last updated 11 years, 3 months ago by nickthegeek.
-
AuthorPosts
-
November 20, 2012 at 3:31 pm #945JeffreyMember
Is there a way to put "Leave a comment" and "read more" in the same section of the widget. The default "read more" area is in the post title section and the default "comments" location is the post meta. Is there a way to merge them -- or maybe to call the "read more" link to the post meta section?
Thanks so much!
November 20, 2012 at 8:16 pm #1024nickthegeekMemberJeff, There really isn't a simple way to do that. The issue is that the read more is part of the content output, so you would need to make your own custom content and a custom short code to output the more link in the post meta section.
November 20, 2012 at 8:21 pm #1030JeffreyMemberThanks for the reply Nick.
Well, is there an easier way to display the "comments" link in the content section with the "read more", instead of the aforementioned vice versa?
November 21, 2012 at 8:46 am #1112nickthegeekMemberNot really, both require replacing the plugin content output with your own custom output.
November 21, 2012 at 3:40 pm #1188JeffreyMembergotcha nick. is there anyway you could help me with that custom output? is it a big ordeal?
November 23, 2012 at 10:38 am #1373nickthegeekMemberJeffery,
I don't have the code for that written up.
November 26, 2012 at 5:57 pm #1781JeffreyMemberNick, thanks for getting back to me over the holiday weekend. Is that easy code to write up? If not, do you know of a widget or plugin that already has this built in (though i need to maintain the post offset functionality).
November 26, 2012 at 8:06 pm #1798nickthegeekMemberJeffery,
It isn't super hard, it can be done via the hooks system built into the plugin. I'm not aware of one that does this already.
November 26, 2012 at 9:21 pm #1808JeffreyMemberDo you have any help on how to use the hooks system to accomplish this?
Thanks a ton for your help Nick! If I can pull this off the site will be done! Yay!
November 28, 2012 at 4:05 pm #2144JeffreyMemberAny word Nick?
November 28, 2012 at 4:25 pm #2148nickthegeekMemberI do not have any detailed tutorial. The information on hooks in my Genesis Explained series will apply here as well.
November 28, 2012 at 7:34 pm #2196JeffreyMemberI'm really trying hard to wrap this up. Just don't have much experience writing in short codes or hooks. Would something like this work - http://www.billerickson.net/code/add-read-more-to-display-posts-shortcode/ ? If so, can you post any modifications you see that I would need to make to that coded to be able to use a [read_more] short code in the widget post meta section?
November 28, 2012 at 7:56 pm #2198JeffreyMemberI tried this code in functions.php but I'm getting a parse error. Any ideas?
function read_more() {
if (have_posts()) :
while (have_posts()) : the_post();
$return_string = '<a href='.get_permalink($post->ID).'>'.get_the_title().'</a>';
endwhile;
endif;
return $return_string;
}function register_shortcodes() {
add_shortcode( 'read-more', 'read_more_function');
}November 29, 2012 at 9:31 pm #2454nickthegeekMemberI see directional quotes, I don't know if that is formatting from the forum or the coded you added.
function read_more() {
global $post;
$return_string = 'ID).'">'.get_the_title().'';
return $return_string;
}
add_shortcode( 'read-more', 'read_more_function');
November 30, 2012 at 4:32 pm #2662JeffreyMembercopied ur code exactly and pasted it like this Nick:
/** Add read more shortcode */
function read_more() {
global $post;
$return_string = 'ID).'">'.get_the_title().'';
return $return_string;
}
add_shortcode( 'read-more', 'read_more_function');
I get the following error:
Parse error: syntax error, unexpected '=' in /home/content/J/S/D/JSDavis82/html/wood/wp-content/themes/magazine/functions.php on line 97
November 30, 2012 at 4:38 pm #2667JeffreyMembershit, the forum is effing with the code i'm posting, but the top code quote in that last one was the exact code you posted, so disregard the way it is converting the characters.
November 30, 2012 at 6:55 pm #2699nickthegeekMemberI don't see a problem with that code, it could be the way it was added to the functions.php file.
December 3, 2012 at 4:33 pm #3151JeffreyMemberthanks for replying Nick, sorry for my delay. how could it be a problem with how it's added to functions.php? how should it be added?
December 3, 2012 at 6:11 pm #3165nickthegeekMemberGenerally at the very end so it isn't interfering with any other code.
December 3, 2012 at 7:59 pm #3177JeffreyMemberthanks nick. Just tried putting it at the bottom and got this error:
Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /home/content/J/S/D/JSDavis82/html/wood/wp-content/themes/magazine/functions.php on line 144
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.