Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1196246
    yanunc
    Participant

    Hi there,
    i would like to put default back button in the center bottom of my single post with x child theme FUNCTIONS.PHP

    Thanks in advance for any help offered!

    #1196529
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Then add the following code into your functions.php file.

    
    add_action( 'x_after_the_content_end', 'add_to_single_posts' );
    function add_to_single_posts() {
      if ( is_single() ) {
        echo "<a href='http://your.link/to/blog' class='btn center-text'>Back</a>"; 
        }
    }
    

    Hope that helps.

    #1196938
    yanunc
    Participant

    thanks that great

    but how can i style this button?

    Thanks in advance

    #1196945
    Rad
    Moderator

    Hi there,

    What styling do you like to apply? Example, we can apply X button class name like this

    add_action( 'x_after_the_content_end', 'add_to_single_posts' );
    function add_to_single_posts() {
      if ( is_single() ) {
        echo '<a href="http://your.link/to/blog" class="x-btn x-btn-flat x-btn-pill x-btn-regular x-btn-block">Back</a>'; 
        }
    }

    Thanks!

    #1197457
    yanunc
    Participant

    thanks great!

    #1197628
    Joao
    Moderator

    Glad to hear we managed to help,

    Joao

  • <script> jQuery(function($){ $("#no-reply-1196246 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>