[Support request] How to add copyright information to the bottom of each article

Home Forums Support [Support request] How to add copyright information to the bottom of each article

Home Forums Support How to add copyright information to the bottom of each article

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #2420905
    RYAN

    How to add copyright information to the bottom of each article, so that you don’t have to add it every time you post an article

    #2420913
    Fernando
    Customer Support

    Hi Ryan,

    The conventional way is to add it through Appearance > Customize > Layout > Footer. Reference: https://docs.generatepress.com/article/changing-the-copyright-message/

    Are you planning to have unique copyright information per article? If so, what would the copyright look like? Would it be the title of the article/post?

    #2420925
    RYAN

    Like this, it appears at the bottom of each article page, not at the footer

    #2420950
    Fernando
    Customer Support

    Will the Copyright statement shown in your screenshot be the same for all Articles?

    In essence, you can use a Block Element – Hook. Hook it to before_footer for this section.

    For the Article Title, you can use a GenerateBlocks Headline Block, and enable Dynamic data to retrieve the Title. Example: https://share.getcloudapp.com/E0uR2Z6m

    Are you also looking to add the link?

    #2420952
    RYAN

    Yes, the copyright notice displayed in the screenshot corresponds to all articles. How to set this

    #2420967
    Fernando
    Customer Support

    To clarify, are you also looking to add the unique title and link of each post as shown in the screenshot, or just the Copyright notice?

    #2420972
    RYAN

    The copyright notice content displayed in the screenshot is unchanged and appears at the end of all articles. The title and link in the screenshot correspond to the title and chain of the article. How to set this

    #2420988
    Fernando
    Customer Support

    I see.

    1. Create a Block Element – Hook. Hook it to before_footer. Set the Display rule location to Post - All Posts
    2. Add a Container Block.
    3. Add a Headline Block, and enable Dynamic data to retrieve the Title. Example: https://share.getcloudapp.com/E0uR2Z6m
    4. Add another Headline Block, and enable Dynamic data to retrieve the Title as well. Set the link source to Single Post. Then, add cu-headline-link to the class list of this Headline Block. Then add this PHP snippet:

    add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
    	if ( ! is_admin() && ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'cu-headline-link' ) !== false ) {
    		return get_permalink();
    	}
    	return $content;
    }, 10, 3);

    Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
    5. Add another Headline Block for the Copyright. Set the text to your preference.

    #2432445
    RYAN

    Why can’t I find the “Post – All Posts” option?

    #2432458
    Fernando
    Customer Support

    To clarify, is this not appearing?: https://share.getcloudapp.com/9Zuzr48w

    If so, can you provide admin login credentials so we can check.

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    #2432510
    RYAN

    I can’t understand the above step (add cu-headline-link to the class list of this Headline Block).

    Is there a diagram to explain it

    #2432872
    David
    Staff
    Customer Support

    Hi there,

    if you select the Headline Block, in sidebar settings go to Advanced. In there you will see a field: Additional CSS Class(es) add the cu-headline-link in that field.

    #2432875
    RYAN

    What is a cu headline link? Is it an article link?

    My current situation is that I don’t know what a cu headline link is, so I’m stuck here now

    #2433005
    David
    Staff
    Customer Support

    The cu-headline-link is just a CSS Class, it could be named anything you like.
    In Fernandos PHP Snippet:

    
    add_filter('generateblocks_dynamic_content_output', function($content, $attributes, $block){
    	if ( ! is_admin() && ! empty( $attributes['className'] ) && strpos( $attributes['className'], 'cu-headline-link' ) !== false ) {
    		return get_permalink();
    	}
    	return $content;
    }, 10, 3);

    You will see the class is referenced here: strpos( $attributes['className'], 'cu-headline-link' )

    And that code when it finds a block with the CSS Class of cu-headline-link it will replace whatever was in that block with the Permalink ( Link to Article ).

    #2444046
    RYAN

    Why is there such a big difference? What other places do I need to set up?
    Can have the same effect as the first picture

Viewing 15 posts - 1 through 15 (of 32 total)
  • You must be logged in to reply to this topic.