Change Shortcode Output

Community Forums Forums Design Tips and Tricks Change Shortcode Output

This topic is: not resolved

This topic contains 10 replies, has 2 voices, and was last updated by  Hashim 4 months, 2 weeks ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #114087

    Hashim
    Participant
    Post count: 14

    Hi 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.com
    #114107

    Davinder Singh Kainth
    Participant
    Post count: 1382

    For 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;
    }}

    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114108

    Davinder Singh Kainth
    Participant
    Post count: 1382

    For 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/


    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114109

    Davinder Singh Kainth
    Participant
    Post count: 1382

    For 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");
    
    ?>

    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114135

    Hashim
    Participant
    Post count: 14

    Dear 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

    #114137

    Hashim
    Participant
    Post count: 14

    No 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!

    #114144

    Davinder Singh Kainth
    Participant
    Post count: 1382

    Try coping code from here – http://my.studiopress.com/snippets/post-meta/

    You need to copy and paste only following code [code 1="it" 2="should" 3="not" 4="be" 5="copied" language="above"][/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;
    }}

    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114145

    Davinder Singh Kainth
    Participant
    Post count: 1382

    Also make sure you edit “Filed Under:” and “Tagged” to words of your choice in the above code.


    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114204

    Hashim
    Participant
    Post count: 14

    Hi 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

    #114345

    Davinder Singh Kainth
    Participant
    Post count: 1382

    Which theme are you using and do you have website url to share ?


    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #114538

    Hashim
    Participant
    Post count: 14

    Hi 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:

    http://hashimnaushahi.com

    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

    • This reply was modified 4 months, 2 weeks ago by  Hashim.
    • This reply was modified 4 months, 2 weeks ago by  Hashim.
Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.