Forum Replies Created
-
AuthorPosts
-
March 22, 2017 at 8:42 pm in reply to: How to sync up the Screen Name throughout the website #203689
riseUp
MemberHi Victor,
So, I'm been trying some code based upon your recommendation, and this is what I attempted, but this does not work. I've tried some variations of this:
function get_comment_author( $comment_ID = 0 ) {
$comment = get_comment( $comment_ID );
if ( empty($comment->comment_author) ) {
if (!empty($comment->user_id)){
$user=get_userdata($comment->user_id);
$author=$user->user_login;
} else {
$author = __('Anonymous');
}
} else {
$author = $comment->comment_author;
}
return apply_filters('get_comment_author', $author);
}Can you assist in the above set of code by any chance?
riseUp
MemberThat was easy. Thanks Victor!
March 20, 2017 at 8:14 pm in reply to: Date and time on the comments section of the post is incorrect #203516riseUp
MemberI'll definitely take a look at this. Thank you!
December 6, 2016 at 10:23 pm in reply to: How to place comment area before comments rather than after comments #197153riseUp
MemberThank you, Victor!
August 24, 2016 at 5:08 am in reply to: How to list all Categories and Sub-Categories onto a page #191936riseUp
MemberOh - sorry about that. I will check again. Thanks always!
August 23, 2016 at 8:42 pm in reply to: How to list all Categories and Sub-Categories onto a page #191930riseUp
MemberHi @braddalton,
On the Category Page, I wanted to list out all the parent and sub categories on the one page.
Thanks.
August 12, 2016 at 7:04 pm in reply to: How to limit characters when Display = Entry Excerpts #191202riseUp
MemberOpps. Thank you.
I was able to delete 1 of them.
When I saved, however, the excerpt does not fall within the number of characters....in this case, 49.
//* Modify the length of post excerpts
add_filter( 'excerpt_length', 'sp_excerpt_length' );
function sp_excerpt_length( $length ) {
return 49; //* pull first 50 words
}For some strange reason, the code is not applying to the homepage post excerpt.
I made sure to go to Genesis --> Theme Settings --> Content Archives --> Display: Entry Excerpts
Any thoughts on this? Thank you!
August 12, 2016 at 5:34 pm in reply to: How to limit characters when Display = Entry Excerpts #191197riseUp
MemberHello StudioPress community.
When I copy and pasted the following code into functions.php:
//* Modify the length of post excerpts
add_filter( 'excerpt_length', 'sp_excerpt_length' );
function sp_excerpt_length( $length ) {
return 10; //* pull first 50 words
}...the following fatal error continues to display:
Fatal error: Cannot redeclare sp_excerpt_length() (previously declared in /home/content/p3pnexwpnas06_data03/32/3122732/html/wp-content/themes/streamline-pro/functions.php:104) in /home/content/p3pnexwpnas06_data03/32/3122732/html/wp-content/themes/streamline-pro/functions.php on line 163
Can somebody advise on how to fix this error? Thank you.
riseUp
MemberHello,
Yes, I have done less than 50 characters such as 49 and 10. Yet, still, no changes to the output.
I"m wondering if there is a setting that is preventing me from changing the number of characters the excerpt can display. I'm puzzled because this is a simple function but no changes. Still would like some assistance on this one...
Thanks!
//* Modify the length of post excerpts
add_filter( 'excerpt_length', 'sp_excerpt_length' );
function sp_excerpt_length( $length ) {
return 10; //* pull first 50 words
}riseUp
MemberThat's strange.
I copied and pasted the following into functions.php but no impact...
//* Modify the length of post excerpts
add_filter( 'excerpt_length', 'sp_excerpt_length' );
function sp_excerpt_length( $length ) {
return 100; //* pull first 50 words
}Am I missing something here? Thanks.
July 21, 2016 at 10:08 pm in reply to: Alternative option on genesis_entry_footer Simple Hook #189988riseUp
MemberAll,
The City displayed for joyeagles7890 is Albia. Albia is showing correctly at the bottom of the post. The issue I'm still having is that Albia is not showing on the homepage for the post.
Mike Smith 23 is Beaverton which is right on the bottom of the post. However, the issue I'm having is that Beaverton is not showing on the homepage for the post.
I have tried this:
<?php if( is_home() ) { ?>
[frm-field-value field_id= 145 user_id="[95 show=ID]
<?php } ?>But I may need a tweak to allow the City result to be displayed on the homepage.
Thank you for your assistance.
July 21, 2016 at 9:23 pm in reply to: Alternative option on genesis_entry_footer Simple Hook #189985riseUp
MemberHello everybody.
Here is the latest. I added the following shortcode into the genesis_entry_footer hook....and the City was able to be displayed at the bottom of each post on the homepage. However, user [email protected] indicated Albia as the city but the homepage post for [email protected] lists Beaverton. It looks as if the following code in the genesis_entry_footer hook displays mike smith23's city selection.
<?php if( is_front_page() ) { ?>
[frm-field-value field_id= 145 user_id="[95 show=ID]
<?php } ?>Can somebody advise on how I can tweak the above php code to ensure that the city that a user selects displays that city for his/her post and not to be included in another user's post? Thank you.
July 21, 2016 at 4:47 pm in reply to: Alternative option on genesis_entry_footer Simple Hook #189970riseUp
MemberHi Genesis Developer,
When I copied and pasted your code to my functions.php, it didn't work. The horizontal line and location field did not display on the homepage for each post. Any other thoughts? Thank you.
July 21, 2016 at 5:31 am in reply to: Alternative option on genesis_entry_footer Simple Hook #189896riseUp
MemberHi @BradDalton, thank you for your response.
I was looking at option 2....how does this look?
//* Customize the entry meta in the entry footer (requires HTML5 theme support)
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
$post_meta = '[post_categories] [post_tags]';
return $post_meta;if ( is_front_page() ) {
echo do_shortcode('[frm-field-value field_id=145 user_id="[q38d7 show=ID]"]');
}
}Do I put this piece of code within the genesis_entry_footer hook area or place this in functions.php? I tried both but the horizontal line and Location: field is not displaying on each post (bottom of post) on the homepage. Thank you.
Moses
June 22, 2016 at 8:48 pm in reply to: How to display City and State via Meta fields on homepage posts #188082riseUp
MemberThanks for the feedback on this.
The following works well for the state of Alabama. alabama, with a small a, is the custom field that provides the listing of cities in Alabama.
echo get_post_meta($postid, 'alabama', true);
echo ", Alabama";
wp_reset_query();However, I am trying to figure out how to add other states like Alaska so I tried something like this:
<?php
if echo get_post_meta($postid, 'Alabama', true) {
echo ", Alabama";
} else {
if (echo get_post_meta($postid, 'Alaska', true) {
echo ", Alaska";
}
?>However, this code doesn't seem to work, especially with if else statements which I'm trying to resolve.
Could you advise on how to use an if - else statement to accommodate other states like Alaska and Arkansas, etc?
Thank you!
June 19, 2016 at 6:12 am in reply to: How to display City and State via Meta fields on homepage posts #187838riseUp
MemberHi. Sorry, but I am not understanding the context.
June 13, 2016 at 10:37 am in reply to: Can't seem to figure out how to remove 2 column format #187481riseUp
MemberThank you!
riseUp
MemberThank you!
riseUp
MemberHello Victor Font,
Thank you. That worked!
May I ask you a follow-up question? With the following code (which works), how does the linked website become its own tab in a browser? Currently, the link flips to the linked website. It would be nice for the linked website to become another tab rather than in it's own window.
Thank you.
May 29, 2016 at 8:44 pm in reply to: How to display meta tags and key/value only on posts and not pages #186485riseUp
MemberLooks like the following allowed me to resolve this thread:
<?php
if(is_page() == false):
echo '<hr />';
echo "Location: ";global $wp_query;
$postid = $wp_query->post->ID;
echo get_post_meta($postid, 'nearest_metro_city', true);
wp_reset_query();
endif;?>
Thank you!
-
AuthorPosts