Skip to content

Instantly share code, notes, and snippets.

View munirkamal's full-sized avatar
🎯
Focusing

Munir Kamal munirkamal

🎯
Focusing
View GitHub Profile
@munirkamal
munirkamal / core-blocks.txt
Created September 23, 2020 09:17
List of Core Gutenberg Blocks
archives
audio
button
categories
code
column
columns
coverImage
embed
file
@munirkamal
munirkamal / custom_paragraph_block_placeholder_for_pages.php
Created September 24, 2020 10:32
Gutenberg Snippet: Modify the first paragraph block added by default on pages with a custom placeholder text
function custom_paragraph_placeholder_for_pages() {
//Define your post types to lock for classic editor block. Default CPTs are 'post', 'page'
$post_type_object = get_post_type_object( 'page' );
//Define what blocks you want to lock it for. Here is the list of core blocks:
//https://gist.github.com/munirkamal/0d443605a3273926051c2971d5f3ff84#file-core-blocks-txt
$post_type_object->template = array(
array( 'core/paragraph', array(
'placeholder' => 'my placeholder...',
@munirkamal
munirkamal / galleryblock-stack-mobile.css
Created December 14, 2020 08:46
CSS snippet to make gallery block stack on mobile
@media screen and (max-width: 500px) {
.wp-block-gallery .blocks-gallery-item {
width: 100%!important;
margin-right: 0;
}
}
@munirkamal
munirkamal / sumo-snip.js
Created April 9, 2022 10:06
Modify the text of the 'Read more' button in Post Grid Module from Divi Sumo
<script>
var buttons = document.querySelectorAll('.cwp_post_grid .et_pb_button_module_wrapper .et_pb_button');
buttons.forEach((button) => {
button.innerHTML = "Change Button Text Here";
return button;
});