Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #980120
    5wan
    Participant

    Hi,

    I want to add a footer to a single page only.
    Footer to contain simple text widgets.

    Page in question:
    http://www.duncanswan.me/books/

    How do I got about doing this?

    #980122
    5wan
    Participant
    This reply has been marked as private.
    #980217
    Thai
    Moderator

    Hi There,

    Please add the following code under functions.php file locates in your child theme:

    add_action( 'x_after_view_global__content', 'x_print_after_content' );
    function x_print_after_content(){
      if(is_singular( 'page' )){
      ?>
      <div id="x-section-footer" class="x-section" style="margin: 0px;padding: 45px 0px; background-color: transparent;">
        <div class="x-container max width" style="margin: 0px auto;padding: 0px;">
          <div class="x-column x-sm x-1-1" style="padding: 0px;">
            <p>Input your quotation here. Also, you can cite your quotes if you would like.</p>
          </div>
        </div>
      </div>
      <?php
      }
    }

    Replace the text Input your quotation here. Also, you can cite your quotes if you would like. with your texts.

    Hope it helps 🙂

    #980218
    5wan
    Participant

    Is it possible to replace the “Input your quotation here” with an image instead? or Shortcode?

    #980281
    Thai
    Moderator

    Yes, Of course:

    add_action( 'x_after_view_global__content', 'x_print_after_content' );
    function x_print_after_content(){
      if(is_singular( 'page' )){
      ?>
      <div id="x-section-footer" class="x-section" style="margin: 0px;padding: 45px 0px; background-color: transparent;">
        <div class="x-container max width" style="margin: 0px auto;padding: 0px;">
          <div class="x-column x-sm x-1-1" style="padding: 0px;">
            <img src="http://placehold.it/650x250" />
          </div>
        </div>
      </div>
      <?php
      }
    }

    Regards!

    #980456
    5wan
    Participant

    Hi, I couldn’t seem to get the above to work.
    Have removed it from my functions.php again.

    Two questions:
    – How does it restrict the footer to only be added to the “Books” page?
    – And how can I specify it to insert widgets into the footer?

    That would enable me to manage the text or images in the form of widgets, instead of having to modify the Functions.php

    #980460
    5wan
    Participant

    On a side note, it seems to be adding the ‘footer’ directly below the pre-existing body of text, within the entry container.

    Is it possible to have it display outside of the container instead?
    ie. Appearing on the background image, in the same style as the side bar widgets?

    #980769
    Rue Nel
    Moderator

    Hello There,

    The best and easiest recommendation I could give is this.

    1] Please edit all your pages and change the page template. You can choose to use “Blank – Container | Header , No Footer” or “Blank – No Container | Header, No Footer”.

    2] And if you want that in your “Books” page to have a footer, you can make use of the “Blank – Container | Header , Footer” or “Blank – No Container | Header, Footer” page template.

    3] You can manage all the footer widgets in Appearance > Widgets.

    This solution doesn’t involve any custom code needed in your functions.php file. Hope this helps.

    #980872
    5wan
    Participant

    problem with that is then I lose my side bar.
    Is there another solution?

    #980878
    5wan
    Participant

    Ideally, I want the new ‘widget area’ to span the content area (ie. the large body of text), without overlapping / appearing under the sidebar.

    So as my sidebar grows, it don’t impact the new widget area.
    ie. On my page:
    http://www.duncanswan.me/books/

    The new widget area should appear to the right of the subscribe button, but not in the container with all the text, but below it instead.

    #980895
    Christopher
    Moderator

    Hi there,

    Are you trying to make footer full width outside container, right?
    Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding. Take care!

    #980924
    5wan
    Participant

    I’m fairly certain something similar can be achieved by modifying my child theme to include the below:

    In Functions.php of child theme:

    register_sidebar( array(
    ‘name’ => __( ‘Header Widget’, ‘x child theme’ ),
    ‘id’ => ‘header-widget’,
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => “</div>”,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );
    ?>

    In wp-header.php:

    <?php if ( is_active_sidebar( ‘header-widget’ ) ) : ?>
    <div><?php dynamic_sidebar( ‘header-widget’ ); ?></div>
    <?php endif; ?>

    CSS:
    /**********CSS FOR BELOW HEADER WIDGET*****/

    #main #widget_name {
    background-color: #FFD75F;
    padding: 2px;
    margin-left: auto;
    margin-right: auto;
    }

    #980925
    5wan
    Participant

    but I cant locate wp-header.php in framework\views\

    Currently I only have style and functions.php

    What step have I missed?
    Thanks

    #980960
    Christopher
    Moderator

    Hi there,

    wp-hearder.php is located under wp-content/themes/x/framework/views/Your STACK. Please copy this file and put it in the same path inside child theme (wp-content/themes/x-child/framework/views/Your STACK) to modify it.

    Hope it helps.

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