Static page to dynamic wordpress - wordpress

I found few questions related to this, but I'm totally new to WordPress and even some basic things are hard to understand, so I humbly ask not to close this topic immediately :)
I created my one-page website, put it on htmlblank5 theme and now trying to work my way on localhost WP. It seems all is working.
I don't understand the concept of making it dynamic in one page (though I understand the idea of how blog's work with pages and posts). So the question is how in general should I approach this "problem" and where to start.
Here are a few lines of my code:
expanding bootstrap buttons with a simple list and paragraph inside.
<div class="container">
<h2 id="Paslaugos" class="d-flex justify-content-center">xxxxxxxx</h2>
<div class="row">
<div class="col-lg-4 col-xm-12">
<p>
<a class="btn mygtukai" data-toggle="collapse" href="#multiCollapseExample1" role="button" aria-expanded="false" aria-controls="multiCollapseExample1">xxxxxxxxx</a>
</div>
<div class="col-lg-4 col-xm-12">
<button class="btn mygtukai" type="button" data-toggle="collapse" data-target="#multiCollapseExample2" aria-expanded="false" aria-controls="multiCollapseExample2">xxxxxxxxxxx</button>
</div>
<div class="col-lg-4 col-xm-12">
<button class="btn mygtukai" type="button" data-toggle="collapse" data-target="#multiCollapseExample3" aria-expanded="false" aria-controls="multiCollapseExample3">xxxxxxx</button>
</div>
</div>
</div>
</p>
<div class="row">
<div class="col-lg-4 col-xm-12">
<div class="collapse multi-collapse" id="multiCollapseExample1">
<div class="card card-body">
<h4 class="d-flex justify-content-center">xxxxxxxxxxxx</h4>
<ul class="kinas-teatras">
<li>xxxxxxx</li>
<li>xxxxxxxxx</li>
<li>xxxxxxxxx</li>
<li>xxxxxxxxxxx</li>
<li>xxxxxxxxxx</li>
<li>xxxxxxxxxxx</li>
</ul>
</div>
</div>
</div>
Bootstrap cards about the projects done(some kind of portfolio)
<div class="container">
<h2 id="Darbai" class="d-flex justify-content-center">xxxxxxxx</h2>
<div class="card-columns">
<div class="card">
<img class="card-img-top" src="img/hotel4.jpg" alt="Card image cap" title="KalbÄ—k">
<div class="card-body">
<h4 class="d-flex justify-content-center"><b>xxxxxxxxxx</b></h4>
<h5 class="d-flex justify-content-center darbaib"><b>xxxxxxxxxxx</b></h5>
<p class="card-text">xxxxxxxxxxxxxxxx</p>
<p class="darbaip card-text">xxxxxxxxxxxxxxxxxxxxxxxxx</p>
</div>
</div>
</div>
</div>
These are just examples of what I'm working with. If needed I can post all HTML.

First you have to install a fresh wordpress site:
https://wordpress.org/support/article/how-to-install-wordpress/
Then, put your html code on themes/Twenty Nineteen/index.php inside
*Twenty Nineteen is the theme for default actually.
Thats all, you will see your website.
You need to learn wordpress to change the static data to dynamic
data, I recommend you learn about ACF Plugin and visit the Codex: https://codex.wordpress.org/Main_Page
good luck!

Related

Products Pulled in from JSON not displaying in a grid

I am pulling in content from a JSON file to populate a grid of products for an eCommerce website I'm working on. when the data loads it displays all the products in 1 column or (1 row) instead of in a grid. All the CSS for this part of from default Bootstrap 4 values. I need your assistance to go about this.
Thanks
Here is the code to display them on a page I called "products"
<div class="product container d-flex justify-content-center mt-50 mb-50">
<div class="card">
<div class="card-body">
<div class="card-img-actions"> <img src="{{product.imageUrl}}" class="card-img img-fluid" width="96" height="350" alt=""> </div>
</div>
<div class="card-body bg-light text-center">
<div class="mb-2">
<h6 class="font-weight-semibold mb-2"> <a routerLink="/products/{{product.id}}" class="text-default mb-2" data-abc="true">{{product.title}}</a> </h6>
</div>
<h3 class="mb-0 font-weight-semibold">{{product.price}}</h3>
Available in size: {{product.size}}
<button type="button" class="btn bg-cart"> Buy Now </button>
</div>
</div>
</div>
Then below is what I have on the products.components.html
<app-header></app-header>
<app-item *ngFor="let product of products" [product]= "product"></app-item>
<app-footer></app-footer>
This is the expected result I want to acheive
Here is what I am getting
enter image description here
I think you did not follow the bootstrap principles of how to construct a card grid.
When you put your .container class into the app-item, you will create a new container on each loop, which you don't want I guess. Instead you only want one container and then the cards as columns.
See https://getbootstrap.com/docs/5.1/components/card/#grid-cards
<app-header></app-header>
<div class="container">
<div class="row row-cols-md-3">
<ng-container *ngFor="let product of products">
<app-item [product]="product"></app-item>
</ng-container>
</div>
</div>
<app-footer></app-footer>
And in your app-item you only have columns.
<div class="product col">
<div class="card">
...
</div>
</div>

Bootstrap 4 text wrapping for containers

I am trying to get title text to wrap around a span object so far I have managed to get it to line up where I want everything but I just can't get the final part (the wrapping) to obey...I suspect it has something to do with the way that the text is in a different container but if I remove the container it upsets the rest of the formatting,
<div class="row px-3">
<div class="jumbotron">
<span class="float-right d-flex ">
<div class="align-self-center mr-1">Submitted by</div>
<div class="btn-group">
<button class="btn">User</button>
<button class="btn btn-info"></button>
<button class="btn btn-danger"></button>
</div>
</span>
<h1 class="d-flex">
<div id="title">A very long post title that needs to be long enough to see if the wrapping is working or not</div>
</h1>
<div id="body">a short body underneath the title</div>
</div>
</div>
JSFiddle of example code
As the title suggests I am using bootstrap 4. Any advice would be greatly appreciated...
I got your issue, basically, your usage of tags is not proper.
Element div not allowed as child of element span/h1 in this context.
Check the fiddle link out, it solves your problem. Fiddle
<div class="row px-3">
<div class="jumbotron">
<div class="float-right">
<div class="">Submitted by
</div>
<div class="btn-group">
<button class="btn">User</button>
<button class="btn btn-info"></button>
<button class="btn btn-danger"></button>
</div>
</div>
<p id="editor-title">A very long post title that needs to be long enough to see if the wrapping is working or not sdjfs dakjsd askjdhas dkjashd asdjkhasd askjdhas dasjdasdkjasd asdkjhasd djkf dfuieywrbewrgew weruwe</p>
<div id="editor-body">a short body underneath the title</div>
</div>
</div>
I would advise you to use W3C HTML checker.

apply flat edges to accordion only

I found this code where it can turn the cornes flat. It works well and all, but it turns everything straight. How do i just limit this to the accordion only. Ive try giving it an ID and applying to just that but it stops working when i do that. Can someone tell me the correct way. Thanks in advance!
* {
border-radius: 0 !important;
}
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="accordion" class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">1. What is HTML?</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">
<p>HTML stands for HyperText Markup Language. HTML is the standard markup language for describing the structure of web pages. Learn more.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">2. What is Bootstrap?</a>
</h4>
</div>
<div id="collapseTwo" class="panel-collapse collapse in">
<div class="panel-body">
<p>Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development. It is a collection of CSS and HTML conventions. Learn more.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">3. What is CSS?</a>
</h4>
</div>
<div id="collapseThree" class="panel-collapse collapse">
<div class="panel-body">
<p>CSS stands for Cascading Style Sheet. CSS allows you to specify various style properties for a given HTML element such as colors, backgrounds, fonts etc. Learn more.</p>
</div>
</div>
</div>
</div>
you need to specify the target elements. For example:
#accordion, #accordion * {
border-radius: 0 !important;
}
The above code will apply the css rule to the accordion and all of it's children.
On a slightly different note, I'm not sure exactly why you're using !important in this instance.

Make element always at center of element in bootstrap 3?

I have some center navigation that has always need to be in center, but that is not problem, the problem i have with some element that has to be always right of that element, how to add that this is what i have for now, it goes in accordian head
Here is boostrap 3 code
<div class="panel-heading">
<h4 class="panel-title text-right">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
Click Me
</a>
</h4>
</div>
What i need is something like this
The problem is that i dont know how many icons i would have, and they have always need to be at center of panel, and click me need to be at right?
If you want to achieve something like this, it is not very complicated. All you have to do is to set a default bootstrap accordion and set text-center insted of text-right. In this way if you place your icons they will be always aligned to center and after that you will use a <p style="float: right;">Click Me</p> in order to place your Click Me text in the right.
Here is the code:
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title text-center">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<img src="http://placehold.it/15x15">
<img src="http://placehold.it/15x15">
<img src="http://placehold.it/15x15">
<p style="float: right">Click me</p>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in">
<div class="panel-body">
DEMO TEXT HERE.
</div>
</div>
</div>
</div>
As you can see, i used 3 icons in this example, but you can add as many as you want and they all will be center aligned.

My columns keep smashing into each other

So I'm trying to have two jumbotrons indicating two portals into my site. On a medium-large screen they appear side by side with spacing in between. On a tablet or mobile device I would like the jumbotrons to be stacked. The docs on the bootstrap 3 make this automatically happen when I shrink the page, however this isn't happening to me. I'm not sure what i'm doing wrong, I'm really new to bootstrap. Right now when it becomes a medium sized screen the white space disappears and they get squeezed side by side.
My html looks like this:
<div class="container-fluid">
<div class="row">
<div class="container special">
<div class="clearfix visible-sx"></div>
<div class="jumbotron text-center col-md-5 col-md-offset-1">
<h1>Become a Screener</h1>
<p>Yahh a screener.</p>
<a class="btn btn-danger" href="{% url 'screener_info' %}">More Info</a>
</div>
<div class="jumbotron text-center col-md-5 col-md-offset-1">
<h1>Have your books screened</h1>
<p>yah an author.</p>
<a class="btn btn-success" href="{% url 'author_info' %}" role="button">More Info</a>
</div>
</div>
</div>
</div>
Try changing your code to this:
<div class="container-fluid">
<div class="row">
<div class="container special">
<div class="clearfix visible-sx"></div>
<div class="col-sm-5 col-md-offset-1">
<div class="jumbotron text-center">
<h1>Become a Screener</h1>
<p>Yahh a screener.</p>
<a class="btn btn-danger" href="{% url 'screener_info' %}">More Info</a>
</div>
</div>
<div class="col-sm-5 col-md-offset-1">
<div class="jumbotron text-center">
<h1>Have your books screened</h1>
<p>yah an author.</p>
<a class="btn btn-success" href="{% url 'author_info' %}" role="button">More Info</a>
</div>
</div>
</div>
</div>
</div>
Simply create a div around jumbotrons with md-5 and offset class.

Resources