Adding links to subheadings

This topic has 10 replies, 1 voice, and was last updated 6 years, 9 months ago by Yogendra.

Viewing 2 reply threads
  • Author
    Posts
    • #357


      kmorrow
      Guest

      Hi! It is me again, working on the Bayou on Bay site. My client reached out to me and would like to add links to the subheadings in the Menu (team widget) section and the Events (blog widget) section. When she adds the code to the subheading within the widgets, it doesn’t work for her. Is there another way to make this happen?

      Thanks!

      Kacey

    • #358


      Yogendra
      Guest

      Hello Kacey,

      How are you?

      Can you please let me know exactly what you want? I guess you want to add links to the text right

      We are open Tue-Fri from 11:00am-Late, Sat & Sun from 10:00am-Late
      Happy Hour runs from 3pm-6pm on Wed, Thu, and Sun, every night from 10pm-close, and all day long on Tuesdays.

      Thanks

      • #360


        kmorrow
        Guest

        Yep, That is what they want. They want to be able to add a link to the text of the Our Menu and Events widgets.

        Any suggestions?

      • #362


        kmorrow
        Guest

        I figured out how to add a link after the subheading in the HTML. If there is an easier way within the widget for the client, let me know, otherwise I can instruct them on how to adjust the HTML. Thanks!

      • #363


        Yogendra
        Guest

        Hello Kacey,

        First of all you need to change the subheadings input type from textbox to textarea.
        You can easily change this in your widget file ie( team-section-widget.php ).

        For ex change the line from

        <input class=”widefat” id=”<?php echo $this->get_field_id(‘subheading’); ?>” name=”<?php echo $this->get_field_name(‘subheading’); ?>” type=”text” value=”<?php echo $subheading; ?>” />

        to

        <textarea class=”widefat” rows=”4″ cols=”12″ id=”<?php echo $this->get_field_id(‘subheading’); ?>” name=”<?php echo $this->get_field_name(‘subheading’); ?>”><?php echo $subheading; ?></textarea>

        You also need to change the sanitation function of subheading in update function of widget. Remove the wp_filter_post_kses() function here.

        Eg Change this
        $instance[‘subheading’] = wp_filter_post_kses($new_instance[‘subheading’]);

        to

        $instance[‘subheading’] = $new_instance[‘subheading’];

        Now you will be able to add links using anchor html tag.

        Thanks

      • #364


        Yogendra
        Guest

        One more thing after pasting the code. Please change this ” and ‘ to plain double quotes and plain single quotes. You will see the difference when pasting that ” and ‘ are different from those used in the code

        One more thing do not edit parent theme widgets. Always edit the child theme widgets.

        Thanks

    • #359


      Yogendra
      Guest

      Hello Kacey,

      There is a black section just after the slider. See this screenshot. This is because of the fixed height you have given there

      http://imgur.com/a/2HJtU

      Use height auto

      slider-wrapper {
      overflow: hidden;
      position: relative;
      height: auto;
      background-color: #000;
      }

      One more thing i can’t see a logo in other pages and in sticky header. You can add these by going to
      Appearance->Customize->Sticky Header and Logo Settings

      Thanks

      • #361


        kmorrow
        Guest

        Thanks for checking that out. I changed the height to auto and it seemed to have worked. I am surprised the logo isn’t showing up on the sticky header. I have it in there under the Customize Settings. I removed it and readded it. I can see it on the sticky header, but not on the blog posts. It would be nice to see it in the header on the blog posts.

      • #368


        Yogendra
        Guest

        Hello Kacey,

        First of all, You need to add a second logo for content pages. You can add this by going to Appearance->Customize->Sticky Header and Logo Settings and find section Logo for White Background Pages. This will not only add logo to the content page but will be used as sticky header logo for white bakcground pages also.

        Thanks

      • #371


        kmorrow
        Guest

        Thanks for the above suggestions for changing the code to allow for links to be added in the widget. I will give it a try!

        As far as the logo goes, I did already include an image in the Logo For White Background Pages, so I am not sure what is going on? it is the same image that I added for the Logo for Sticky Header. I could try a different image and see if that changes anything?

        Thanks again.

      • #372


        Yogendra
        Guest

        ok check and let me know

        Thanks

Viewing 2 reply threads

Reply To: Adding links to subheadings

Your information:




Cancel