Posted on Leave a comment

Create a wordpress floating button with html and css

In this guide I will explain how you can create a wordpress floating button with plain css and html without using a plugin.

As you can see, I have added as a floating button my Udemy course regarding Azure DevOps and can be found on the right bottom corner.

In order to create such a button you will need to add a new Widget and select custom html.

Then you can paste the below code after modifying it for your case.

<div class="sticky-slider">
<a href="https://www.udemy.com/course/mastering-azure-devops-cicd-pipelines-with-yaml/" class="navi">Check out my Azure DevOps Udemy course</a>
</div>

<style>
	.navi, .navi:visited, .navi:active, .navi:hover {
  border:none !important;
  outline:none !important;
  text-decoration:none !important;
  color:#fff !important;
  -webkit-tap-highlight-color: white;
}
  
.sticky-slider {
  position: fixed;
  bottom: 0.5rem;
  border: none;
  border-radius: 30px;
  background-color: #a435f0;
  color: #fff;
  z-index: 10000;
  padding: 0.7rem 1.2rem;
  margin: 1rem 0;
  right: 1rem;
  font-size: 1rem;
  font-family: Calibri
  }
</style>
Posted on Leave a comment

Deploy wordpress with mysql in less than a minute using docker containers

For testing purposes I had to deploy a wordpress installation and perform some work. As the standalone installation with wamp/mamp/xampp software would require time, I chose docker and containers for the deployment.

You can use the below docker-compose.yml file and have a working site stack in less than a minute.

version: '3.1'

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: host.docker.internal
      WORDPRESS_DB_USER: root
      WORDPRESS_DB_PASSWORD: password
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - wordpress:/var/www/html

  db:
    image: mysql:latest
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: user1
      MYSQL_PASSWORD: password
      MYSQL_ROOT_PASSWORD: password
    ports:
      - 3306:3306
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:

You can run the above composer file with:

docker compose up -d

In order to access the new wordpress installation you should go to 0.0.0.0:8080 or localhost:8080

You can clone the code from the below repository:

https://github.com/geralexgr/wordpress-mysql-containers/