Skip to content

Commit

Permalink
distinguish localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
openmindculture committed Nov 14, 2023
1 parent 6b5980f commit 2c0d432
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
define( 'KLEIDERORDNUNG_is_stage', str_contains(KLEIDERORDNUNG_URI, 'stage') );
}

if ( ! defined( 'KLEIDERORDNUNG_is_localhost' ) ) {
define( 'KLEIDERORDNUNG_is_localhost',
str_contains(KLEIDERORDNUNG_URI, '/localhost') ||
str_contains(KLEIDERORDNUNG_URI, '/bs-local.com')
);
}

require_once( KLEIDERORDNUNG_DIR . '/inc/functions/add-theme-support.php' );
require_once( KLEIDERORDNUNG_DIR . '/inc/functions/customize-admin-ui.php' );
require_once( KLEIDERORDNUNG_DIR . '/inc/functions/customize-frontend.php' );
Expand Down
3 changes: 3 additions & 0 deletions src/inc/functions/customize-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
if (KLEIDERORDNUNG_is_stage) {
$classes[] = 'stage';
}
if (KLEIDERORDNUNG_is_localhost) {
$classes[] = 'localhost';
}
return $classes;
} );

Expand Down
2 changes: 1 addition & 1 deletion src/inc/structure/html-head.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<script defer src="<?php echo get_template_directory_uri() ?>/js/lottie-player.js?v=1.7.1" id="lottie-player-script"></script>
<meta name="description" content="<?php _e( 'Stilberatung, Shoppingbegleitung und Kleiderschrank-Check in Berlin (Meta Description frei übersetzen)', 'kleiderordnung' ) ?>">
<meta name="keywords" content="<?php _e( 'Slow Fashion,Circular Fashion,nachhaltige Mode, Nachhaltigkeit (Meta Keywords frei übersetzen)', 'kleiderordnung' ) ?>">
<?php if (KLEIDERORDNUNG_is_stage) { ?>
<?php if (KLEIDERORDNUNG_is_stage || KLEIDERORDNUNG_is_localhost) { ?>
<meta name="robots" content="noindex,nofollow">
<?php } else { ?>
<meta name="robots" content="index,follow">
Expand Down

0 comments on commit 2c0d432

Please sign in to comment.