Forum Replies Created

Viewing 15 replies - 46 through 60 (of 82 total)
  • Forum: Plugins
    In reply to: [CMB2] make fields required
    Thread Starter berttervoert

    (@berttervoert)

    Here is a part of the CMB2 registration:

      $prefix = '_wdtv_fiets_route_';
      //  Initiates the metabox
      $cmb = new_cmb2_box( array(
          'id'            =>  'fiets_routes_data',
          'title'         =>   __( 'Fiets routes informatie', 'cmb2' ),
          'object_types'  =>  array( 'fiets_routes' ),
          'context'       =>  'advanced',
          'priority'      =>  'high',
          'show_names'    =>  true, //  show field names on the left
          // 'cmb_styles' =>  false,  //  false to disable the CMB stylesheet
          // 'closed'     =>  true,  //  keep the meatabox closed by default
      ) );
    
      /**
        * Creates the fields to go with the custom metabox
        */
    
      //  small text area field for route description
      $cmb->add_field( array(
        'name'        =>  'Route beschrijving',
        'desc'        =>  'Geef hier een korte beschrijving van de route',
        'id'          =>  $prefix . 'beschrijving_textareasmall',
        'type'        =>  'textarea_small',
        'attributes'  =>  array(
                            'required' => 'required',
                          ),
      ));
    
      //  small text field for route distance
      $cmb->add_field( array(
        'name'        =>  'Lengte route',
        'after_field' =>  ' <b>km</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="cmb2-metabox-description"> De (globale) lengte van de route</span>',
        'id'          =>  $prefix . 'afstand_textsmall',
        'type'        =>  'text_small',
        'attributes'  =>  array(
                            'type'      =>  'number',
                            'required'  =>  'required',
                          ),
      ));
    

    The ‘Lengte route’ part is supposed to be numbers only. It shows arrow up and down in the inputfield that produces a number, but you’re still able to type text in the field. Any thoughts on that?

    Thanks in advance,
    Bert.

    Thread Starter berttervoert

    (@berttervoert)

    Ok, thanks that works.

    Thread Starter berttervoert

    (@berttervoert)

    As to be sure we’re talking about the same: I want to add widgets so that they show up on the left side on Appearance>Widgets, under the section Available Widgets.

    All I’ve seen online is how to add widgets that are available to a section of the theme and not on how to add widgets to the Available Widgets section.

    Bert.

    Thread Starter berttervoert

    (@berttervoert)

    On the other pages, I chose the fonts using elementor, so that might be why they are not showing. I did add a function to load the font. >>Seems like I didn’t copy the correct bit for the google-font. I just did it again and now the font is showing correctly. <<

    I tried the css you suggested, but no result. So I will change the svg for a png version.

    I tried checking Appearance>Widgets and none show up there, but one: the plugin I used to display the map in the footer section: cbx google map. I was looking for a widget to use a different search box and maybe a button, but I haven’t found any that will show up on the above mentioned page.

    Thread Starter berttervoert

    (@berttervoert)

    I just found a solution after reading some more on internet:

    section#main[style] {
      min-height: 100px !important;
    }

    the declaration none wasn’t valid, so I tried a specific number in pixels, but still had to add the !important bit.

    Thread Starter berttervoert

    (@berttervoert)

    Your css solution for the footer background works perfect, so thanks for that! I tried the min-height alteration as you suggested, but that doesn’t do a thing. It keeps the min-height as it is declared inline as I discribed in my previous post.
    I added a screenshot of the inspector after adding your piece of css:
    screenshot

    Furthermore I read several articles about using !important and they all seem to discourage the use.

    Do you have any other idea how to go about it?

    Thread Starter berttervoert

    (@berttervoert)

    I transferred the site to my website so you can view it online here:

    view website

    I also noticed that there is a bit of a strange thing: I wanted to change the background color of the <footer>. This left a small block right of the footer in the original bg color. I can change this using footer::after, but then the left sidebar moves a bit up and down when you scroll up and down on the main page.

    Do you have any idea why this is?

    Thread Starter berttervoert

    (@berttervoert)

    Thank you, I added your suggestions plus set some more padding / margin bottom to zero. This reduced the gap quite far but not completely.
    Using the firefox inspector, the only item that runs completely through to the gray footer is:
    <section id=”main” class=”main” role=”main” style=”min-height: 1354px;”>…</section>

    but I can’t see any margin or padding declared to the bottom >0.

    If you could help me with this, I would be very gratefull. The gap is already much better, but it would be nice if it were possible to minimize it just a bit more.

    thanks in advance,
    Bert.

    Thread Starter berttervoert

    (@berttervoert)

    The site is still not live, but I took a screenshot which might clarify things a bit:

    screenshot

    When I look at the code, there is a inline statement of min-height on element, see this screenshot.

    Hope this gives you a better idea of wat I want to achieve.

    Thread Starter berttervoert

    (@berttervoert)

    Sorry, but I have found the solution for my problem:

    – The headings selectors have a seperate css rule to declare the font.
    – The editor has a seperate css rule to declare the font.

    So in the editor it doesn’t seem that the font has been changed, but if you view the page, the font has been changed.

    So, it’s possible to change the font in the css.

    Thread Starter berttervoert

    (@berttervoert)

    Ok, thank you very much for all the help with this. I’ll hard-code a credits line in the footer. I’ll send you a link once the site is live.

    Thread Starter berttervoert

    (@berttervoert)

    I tried both your suggestions, but with the same outcome: no effect. Seems like the template created by the plugin (header, footer & block) is much more gressive. Especially since your second suggenstion should place the credits on top of the rest of the footer template. As if it ends the page somehow and discards anything that comes after it. If that is at all possible.

    Meanwhile I have been able to make a workaround in case there is no other way to tackle this. I can add a row below the widgets in the footer in which I can place html code. only downside (in my opinion) is that the credits will be hard-coded and you will lose the filters and such which are present in the themes original foorter.php

    I use firefox developer edition to see what goes on. I noticed that in the page code there is no <footer> tag nor </footer> tag. Only a <div class=”footer-width-fixer”>. This is the container div of the plugins footer template. Does this make any sense to you?

    Thanks again for your input!

    Thread Starter berttervoert

    (@berttervoert)

    WP_DEBUG is set to ‘true’, but I get no error messages. Could it be something the plugin does?

    Thread Starter berttervoert

    (@berttervoert)

    The CSS does work indeed. Thanks for that. I did place the shortcode right below the opening <footer> tag, as you suggested, but this makes no difference. The site I’m working on is under development on localhost, so can’t add a URL for you to take a look. Would it help if I post a part of the code that is generated?

    If not I will try to put the design credit in the footer template. Such great support for a free theme deserves credit in my oppinion!

    Thanks again so far!

    Thread Starter berttervoert

    (@berttervoert)

    I’ve been playing around with the plugin I mentioned in my previous post,and I think this could offer a solution. I made a footer template and when you save it, it gives you a shortcode. I copied the footer.php into my child theme and added a php line with do_shortcode. This does display the template on the page, but leaves out the complete design-credit part of the original footer.

    I put the code directly below the line do_action( ‘footer-top’ ). Probabely not the right place to put it. Can you tell me where to put the shortcode?
    Another thing I noticed and haven’t been able to figure out: I changed the background color for the sidebar (to get a uniform background color over the entire page). Works fine on laptop and mobile version, but doesn’t work on tablet. There it slides in from the left, but keeps it dark original color, no matter what I try. Can you tell me how to change that background-color as well?

    Thanks in advance,
    Bert.

Viewing 15 replies - 46 through 60 (of 82 total)