• Resolved Sitebuilder

    (@valetrends)


    So I want to create a Fact box in one of my articles with some simple facts made for the article. How can I do that?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Moderator bcworkz

    (@bcworkz)

    You could place your facts in a normal paragraph block and add a custom CSS class to it. (“Advanced” meta box). Use the customizer’s Additional CSS panel to style your paragraph as you want with border, background-color, font, size, etc. You can reuse the same class on as many boxes and articles that you want.

    Thread Starter Sitebuilder

    (@valetrends)

    Ok sounds good.

    I heard a rumour that editing things a lot in CSS for WordPress might make the blog slower and might eff [language moderated] it up after updates?

    Is that true or is it all well and good to these measures you talk about?

    Thanks

    • This reply was modified 6 years, 6 months ago by bcworkz.
    Moderator bcworkz

    (@bcworkz)

    Hey Valuetrands – let’s keep it family friendly here, OK? I normally throw in a share of cursing myself. It doesn’t bother me personally, being colorful can be entertaining. Coders starting out are getting younger and younger. Let’s set a good example. They’re not yet old enough to decide how they should behave for themselves. Polite substitutions are OK if you want to be colorful. Thanks.

    It’s a matter of volume. Adding in several voluminous CSS files will slow down page loads. Adding a dozen CSS rules to Additional CSS isn’t going to make any difference. Usually what drags down page loads are large image files that were not well optimized. Relative to those CSS is a drop in the bucket of data transferred and processed.

    CSS added to Additional CSS panel will persist after updates. It’s CSS added to theme style.css that are at risk.

    Thread Starter Sitebuilder

    (@valetrends)

    Ok man. Yeah the younger population are not as cynical. One should protect them as long as it is possible. Point taken :). And I agree with you.

    So what I am doing in this case is not likely to slow down the site then, right? If I go with your advice I mean.

    Best regards and many thanks

    Thread Starter Sitebuilder

    (@valetrends)

    Also, do you have a suggestion for what I could write in the CSS box to adjust border, background-color, font and size as you say?

    Because I guess you mean I should edit the box using CSS commandos in the Advanced-boc next to the text/paragraph on the right?

    the one that is called “Additional CSS Class(es)/ Separate multiple classes with spaces.”?

    Moderator bcworkz

    (@bcworkz)

    In the advanced box on the edit screen, just provide a custom class name, “fact-box” for example. In the customizer’s Additional CSS add something like

    .fact-box {
      width: 33%;
      float: left;
      border: 1px solid #222;
      padding: 1em;
      font-size: 110%;
      background-color: #eef;
    }

    Once added, use your browser’s element inspector developer tool to help you fine tune the values to your liking.

    How classes are separated in CSS selectors depends on what logic should be applied when applying the selectors against various elements. Separate by spaces to require all classes be present in the element’s ancestry tree. Separate by commas to select an alternate set of classes. Take this HTML for example:

    <div class="outer">
      <div class="inner-1">foo</div>
      <div class="inner-2">bar</div>
    </div>
    <div class="more">example</div>

    CSS to make foo and example elements bold, but not bar:

    .outer .inner-1, .more {
      font-weight: bold;
    }

    Make all element fonts smaller

    .outer, .more {
      font-size: 85%;
    }

    There are all sorts of ways to target specific elements with selectors and pseudo-selectors. I suggest reading up on this some more, for example https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors and its following pages.

    Thread Starter Sitebuilder

    (@valetrends)

    Ok man. I know this is off-topic. But do you know how to make the disclaimer I have at the bottom in my articles a smaller font than the breadtext? I have tried this in edit-mode but when I publish it still has the same size as the main text.

    Also, I want to make the pages a little bit bigger in the main page.

    In my website it is called “about” and “disclaimer” next to the title “Valuetrends” to the left in the main page. How can I make those pages a bit bigger on the main page? Increase the font I mean.

    Also, how can I make a scroll down on these page’s titles? So for example if I create a page called “Real estate” how can that page act as a roll down when you put the arrow over it? Not click it but just when you put the arrow over it I mean.

    I don’t mean when you click on it. Rather when you put the arrow over it I want it to show different articles on a roll down so you can then click those individual articles.

    My third question is about creating clickable categories on the right. So if I for example create a category called “Fish” and when you click that category.. Then it appears, below that category: part 1, part 2, part 3 and so on. Do you know how to do that? Feel free to move these questions into single articles if they are too off topic.

    best regards

    Moderator bcworkz

    (@bcworkz)

    For font size and other CSS changes, learn to use your browser’s element inspector developer tool. It lets you pick specific elements and shows you the applicable rules being applied. You can trial edit these and add new rules. Any changes made there will not persist. To keep the rules you’ve arrived at, copy the altered rules to the Additional CSS panel of the customizer.

    To have CSS only apply to a particular page, there ought to be a unique class assigned to the body element, such as “post-123”. If you include this class as a selector, it’ll only be applied to to that page. Like so:
    .post-123 p { font-size: %110%; }
    It’ll make all paragraphs with p tags 10% larger than the usual.

    To scroll the page on roll over of an arrow element, you need some JavaScript that executes on the “onmouseover” event. It is the JavaScript that scrolls the page.

    Similar for expandable categories. The full list is there from the start, but parts are hidden. When the “onclick” event fires, JavaScript changes the style properties to unhide the appropriate elements. There is a cool jQuery module called “accordion” that semi-automates the process if the HTML is set up correctly.

    If you search about on the ‘net you should be able to find examples of these things now that you have a clue about how it’s done.

    Thread Starter Sitebuilder

    (@valetrends)

    I am thinking of trying it tonight in the plugin “Essential Addons for Elementor”. What do you think about that?

    Then I could do it without coding maybe. Or if that won’t work I am going to try the path you decribed when I have time.

    Thanks

    Moderator bcworkz

    (@bcworkz)

    I’ve no experience with that extension, but if it lets you easily accomplish what you want then it’s worth doing.

    There’s always something to be said for learning to code something for yourself. It gives you the ultimate control over your site. But the cost in time and frustration to learn how can make it an unattractive option.

    Thread Starter Sitebuilder

    (@valetrends)

    Yes I want to learn coding. What would be your tips for me on how to learn it from scratch? I mean basic WordPress coding

    Right now I don’t have the time to sit and try to code all day, because I have to do other things. But it would be really good if I could get to the stage of a semi-accomplished coder that understand the basics.

    How would you go about doing that if you were a noob again?

    Moderator bcworkz

    (@bcworkz)

    It depends on where you are with coding experience in general. Starting from the very beginning? Some experience, but not with PHP. What about JavaScript, HTML, and CSS? Good with PHP, but new to WP? Something else? How do you like to learn in general? Self-learner? Videos? Written? Classroom?

    I’m a self-learner. I’ve little patience for videos and classrooms. In any case, maybe most important and most difficult to do is to set aside plenty of time to improve your skills. But take lots of breaks, especially when you get frustrated.

    I’ve acquired most coding skills by finding small attainable real world projects that I’d like to see happen. Changing elements on my site, developing little tools to process information, anything your interests and needs might come up with. Then figure out how to make it happen. This way I learn what I need to know and little I don’t need to know. Knowledge expands over time as new needs arise.

    Working through contrived tutorials is fine for starting out to get the basics, but it’s real world projects where real learning happens, IMO. If a project seems insurmountable, break it down into smaller tasks. A task might just be a few lines of code for one tiny aspect of the whole. Test your progress frequently. Celebrate the smallest accomplishments.

    Thread Starter Sitebuilder

    (@valetrends)

    Yes I am thinking about starting a side-website just for doing what you recommend.

    Where I could crash things without having a heart attack 🙂

    Do you have any projects in mind that you could recommend for learning lots of coding for wordpress? In a short time.

    How many hours would you say is needed to put in to become a good coder? In general.

    Moderator bcworkz

    (@bcworkz)

    I’d say just do things that interest you or that you’re curious about. A side site on your local computer is excellent as a learning platform. Don’t push yourself to learn a lot in one go, it’s likely not to sink in as well as learning over a period of time. I’ve no idea how long it takes to become “good”, what ever that means. It’s not easy, especially at first. It takes a lot of time to gain enough experience. But you can become good at one specific aspect reasonably soon. There are a lot of different aspects though. You’ll always be learning as long as you are coding. I know I am.

    It’ll go faster if you enjoy it and reward yourself for small accomplishments.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Creating Fact Box’ is closed to new replies.