• Skip to primary navigation
  • Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

WP

Disable Gutenberg

by Ulysses · Feb 27, 2021

Two years ago, WordPress introduced Gutenberg block editor together with the release of WordPress version 5.0. Gutenberg essentially became the default editor starting with WordPress version 5.0. While many people love the Gutenberg editor, some people hate it. If you’re one of the many people who hate the Gutenberg editor, you can simply disable it by installing a plugin called Disable Gutenberg. This plugin will revert back to the classic editor.

Once installed, you should be able to see the Classic editor.

After working with Gutenberg for so long, I forgot the speed and agility of the classic editor. It’s much faster.

Filed Under: WP Tagged With: classic, disable, editor, gutenberg, wordpress

WordPress Read Only

by Ulysses · Nov 29, 2020

Here’s how to create a WordPress site that’s read only. You will not be able to create, update and delete posts.

  1. Login to MySQL or MariaDB.
  2. Choose mysql database.
  3. Create a new user called ‘wpro’ for WordPress read only.
  4. Grant select permissions to all tables in ‘wordpress’ database.
  5. Flush privileges to commit your changes.
mariadb -u root -p
use mysql;
create user 'wpro'@'localhost' identified by 'yourpassword';
grant select on wordpress.* to 'wpro'@'localhost';
flush privileges;

mariadb -u root -p use mysql; create user 'wpro'@'localhost' identified by 'yourpassword'; grant select on wordpress.* to 'wpro'@'localhost'; flush privileges;

In MySQL or MariaDB, you have to terminate all commands with a semicolon.

Now edit your WordPress wp-config.php file. vim /var/www/wordpress/wp-config.php.

/** MySQL database username */
define('DB_USER', 'wpro');
 
/** MySQL database password */
define('DB_PASSWORD', 'yourpassword');

/** MySQL database username */ define('DB_USER', 'wpro'); /** MySQL database password */ define('DB_PASSWORD', 'yourpassword');

After saving the wp-config.php file, everything should work just like before, except that you will not be able to save, publish or delete posts, pages, or add or delete media files to your WordPress site. It’s working as intended.

Filed Under: Linux, WP Tagged With: create, grant, mariadb, mysql, read-only, select, user

Disable Post Title in Genesis

by Ulysses · Sep 13, 2020

Here’s how to disable the post title in Genesis WordPress themes. Add code in themes.php.

add_filter( 'genesis_link_post_title', '__return_false' );

add_filter( 'genesis_link_post_title', '__return_false' );

Filed Under: WP Tagged With: disable, genesis, link, post, theme, title, wordpress

Custom Breadcrumbs

by Ulysses · Sep 13, 2020

I’ve customized my breadcrumbs. Add code to functions.php.

add_filter('genesis_breadcrumb_args', 'customize_breadcrumbs');
function customize_breadcrumbs($args) {
    $args['labels']['prefix'] = 'Home';
    $args['home'] = '';
    $args['sep'] = '/';
    return $args;
}

add_filter('genesis_breadcrumb_args', 'customize_breadcrumbs'); function customize_breadcrumbs($args) { $args['labels']['prefix'] = 'Home'; $args['home'] = ''; $args['sep'] = '/'; return $args; }

Now it doesn’t say Home/Home on the front page.

Filed Under: WP Tagged With: breadcrumbs, customize, wordpress

Center Search Widget

by Ulysses · Aug 1, 2020

Here’s how to center the Search widget in a WordPress Page or a post. This applies only if you’re using the default Search Widget. Div classes may vary based on theme being used. The CSS example below may not work for your theme. Check your theme’s source code to be sure.

.entry-content .wp-block-search {
  display:block;
  margin-left:auto;
  margin-right:auto;
  text-align: center;
}
.entry-content .wp-block-search label {
  display:none;
}
.entry-content .wp-block-search input {
  width:250px;
}

.entry-content .wp-block-search { display:block; margin-left:auto; margin-right:auto; text-align: center; } .entry-content .wp-block-search label { display:none; } .entry-content .wp-block-search input { width:250px; }

The CSS above centers the search block. It suppresses the search label, and finally sets the form’s input to a fixed width of 250px.

Filed Under: WP Tagged With: center, class, css, div, search, wordpress

Revolution Theme

by Ulysses · Jul 26, 2020

I’m now using the Revolution theme from StudioPress. It’s a minimal design with lots of whitespace. The default font is Playfair Display which highlights headlines and blockquotes. The Playfair Display is available from Google Fonts if you’re interested. I think it’s a perfect theme for a photography blog. Although the theme seems to invite you to write more, something I haven’t been doing lately. And before I sign off, let’s take a look at what a blockquote looks like. Not bad at all. A beautiful theme.

It’s a minimal design with lots of whitespace.

By Studiopress

Filed Under: WP Tagged With: revolution, studiopress, theme, wordpress

Genesis Footer

by Ulysses · Jul 25, 2020

Here’s how to display Copyright years in the footer section if you’re using the Genesis theme.

[footer_copyright first="2002"]

[footer_copyright first="2002"]

Result:

Copyright © 2002–2020

Copyright © 2002–2020

The current year is dynamic. It will display 2021 a year from now. The first year is always fixed.

Filed Under: WP Tagged With: copyright, custom, footer, genesis, wordpress, year

WordPress Posts Revision

by Ulysses · Jun 18, 2020

How to turn on post revisions in WordPress. Edit wp-config.php.

/** WordPress Revisions */
define('WP_POST_REVISIONS', false);

/** WordPress Revisions */ define('WP_POST_REVISIONS', false);

Change to:

/** WordPress Revisions */
define('WP_POST_REVISIONS', 10);

/** WordPress Revisions */ define('WP_POST_REVISIONS', 10);

10 is the number of revisions you want to keep.

Filed Under: WP Tagged With: keep, number of posts, post, revisions

PHP Modules

by Ulysses · May 7, 2020

Here are some missing PHP modules on my WordPress install.

apt install php-gd php-dom php-mbstring php-imagick php-zip

apt install php-gd php-dom php-mbstring php-imagick php-zip

Reboot Apache after the install.

systemctl restart apache2

systemctl restart apache2

Filed Under: PHP, WP Tagged With: dom, gd, imagick, mbstring, modules, zip

WordPress Salt

by Ulysses · Jan 24, 2020

Here’s a quick way to autogenerate salt for WordPress.

curl -s https://api.wordpress.org/secret-key/1.1/salt/

curl -s https://api.wordpress.org/secret-key/1.1/salt/

Filed Under: WP Tagged With: autogenerate, generate, salt, wordpress

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 6
  • Go to Next Page »

Copyright © 2012–2021