Home Forums Free Themes WEN Associate Link in "wen associate" footer

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #469
    arkyannell
    Participant

    Hi,
    how can I insert a link in the footer? I’ve tried adding “Privacy policy“, but it doesn’t work.
    Thank you for your attention.
    Best regards.
    Dan

    #470
    wensolutions
    Keymaster

    Hello Dan,

    This can be easily achieve by making a Child theme from your current parent theme. You can learn how to make a Child Theme.

    So now entire section of footer can just be edit by copying this function wen_associate_footer_copyright from inc/hook/core.php file and paste this entire function in your child theme’s functions.php which would look like this.

    function wen_associate_footer_copyright(){
    
    	// Just add or edit snippets to modify the things inside it
    
    }

    Let us know if it didn’t work or have problem modifying it.

    Thank you.

    #472
    arkyannell
    Participant

    I didn’t understand the exact part I have to copy and past from the file core.php of the father theme to the file functions.php of my child theme.
    I see in core.php the following code:

    if( ! function_exists( 'wen_associate_footer_copyright' ) ) :
    
      /**
       * Footer copyright
       *
       * @since  WEN Associate 1.0
       */
      function wen_associate_footer_copyright(){
    
        // Check if footer is disabled
        $footer_status = apply_filters( 'wen_associate_filter_footer_status', true );
        if ( true !== $footer_status) {
          return;
        }
    
        // Copyright
        $copyright_text = wen_associate_get_option( 'copyright_text' );
        $copyright_text = apply_filters( 'wen_associate_filter_copyright_text', $copyright_text );
    
        // Footer navigation
        $footer_menu_content = wp_nav_menu( array(
          'theme_location' => 'footer' ,
          'container'      => 'div' ,
          'container_id'   => 'footer-navigation' ,
          'depth'          => 1 ,
          'fallback_cb'    => false ,
          'echo'           => false ,
        ) );
    
        ?>
        <div class="row">
    
          <?php if ( ! empty( $footer_menu_content ) || ! empty( $copyright_text ) ): ?>
            <div class="col-sm-6">
              <?php if ( ! empty( $footer_menu_content ) ): ?>
                  <?php echo $footer_menu_content; ?>
              <?php endif ?>
              <?php if ( ! empty( $copyright_text ) ): ?>
                <div class="copyright">
                  <?php echo esc_html( $copyright_text ); ?>
                </div><!-- .copyright -->
              <?php endif ?>
            </div><!-- .col-sm-6 -->
          <?php endif ?>
    
          <div class="col-sm-6 pull-right">
    
              <div class="site-info">
                <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'wen-associate' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'wen-associate' ), 'WordPress' ); ?></a>
                <span class="sep"> | </span>
                <?php printf( __( 'Theme: %1$s by %2$s.', 'wen-associate' ), 'WEN Associate', '<a href="http://wenthemes.com/" rel="designer" target="_blank">WEN Themes</a>' ); ?>
              </div><!-- .site-info -->
    
          </div><!-- .col-sm-6 -->
        </div><!-- .row -->
    
        <?php
    
      }
    
    endif;
    
    add_action( 'wen_associate_action_footer', 'wen_associate_footer_copyright', 10 );
    
    if( ! function_exists( 'wen_associate_footer_goto_top' ) ) :
    
      /**
       * Go to top
       *
       * @since  WEN Associate 1.0
       */
      function wen_associate_footer_goto_top(){
    
        $go_to_top = wen_associate_get_option( 'go_to_top' );
        if ( 1 != $go_to_top ) {
          return;
        }
        echo '<a href="#" class="scrollup" id="btn-scrollup"><i class="fa fa-chevron-circle-up"></i></a>';
    
      }
    
    endif;

    Is it right? Have I to copy ALL the code and modify…what?
    Could you write me the functions.php code to insert the link in footer?
    Thank you so much.
    Dan

    #473
    wensolutions
    Keymaster

    Hello Dan,

    Assuming that you have set up your Child theme and you are wishing to put your ‘Privacy Policy’ link just next to your footer copyright text. Well now just copy and paste the following lines of code in your Child Theme’s functions.php .

    <?php
    /**
       * Footer copyright
       *
       * @since  WEN Associate 1.0
       */
      function wen_associate_footer_copyright(){
    
        // Check if footer is disabled
        $footer_status = apply_filters( 'wen_associate_filter_footer_status', true );
        if ( true !== $footer_status) {
          return;
        }
    
        // Copyright
        $copyright_text = wen_associate_get_option( 'copyright_text' );
        $copyright_text = apply_filters( 'wen_associate_filter_copyright_text', $copyright_text );
    
        // Footer navigation
        $footer_menu_content = wp_nav_menu( array(
          'theme_location' => 'footer' ,
          'container'      => 'div' ,
          'container_id'   => 'footer-navigation' ,
          'depth'          => 1 ,
          'fallback_cb'    => false ,
          'echo'           => false ,
        ) );
    
        ?>
        <div class="row">
    
          <?php if ( ! empty( $footer_menu_content ) || ! empty( $copyright_text ) ): ?>
            <div class="col-sm-6">
              <?php if ( ! empty( $footer_menu_content ) ): ?>
                  <?php echo $footer_menu_content; ?>
              <?php endif ?>
              <?php if ( ! empty( $copyright_text ) ): ?>
                <div class="copyright">
                  <?php echo esc_html( $copyright_text ); ?>
                  <a href="http://www.sitename.ext/privacy-policy-page">Privacy policy</a>
                </div><!-- .copyright -->
              <?php endif ?>
            </div><!-- .col-sm-6 -->
          <?php endif ?>
    
          <div class="col-sm-6 pull-right">
    
              <div class="site-info">
                <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'wen-associate' ) ); ?>"><?php printf( __( 'Proudly powered by %s', 'wen-associate' ), 'WordPress' ); ?></a>
                <span class="sep"> | </span>
                <?php printf( __( 'Theme: %1$s by %2$s.', 'wen-associate' ), 'WEN Associate', '<a href="http://wenthemes.com/" rel="designer" target="_blank">WEN Themes</a>' ); ?>
              </div><!-- .site-info -->
    
          </div><!-- .col-sm-6 -->
        </div><!-- .row -->
    
        <?php
    
      }

    Note:
    Please check for PHP opening tag in the beginning ( may not require if its already there) if it gives error in your case. Otherwise it should work fine.

    Thank you

    #482
    arkyannell
    Participant

    Hi, thank you so much! It works! 🙂
    Sincerely yours,
    Dan

    #483
    wensolutions
    Keymaster

    No problem, Dan. Feel free to post your queries anytime in our forum.

    Thanks

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