Community Forums › Forums › Archived Forums › Design Tips and Tricks › Change Shortcode Output
Tagged: .post-info, post meta, shortcode, shortcodes
- This topic has 10 replies, 2 voices, and was last updated 10 years, 8 months ago by
Hashim.
-
AuthorPosts
-
July 12, 2014 at 7:17 pm #114087
Hashim
MemberHi there,
First of all, thank you for all your contributions on this Community Forum. I know that you're doing it voluntarily and I really appreciate the time and effort you put into helping others.
This one might be a little tricky... (Or maybe it just looks tricky to me)
I'd like to change what is being shown in the Post Info and the Post Meta. Genesis Simple Edits is a great plugin. The only problem is that I don't know any code. And the shortcodes provided are really helpful. But I'd like to see some small changes.
For instance, right now in the Post Info before the name of the author it says: 'By'. How do I change that into 'From' or 'Author:'? Is there a way to adjust the shortcode so that the output is changed?
And in the Post Meta it says 'Filed Under:' before the category name. How do I change that into 'Category:' or 'Section:' or anything else. And the same goes for 'Tagged With:' before the names of the tags.
And this one may be the hardest...
How do I change the way the date is shown? From what I understand is that the date is taken from the WordPress settings under Date Format in General Settings. The problem is that when I want the name of the month to be shown completely, it shows in English. How can I change that to the name of the month being shown in another language?
Thank you in advance! I'm looking forward to your amazing solutions!
Sincerely,
Hashim Naushahi
http://hashimnaushahi.comJuly 12, 2014 at 9:53 pm #114107Davinder Singh Kainth
MemberFor changing Post info 'By' to 'From' - add following code to functions.php file.
Backup before making changes and deactivate simple edits plugin to make it work.
//* Customize the post info function add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { if ( !is_page() ) { $post_info = '[post_date] from [post_author_posts_link] '; return $post_info; }}
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 12, 2014 at 9:55 pm #114108Davinder Singh Kainth
MemberFor filed under text change, add following code to functions.php file
/* Custom Tags and Categories text www.basicWP.com */ add_filter( 'genesis_post_meta', 'dmp_post_meta_filter' ); function dmp_post_meta_filter($post_meta) { if (!is_page()) { $post_meta = '[post_categories sep="/" before="Category: "] [post_tags sep="/" before="Tags: "]'; return $post_meta; } }
Refer - http://www.basicwp.com/edit-filed-under-tagged-with-text-studiopress/
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 12, 2014 at 9:58 pm #114109Davinder Singh Kainth
MemberFor date in different language you can use custom php code. For example: for date display in French language, one can use following code:
<?php setlocale(LC_TIME, "fr_FR"); echo strftime("le %d %B, %Y"); ?>
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 13, 2014 at 7:41 am #114135Hashim
MemberDear Davinder Singh Kainth,
Thank you so much for spending the time to respond to my question!
I've tried your suggestions. Unfortunately I'm getting the big bad white screen when I add the codes in the functions.php file of my child theme.
The custom php code I haven't tried yet, because I don't know where to add that code. Maybe you provide me with some extra information to help me find the right place to put the code.
Thank you in advance!
Sincerely,
Hashim Naushahi
July 13, 2014 at 7:53 am #114137Hashim
MemberNo sorry!
I have to take that back. I'm not seeing the big bad white screen anymore. I made the mistake of copying the code from my email instead of from this thread. When I used the code from this thread directly everything was just fine.
The only problem is that the codes didn't work. I tried it with different browsers before and after clearing all history. But everything was still the same.
Do you know what the reason might be?
Thank you in advance!
July 13, 2014 at 11:59 am #114144Davinder Singh Kainth
MemberTry coping code from here - http://my.studiopress.com/snippets/post-meta/
You need to copy and paste only following code
//* Customize the post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]'; return $post_meta; }}
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 13, 2014 at 12:00 pm #114145Davinder Singh Kainth
MemberAlso make sure you edit "Filed Under:" and "Tagged" to words of your choice in the above code.
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 14, 2014 at 1:56 am #114204Hashim
MemberHi Davinder,
Thank you for your help once again!
Unfortunately it still didn't work. I changed the texts but without any changes on my website.
This is what I did:
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] Door [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
}//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Gearchiveerd Onder: "] [post_tags before="Getagd Met: "]';
return $post_meta;
}
}Despite these codes and the changed texts in them, the texts on the website remain the same as before.
Is there any other solution to this?
Thank you in advance!
Sincerely,
Hashim
July 14, 2014 at 9:38 pm #114345Davinder Singh Kainth
MemberWhich theme are you using and do you have website url to share ?
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesJuly 16, 2014 at 9:31 am #114538Hashim
MemberHi Davinder,
Thank you for your dedication!
The problem is solved. It seems that Simple Edits was overruling the functions.php file. So I copied the shortcodes from your php code and pasted them in Simple Edits and now everything looks perfect!
Except for two things..
The date is still in English. You provided me with a php code but I don't know where to place that. Could you please tell me what to do with the code?
I managed to make some changes in the texts of the comments and the comments form with the help of code snippets provided in the StudioPress website. But some texts are still unchanged as you can see on my website:
which is using the Generate Pro theme. You can see the texts 'Reply' under the comment and 'at' between the date and the time of the comment. And the texts 'Your email address will not be published. Required fields are marked', 'Name', 'Email', 'Website' an 'Comment' above the fields. And when someone is logged in you see the text 'Logged in as' before the author name followed by 'Log out?' which can also be seen in the footer. Do you know how I can change these texts?
Thank you in advance!
Sincerely,
Hashim Naushahi
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.