1. CYBER MONDAY SALE Get Divi.Help Pro Membership @ $99 / lifetime & instantly gain access to all our Divi.Help Pro Membership perks.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed.Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color.
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Second button to "Read more" Blog post

Discussion in 'Free Divi Community Forum' started by chriz122, Jun 28, 2024.

  1. chriz122

    chriz122 New Member

    Hi,
    first of all my native language is german so i hope you all understand me :D
    Im currently working on my Blog and i want to add a second button. Like next to the "read more" Button.
    The buttons function should be a link to refer to another tab/page.

    If i can even change the link in the editor always by hand would be amazing.

    thank you for help
     
    1. PRO MEMBER PERKS Divi Ultimate Child Theme - Tons of premade layouts & section designs + functionalities for your Divi site:Learn More
  2. chriz122

    chriz122 New Member

    i have managed with Chatgpt to get this in the functions.php right position:
    Code:
    Log In or Sign Up to view this code.
    now i have this nice box here :

    [​IMG]

    GPT also said i have to put this in the Blog.php (child theme)
    PHP:
                'buy_now' => array(
                          
    'label'           => esc_html__'Jetzt Kaufen''et_builder' ),
                           
    'css'             => array(
                          
    'main'  => "{$this->main_css_element} div.post-content a.buy-now-link",
                           
    'hover' => "{$this->main_css_element} div.post-content a.buy-now-link:hover",
                        ),
                        
    'hide_text_align' => true,
    ),

    but now im stuck i dont know where i write/insert code to actually show the button now
     
  3. Divi Booster

    Divi Booster Divi Expert

    Hey chriz122,

    I've written up how to add a second button to the blog module in the past:

    https://divibooster.com/add-second-button-to-blog-module-posts/

    I think it should do what you need, but give me a shout (either here or in the comments) if you have any questions about it.

    The first block of code ChatGPT gave you is adding a custom field to the posts. While you can do that, it's perhaps better just to use WordPress's built-in custom fields feature which is doing the same thing (and this is how my post handles it). Alternatively, the free Advanced Custom Fields plugin will let you add custom fields more flexibly (and the code in that post should be easy to modify to handle Advanced Custom Fields if you wish to use it).

    I don't think the second block of ChatGPT code will help you much. It's part of a bit of code for adding style options to a second button, but would require you to entirely override the blog module and prevent you from getting future updates to it, etc. The code in my post makes the second button inherit the styles from the read more button, but if you need it to be styled differently, let me know and I can advise you on how best to do that.
     
    chriz122 likes this.
    1. PRO MEMBER PERKS Divi Block Pro - Premade content toggle design for your Divi site without using any plugins:View Demo