Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zmiana nagłówka oparta na języku
leatek2704
post 22.08.2015, 12:43:56
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 22.08.2015

Ostrzeżenie: (0%)
-----


  1. <?php global $wp_locale;
  2. if (isset($wp_locale)) {
  3. $wp_locale->text_direction = 'ltr';
  4. } ?>
  5. <!DOCTYPE html>
  6. <html <?php language_attributes(); ?>>
  7. <head>
  8. <meta charset="<?php bloginfo('charset') ?>" />
  9. <title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
  10. <!-- Created by Artisteer v4.1.0.59861 -->
  11. <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
  12. <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  13.  
  14. <link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" media="screen" />
  15. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  16. <?php
  17. remove_action('wp_head', 'wp_generator');
  18. if (is_singular() && get_option('thread_comments')) {
  19. wp_enqueue_script('comment-reply');
  20. }
  21. wp_head();
  22. ?>
  23. </head>
  24. <body <?php body_class(); ?>>
  25.  
  26. <div id="art-main">
  27. <div class="art-sheet clearfix">
  28.  
  29. <?php if(theme_has_layout_part("header")) : ?>
  30. <header class="art-header<?php echo (theme_get_option('theme_header_clickable') ? ' clickable' : ''); ?>"><?php get_sidebar('header'); ?></header>
  31. <?php endif; ?>
  32.  
  33. <div class="art-layout-wrapper">
  34. <div class="art-content-layout">
  35. <div class="art-content-layout-row">
  36. <div class="art-layout-cell art-content">
  37.  

Próbóje wstawić alternatywny odnośnik do header aby po zmianie języka zmienił się również header.
  1. <?php global $wp_locale;
  2. if (isset($wp_locale)) {
  3. $wp_locale->text_direction = 'ltr';
  4. } ?>
  5. <!DOCTYPE html>
  6. <html <?php language_attributes(); ?>>
  7. <head>
  8. <meta charset="<?php bloginfo('charset') ?>" />
  9. <title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
  10. <!-- Created by Artisteer v4.1.0.59861 -->
  11. <meta name="viewport" content="initial-scale = 1.0, maximum-scale = 1.0, user-scalable = no, width = device-width">
  12. <!--[if lt IE 9]><script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
  13.  
  14. <link rel="stylesheet" href="<?php bloginfo('stylesheet_url') ?>" media="screen" />
  15. <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  16. <?php
  17. remove_action('wp_head', 'wp_generator');
  18. if (is_singular() && get_option('thread_comments')) {
  19. wp_enqueue_script('comment-reply');
  20. }
  21. wp_head();
  22. ?>
  23. </head>
  24. <body <?php body_class(); ?>>
  25.  
  26. <div id="art-main">
  27. <div class="art-sheet clearfix">
  28.  
  29. <?php if(theme_has_layout_part("header")) : ?>
  30. <?php
  31. $mylocale1 = get_locale();
  32. $mylocale2 = get_bloginfo('language');
  33. $mylocale3 = $locale; // a WordPress Global variable
  34. if($mylocale1 == 'pl_PL') echo <header class="art-header<?php echo (theme_get_option('theme_header_clickable') ? ' clickable' : ''); ?>"><?php get_sidebar('header'); ?></header>;
  35. if($mylocale1 == 'de_DE') echo <header class="art-headerde<?php echo (theme_get_option('theme_header_clickable') ? ' clickable' : ''); ?>"><?php get_sidebar('header'); ?></header>;
  36. <?php endif; ?>
  37.  
  38. <div class="art-layout-wrapper">
  39. <div class="art-content-layout">
  40. <div class="art-content-layout-row">
  41. <div class="art-layout-cell art-content">
  42.  

próbowłem tego kodu ale nie mogę dojść do ładu w którym miejscu go podpiąć w pliku style.css zrobiłem dwie zmienne do wóch obrazów tylko nie moge wywołać ich z header.php
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.06.2025 - 07:43