Skip to content

Instantly share code, notes, and snippets.

// CUSTOM ADMIN LOGIN HEADER LOGO
function my_custom_login_logo()
{
echo '<style type="text/css"'> h1 a { background-image:url(' . get_stylesheet_directory_uri() . '/assets/images/logo_admin.png) !important; } '</style'>';
}
add_action('login_head', 'my_custom_login_logo');
add_filter( 'your-post-type_post_type_args', '_my_rewrite_slug' ); // Here replace "your-post-type" with the actual post type, e.g., "cherry_services", "cherry-projects"
function _my_rewrite_slug( $args ) {
$args['rewrite']['slug'] = 'our-services'; // Replace "our-services" with your preferable slug
return $args;
}
/**
* WooCommerce Extra Feature
* --------------------------
*
* Change number of related products on product page
* Set your own value for 'posts_per_page'
*
*/
function woo_related_products_limit() {
global $product;
<form method="get" action="http://www.google.com/search">
<div style="border:1px solid black;padding:4px;width:20em;">
<table border="0" align="center" cellpadding="0">
<tr><td>
<input type="text" name="q" size="25"
maxlength="255" value="" />
<input type="submit" value="Google Search" /></td></tr>
<tr><td align="center" style="font-size:75%">
<input type="radio" name="sitesearch" value="" />The Web
<input type="radio" name="sitesearch"
@Shininglow
Shininglow / extra.js
Created August 21, 2019 14:17
extra gutenberg block js
wp.blocks.registerBlockType('my_new-block', {
title: 'My Extra Block',
icon: 'heart',
category: 'common',
attributes: {
content: {type: 'string'}
},
edit: function(props) {
function somename(event) {
props.setAttributes({content: event.target.value})
@Shininglow
Shininglow / extra.php
Created August 13, 2019 15:15
For a new Gutenberg block
<?php
/**
*Plugin name: Extra
*Author: My name
*Version: 1.0.0
*/
function loadMyBlockFiles() {
wp_enqueue_script(
'my-test-text',
@Shininglow
Shininglow / responsive-blocks.css
Created July 9, 2019 09:17
responsive-blocks
@media (max-width: 764px) {
.wp-block-columns {
display: block;
}
}
@Shininglow
Shininglow / astra-footer.php
Created April 12, 2019 14:06
astra-footer.php
@Shininglow
Shininglow / astra-header.php
Created April 12, 2019 14:02
astra-header.php
<?php
$done=false;
if ( function_exists( 'jet_theme_core') ) {
$done = jet_theme_core() ->do_location( 'header' );
}
?>
<?php
if ( ! $done ) {
astra_header();
}
<header class="entry-header">
<?php $utility->attributes->get_title( array(
'class' => 'entry-title',
'html' => '<h3 %1$s>%4$s</h3>',
'echo' => true,
) );
?>
</header>