Skip to content

Instantly share code, notes, and snippets.

@cre8tivediva
cre8tivediva / functions.php
Created September 10, 2024 17:04
Make forward facing links clickable (WordPress)
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Make forward facing links clickable
//* https://developer.wordpress.org/reference/functions/make_clickable/
add_filter( 'the_content', 'make_clickable' );
@cre8tivediva
cre8tivediva / functions.php
Created May 31, 2024 18:06
Inject Genesis SEO title and meta description into WooCommerce Shop page
// By default, when using Genesis' SEO settings (not a plugin like Yoast or Rankmath), the title and meta description will not show up and will not display the new title name on the browser tab. Code provided by ChatGPT, tested and works.
// Inject Genesis SEO title and meta description into WooCommerce Shop page
add_action('wp_head', 'custom_shop_page_meta', 1);
function custom_shop_page_meta() {
if (is_shop()) {
$shop_page_id = wc_get_page_id('shop');
// Retrieve Genesis title and meta description
$shop_title = get_post_meta($shop_page_id, '_genesis_title', true);
@cre8tivediva
cre8tivediva / functions.php
Last active May 28, 2024 03:43
Rename the Genesis Portfolio Slug
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Updated 5/26/2024 to reflect changes to the plugin
function rename_portfolio_custom_post_type_slug() {
// Get the post type object
$post_type_object = get_post_type_object( 'portfolio' );
// Convert the post type object to an array to manipulate its arguments
$args = (array) $post_type_object;
@cre8tivediva
cre8tivediva / functions.php
Created October 14, 2023 14:00
Change the logo and url on the login page
// Update the login logo with the custom header image
function custom_login_logo() {
// Get the header image from the Customizer
$header_image = get_header_image();
if (!$header_image) {
return;
}
// Styles to replace the WordPress logo with the custom header image
@cre8tivediva
cre8tivediva / additional.css
Created January 15, 2022 01:52
Custom Style for Genesis Simple Share
/* Genesis Simple Share - uses Genericons
--------------------------------------------- */
/* Centers the icons */
.share-before, .share-after {
overflow: auto;
text-align: center;
}
.sharrre {
@cre8tivediva
cre8tivediva / additional.css
Last active September 1, 2021 05:08
Use Genesis Simple Share with Genesis Blocks Post/Page Grid until Script Error has been fix
/* Set the alignment of the Genesis Simple Share Icons
-------------------------------------------------------- */
.sharre-icon-wrap {
margin: 20px 0;
text-align: center;
}
@cre8tivediva
cre8tivediva / page_blog.php
Created August 7, 2021 00:59 — forked from studiopress/page_blog.php
Genesis page content on blog template.
<?php
//* Template Name: Blog
//* Show page content above posts
add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
genesis();
@cre8tivediva
cre8tivediva / style.css
Last active June 24, 2021 11:21
Display Blog Posts in Grid on Blog Page Genesis without a Plugin
/* Create a page called Blog.
Go to Layout Settings. Add the word "blog" (without quotes) to the Custom Body Class, then Save.
Add the following code to the stylesheet or to the Additional CSS Box.
*/
/* Blog Page Grid Layout
-----------------------------------------------------*/
.blog .content .entry {
border:0;
float:left;
@cre8tivediva
cre8tivediva / functions.php
Last active January 16, 2021 18:40
Force full width layout on search resuls page
//* Force Full Width Layout on Search Results Pages
function c8d_posts_full_layout() {
if( is_search () ){
return 'full-width-content';
}
}
add_filter( 'genesis_site_layout', 'c8d_posts_full_layout' );
@cre8tivediva
cre8tivediva / dequeue-script-example.php
Created January 6, 2021 21:05 — forked from helgatheviking/dequeue-script-example.php
Code snippet for dequeing a script on the single produt page
function kia_unload_script() {
if ( function_exists( 'is_product' ) && is_product() ) {
wp_dequeue_script( 'wc-single-product' );
}
}
add_action( 'wp_enqueue_scripts', 'kia_unload_script', 20 );