1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.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. Now it works with Divi 5 as well!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. Now it works with Divi 5 as well!
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 Block Pro - 30+ premade custom header designs for you to choose from:View Demo
  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 Beautifully crafted custom colored 'Industrial' Divi layout for all Pro members:View Demo