Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

AddToAny location – (picture added)

  • Hello, Im trying to move the upper AddToAny location after the “Created By: Webmaster”

    before the icons, i want to add text: Share Now:

    Example

  • Hi there,

    Do those Share Buttons have a Shortcode to make it appear?

    If it does, you can create a Block Element – Post Meta Template and add a Shortcode Block for the Share Buttons.

    Reference: https://docs.generatepress.com/article/block-element-post-meta-template/

  • EDIT:

    I saw the youtube guide, When I go to create new block element i dont have the “Block Element” to choose.

    in the plugin itself you just select where you want it to appear and it just appear there.

    just found the shortcode: [addtoany]

    im trying to follow your links to make it work.

  • Alright. Let us know how it goes.

  • I saw the youtube guide, When I go to create new block element i dont have the “Block Element” to choose “Post Meta Template”

    FYI: I Disabled gutenberg, idk if its the reason.

  • You’re correct.

    You need to use the default WordPress Block Editor to use the Block Element feature of GP Premium.

    In any case, can you try adding a filter like this as an alternative?:

    add_filter( 'generate_post_author_output', function( $output ) {  
        return do_shortcode('[addtoany]') . ' ' . '<span class="coauthor"> and <a href="' . $coauthor_link . '">' . $coauthor . '</a></span>'; 
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets

  • Your support already helped with the next code snippet:

    add_filter( 'generate_post_date_output', function( $output, $time_string ) {
    	
    $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished"><strong>נוצר בתאריך:</strong> %2$s</time>';
    
    if ( get_the_date() !== get_the_modified_date() ) {
    	$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished"><strong>נוצר בתאריך:</strong> %2$s, </time><time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified"><strong>עודכן בתאריך:</strong> %4$s</time>';
    }
    
    $time_string = sprintf( $time_string,
    esc_attr( get_the_date( 'c' ) ),
    esc_html( get_the_date() ),
    esc_attr( get_the_modified_date( 'c' ) ),
    esc_html( get_the_modified_date() )
    );
    
    return sprintf( '<span class="posted-on">%s</span> ',
    $time_string
    );
    }, 10, 2 );

    so I guess both codes, need to be combined now, can you please help me with that?

  • Hi there,

    the two codes should not need combining.
    Have you tried added Fernandos code ?

  • its not working:

    i like the codes u gave me for updated and created article date, i would like to keep it, only add the shortcode.
    I replaced the code to the last one mentioned since its not good (until u reply)

  • The code that Fernando provided can you change that to:

    add_filter( 'generate_post_author_output', function( $output ) {  
        return $output . do_shortcode('[addtoany]');
    } );
  • The result is:

    https://www.proguides.co.il/%d7%94%d7%9e%d7%93%d7%a8%d7%99%d7%9a-%d7%94%d7%9e%d7%9c%d7%90-google-adsense-%d7%92%d7%95%d7%92%d7%9c-%d7%90%d7%93%d7%a1%d7%a0%d7%a1/

    I want to keep the Created on & Updated on titles (with the bold code)
    if you will see the code you guys gave me last time, i just want to add the [addtoany] code after the Created By: Webmaster, and to keep it inline.

    There is a way to add the code on the code i pasted earlier ?

  • I am not seeing any change ? Is the last code i provided still on the site ?

  • yes, the last one is active, i cleared css maybe refresh

  • Try adding this CSS now;

    
    .single .entry-meta {
        display: flex;
        column-gap: 10px
    }
    
  • Ok you can check the post now, its inline, I Enabled the last code & the new code (u can refresh the post)

    Last problem I have, is that on mobile its not looks good, I need to make a <br> to the AddToAny code, ONLY if the user using a MOBILE phone

  • Try adding this CSS as well:

    @media (max-width: 768px){
        .single .entry-meta {
            flex-wrap: wrap;
        }
    }
Viewing 16 posts - 1 through 16 (of 34 total)
  • You must be logged in to reply to this topic.