Skip to content

Logged In Logged out shortcodes

//logged in shortcode function check_user ($params, $content = null){ //check tha the user is logged in if ( is_user_logged_in() ){ //user is logged in so show the content return do_shortcode($content); } else{ //user is not logged in so hide the…

Mehr Lesen

Typography options

add_filter('wpex_typography_settings', function ($settings) { if (isset($settings['entry_h1'])) { $settings['entry_h1']['target'] = 'h1, .wpex-h1, .vcex-module h1, h1.vcex-heading'; } if (isset($settings['entry_h2'])) { $settings['entry_h2']['target'] = 'h2, .wpex-h2, .vcex-module h2, h2.vcex-heading'; } if (isset($settings['entry_h3'])) { $settings['entry_h3']['target'] = 'h3, .wpex-h3, .vcex-module h3, h3.vcex-heading'; } if (isset($settings['entry_h4'])) {…

Mehr Lesen

Siple Particles Shortcode

function particles_shortcode() { $particles = ' <style> #particles, .particles { overflow: hidden; } #particles canvas, .particles canvas { display: block; width: 1909px; height: 1103px; position: absolute; left: 0; top: 0; z-index: -2; pointer-events: none; } </style> <script async src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js" crossorigin="anonymous"></script>…

Mehr Lesen

Allow empty menuitems

//ALLOW EMPTY MENUTITLE WITH &nbsp; requires no-underline css add_action('wp_update_nav_menu', 'blank_menu_items'); function blank_menu_items($nav_menu_selected_id) { $navmenudata = json_decode(stripslashes($_POST['nav-menu-data']), true); $k = 0; foreach ((array) $navmenudata as $data) { if ( isset($data['name']) && isset($data['value']) && strpos($data['name'], 'menu-item-title') !== false ) { if (trim($data['value'])…

Mehr Lesen

Manually Add Matomo

function add_matomo_script() { ?> <!-- Matomo --> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//xxx.xxx.com/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', 'xxx']); var d=document, g=d.createElement('script'),…

Mehr Lesen

Accessibility Plugin

function a11y_controls_shortcode() { // Generate unique ID to prevent conflicts $unique_id = uniqid('a11y_'); ob_start(); ?> <div id="<?php echo esc_attr($unique_id); ?>" class="a11y-controls-container"> <div class="a11y-controls"> <button type="button" class="a11y-btn a11y-font-inc" aria-label="Increase Font Size">A+</button> <button type="button" class="a11y-btn a11y-font-dec" aria-label="Decrease Font Size">A-</button> <button type="button" class="a11y-btn…

Mehr Lesen

Add Header WITH PHP

I don't need this anymore but i want it to be backed up. This is fdor the Total theme and uses the dynamic templates functionality. //HEADER: HEADER AFTER TITLE/ BREADCRUMB NOT ON HOME function header_after() { if ( is_singular( 'projekt'…

Mehr Lesen

Rename Sidebar „Add New“ Label

In the Total theme i.e. for the portfolio or staff custom post types, the menu labels are not properly translated. This is how to fix this: add_filter('register_post_type_args', function($args, $post_type) { if ($post_type === 'portfolio') { $args['labels']['add_new'] = 'Neu'; $args['labels']['add_new_item'] =…

Mehr Lesen

Create WordPress user with PHPMyAdmin

Just change the according datafields in the following query to create the new user: INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) VALUES ('your username', MD5('your password'), 'your firstname & your lastname', 'your email', '0'); The new user now needs…

Mehr Lesen
An den Anfang scrollen