This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Konkretes Beispiel: Alle <h2> in single posts werden über die Funktion span_headers replaced und es kommt <h2 class="yellow_highlight"><span> ... raus. | |
function fdp_highlight_headers ( $content ) { | |
if ( is_single() ) { | |
// $content = str_replace('Rico Apitz', 'Oliver Gehrmann', $content); | |
return span_headers('h2', $content); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'fdp_highlight_headers', 99); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hidden-row { | |
height: 0; | |
opacity: 0; | |
padding: 0; | |
position: absolute; | |
transition: opacity 0s ease, padding 500ms ease, visibility ease 500ms; | |
visibility: hidden; | |
} | |
.hidden-row:not(.active) { | |
left: 50%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add JavaScript file 'my-script-filename.js' (located in the child theme directory /js) to WordPress (in the footer) | |
function add_my_own_scripts() { | |
wp_register_script('my-script', get_stylesheet_directory_uri() . '/js/my-script-filename.js', '', '1.0', true); | |
wp_enqueue_script('my-script'); | |
} | |
add_action( 'wp_enqueue_scripts', 'add_my_own_scripts' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Per Filter in der functions.php den max-Wert für die Bildauflösungen im Blog-Modul anpassen: | |
function nxt_overwrite_divi_cropping($width) { | |
return 2600; | |
} | |
add_filter( 'et_pb_blog_image_width', 'nxt_overwrite_divi_cropping' ); | |
add_filter( 'et_pb_blog_image_height', 'nxt_overwrite_divi_cropping' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Add polylang to Divi Library Window */ | |
function cedura_pll_get_post_types($types) { | |
return array_merge($types, ['et_pb_layout' => 'et_pb_layout']); | |
} | |
add_filter('pll_get_post_types', 'cedura_pll_get_post_types'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add a Metabox to the backend | |
function frosted_add_custom_header_metabox() { | |
add_meta_box("frosted-custom-header", "Hintergrundfarbe der Navigation", "frosted_custom_header", "page", "side", "high", null); | |
} | |
add_action("add_meta_boxes", "frosted_add_custom_header_metabox"); | |
// Fill Metabox with our custom variable | |
function frosted_custom_header() { | |
wp_nonce_field(basename(__FILE__), "frosted-custom-header-metabox-nonce"); | |
if(get_post_meta(get_the_ID(), '_frosted_header_selection', true) != '') { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disables the block editor from managing widgets in the Gutenberg plugin. | |
add_filter( 'gutenberg_use_widgets_block_editor', '__return_false', 100 ); | |
// Disables the block editor from managing widgets. | |
add_filter( 'use_widgets_block_editor', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// We are adding custom bulk actions in the WP Admin Backend for the post type "message" | |
function dc_custom_bulk_actions( $bulk_array ) { | |
$message_status_fields = get_field_object('field_5f3ba86a9409e'); | |
// echo '<!-- nxt debug --><pre>'; print_r($message_status_fields); echo '</pre>'; | |
foreach($message_status_fields['choices'] as $status_option_key => $status_option_value) { | |
$bulk_array[$status_option_key] = 'Set message status to ' . $status_option_key; | |
} | |
return $bulk_array; | |
} | |
add_filter( 'bulk_actions-edit-message', 'dc_custom_bulk_actions' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add more colums to the listing of messages in the backend | |
*/ | |
function nxt_more_columns($columns) { | |
$columns = [ | |
'cb' => '<input type="checkbox" />', | |
'title' => __('Title', 'nxt-acf-forms'), | |
'cf_category' => __('Category', 'nxt-acf-forms'), | |
'cf_email' => __('E-Mail', 'nxt-acf-forms'), | |
'cf_tel' => __('Telephone', 'nxt-acf-forms'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* For styling the rendered Markdown */ | |
h1 { margin-top: 45px; } | |
ul + *, * + table { margin-top: 30px; } | |
hr { margin: 30px 0; } | |
ul li.md-checkbox label.checkbox-label-checked { text-decoration: line-through; } |