Wordpress šablona - 403 forbidden nginx

Místo pro dotazy a rady ohledně programovacích jazyků (C++, C#, PHP, ASP, Javascript, VBS..) a tvorby webových stránek

Moderátor: Mods_senior

Uživatelský avatar
Arha
Level 4.5
Level 4.5
Příspěvky: 1826
Registrován: červen 11
Bydliště: Dačice
Pohlaví: Muž
Stav:
Offline

Wordpress šablona - 403 forbidden nginx

Příspěvekod Arha » 15 kvě 2014 19:41

Dobrý večer,
nakonec jsem se rozhodl založit si stránku pomocí WP šablony. Vše běží jak má, až na jeden problém. Nahoře se mi pořád ukazuje 403 forbidden a pod ním nginx (viz. příloha). Pročítal jsem pár diskuzí, ale jsem začátečník a nevím si rady. Pokud by tu někdo chtěl kus nějakého kódu, stačí říci. Předem díky
Přílohy
Nepojmenovaný 2.png
I skladník ve šroubárně si může psát vlastní SQL příkazy.

Reklama
Uživatelský avatar
LuCaCZ
Level 3.5
Level 3.5
Příspěvky: 929
Registrován: březen 11
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod LuCaCZ » 15 kvě 2014 20:10

1) aktualizuj WP/pluginy/šablonu - vidím, že tam jsou nějaké 4 čekající aktualizace
2) co je to za šablonu? není v tom prostoru nějaká reklama?

Uživatelský avatar
Arha
Level 4.5
Level 4.5
Příspěvky: 1826
Registrován: červen 11
Bydliště: Dačice
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod Arha » 15 kvě 2014 20:24

Ty 4 aktualizace jsou jen šablony, které tam jsou přednastavené..
Není, ta šablona má být až nahoře, viz.
Přílohy
12.png
I skladník ve šroubárně si může psát vlastní SQL příkazy.

Uživatelský avatar
LuCaCZ
Level 3.5
Level 3.5
Příspěvky: 929
Registrován: březen 11
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod LuCaCZ » 15 kvě 2014 20:33

tak je smaž

a adresa webu? ať se mrknu co to tam dělá

Uživatelský avatar
Arha
Level 4.5
Level 4.5
Příspěvky: 1826
Registrován: červen 11
Bydliště: Dačice
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod Arha » 15 kvě 2014 20:40

Čerstvě nahraná šablona..
Naposledy upravil(a) Arha dne 15 kvě 2014 21:19, celkem upraveno 1 x.
I skladník ve šroubárně si může psát vlastní SQL příkazy.

Uživatelský avatar
LuCaCZ
Level 3.5
Level 3.5
Příspěvky: 929
Registrován: březen 11
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod LuCaCZ » 15 kvě 2014 20:50

zkus postupně vypínat pluginy jestli to nějaký nedělá

Uživatelský avatar
Arha
Level 4.5
Level 4.5
Příspěvky: 1826
Registrován: červen 11
Bydliště: Dačice
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod Arha » 15 kvě 2014 20:52

Žádný plugin nemám.. Je to prý chyba někde v php nebo co jsem četl, proto bych se někoho z vás zeptal, zdali můžu poslat php šablony :-)
I skladník ve šroubárně si může psát vlastní SQL příkazy.

Uživatelský avatar
LuCaCZ
Level 3.5
Level 3.5
Příspěvky: 929
Registrován: březen 11
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod LuCaCZ » 15 kvě 2014 21:41

zkus sem dát soubor header.php a možná i functions.php

Uživatelský avatar
Arha
Level 4.5
Level 4.5
Příspěvky: 1826
Registrován: červen 11
Bydliště: Dačice
Pohlaví: Muž
Stav:
Offline

Re: Wordpress šablona - 403 forbidden nginx

Příspěvekod Arha » 15 kvě 2014 21:49

Header

Kód: Vybrat vše

<?php
global $themedir, $pego_prefix;
?>
<!DOCTYPE HTML>
<html <?php language_attributes(); ?>>
<head>
   <title><?php wp_title('|', true, 'right'); ?><?php bloginfo('name'); ?></title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
       
   <!-- for mobile devices -->
   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
   
   <!-- Meta Tags -->
   <meta charset="UTF-8" />
   
    <!-- Favicon Icon -->
    <link rel="shortcut icon" href="<?php echo get_option($pego_prefix.'favicon'); ?>" type="image/vnd.microsoft.icon"/>
    <link rel="icon" href="<?php echo get_option($pego_prefix.'favicon'); ?>" type="image/x-ico"/>   
   
   
    <!--[if lt IE 9]>
     <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    <![endif]-->
   <!--[if lt IE 8]>
      <div style=' clear: both; text-align:center; position: relative;'></div>
   <![endif]-->
   
        <!-- start for google maps -->   
   <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>               
   <script type="text/javascript">
         (function() {
            window.onload = function(){
               var pinkParksStyles = '';
            var pinkMapType = new google.maps.StyledMapType(pinkParksStyles,
               {name: "Our Location"});
            var mapOptions = {
               zoom: 11,
               center: new google.maps.LatLng(<?php echo get_option($pego_prefix.'lat'); ?>, <?php echo get_option($pego_prefix.'lng'); ?>),
               mapTypeControlOptions: {
               mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'pink_parks']
               }
            };
            var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
              map.mapTypes.set('pink_parks', pinkMapType);
              map.setMapTypeId('pink_parks');
 
            
            var marker = new google.maps.Marker({
               position: new google.maps.LatLng(<?php echo get_option($pego_prefix.'lat'); ?>, <?php echo get_option($pego_prefix.'lng'); ?>),
               map: map
            });
            }
         })();

   </script>
   <!-- end for google maps -->
   <script type="text/javascript">
   var isResponsive = '<?php echo "NotResponsive"; ?>';
   </script>      

               
   <!-- Fonts -->
   <?php include("functions/fonts.php"); ?>
         
   <?php wp_enqueue_script('jquery'); ?>
   <?php wp_head(); ?>
   
   
   <link href="<?php echo get_template_directory_uri(); ?>/style.css" rel="stylesheet">
   
   <?php
         if (get_option($pego_prefix.'responsive_theme') != 'false') {
         ?>
            <script type="text/javascript">
               isResponsive = '<?php echo "AmResponsive"; ?>';
            </script>
            <link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/media.css">
         <?php
         }   
   ?>   
   <!-- custom CSS -->
   <?php include("functions/customCssAdd.php"); ?>
</head>
<body <?php body_class(); ?>>
<script type="text/javascript">
var isSingle = '<?php echo "NisemSingle"; ?>';
</script>

<?php
$linkForHome='#close';
if (is_single()) {
   $linkForHome='http://trendis.si/wp-themes/projectus/#!/';
?>
<script type="text/javascript">
   isSingle = '<?php echo "SemSingle"; ?>';
</script>
<?php
}
?>
   <div class="spinner"></div>
    <div id="bgStretch">
   <?php
   $bg_image_strech = get_template_directory_uri().'/images/bg_pic1.jpg';
   if(get_option($pego_prefix.'bg_image_strech') != '') {
      $bg_image_strech = get_option($pego_prefix.'bg_image_strech');
   }
   ?>   
   
        <img src="<?php echo $bg_image_strech; ?>" alt="" />
    </div>
    <div id="glob">
       
        <!-- CONTENT -->
        <section id="content">
            <div id="leftPanel">
                <div class="subLeftPanel">
                    <!-- HEADER -->
                    <header>
               <div class="logoWrapper">
               <?php
               $url_home='#!/';
               if (!is_front_page()){
                      $url_home = get_option("siteurl")."#!/";
               }
               if (get_option($pego_prefix.'logo')) { ?>
                  <h1 style="text-align:center;"><a href="<?php echo $url_home; ?>" id="logo"><img src="<?php echo get_option($pego_prefix.'logo'); ?>" alt="" /></a></h1>
               <?php }
                  else {
               ?>
               <h1 style="text-align:center;"><a href="<?php echo $url_home; ?>" id="logo"><img src="<?php echo get_template_directory_uri(); ?>/images/logo.png" alt="" /></a></h1>
               <?php
               }
               ?>
               </div>
               
                    </header>
                    <!-- END HEADER -->
                    <!-- MENU -->
               
                  <?php pego_nav(); ?>
               
                    <!-- END MENU -->
                    <!-- FOOTER -->
                    <div id="footer">
               <?php
                  echo get_option($pego_prefix.'left_side_area_content');
               ?>

                </div>
                    <!-- END FOOTER -->
                </div>
            </div>


Functions

Kód: Vybrat vše

<?php

   /* for translating */
   load_theme_textdomain( 'pego_tr', get_template_directory() . '/languages' );
   include'functions/class.php';

   /* remove all p tags thats creates by themselfs */
   //remove_filter('the_excerpt', 'wpautop');
   remove_filter('the_content', 'wpautop');
   //remove_filter('comment_text', 'wpautop');
   

   $pego_prefix="pego_";
   $themedir = get_template_directory_uri();
   

   function my_javascripts() {
      /*wp_enqueue_script('jquery-color', get_template_directory_uri() . '/js/jquery.color.js','','',true);   */
      wp_enqueue_script('jquery-backgroundpos', get_template_directory_uri() . '/js/jquery.backgroundpos.js','','',true);
      wp_enqueue_script('jquery-easing', get_template_directory_uri() . '/js/jquery.easing.js','','',true);
      wp_enqueue_script('slides-min-jquery', get_template_directory_uri() . '/js/slides.min.jquery.js','','',true);
      wp_enqueue_script('jquery-mousewheel', get_template_directory_uri() . '/js/jquery.mousewheel.js','','',true);
      wp_enqueue_script('jquery-fancybox', get_template_directory_uri() . '/js/jquery.fancybox-1.3.4.pack.js','','',true);
      wp_enqueue_script('jquery-ui-1.8.11', get_template_directory_uri() . '/js/jquery-ui-1.8.11.custom.min.js','','',true);
      wp_enqueue_script('cScroll', get_template_directory_uri() . '/js/cScroll.js','','',true);
      wp_enqueue_script('superfish', get_template_directory_uri() . '/js/superfish.js','','',true);
      wp_enqueue_script('switcher', get_template_directory_uri() . '/js/switcher.js','','',true);
      wp_enqueue_script('bgStretch', get_template_directory_uri() . '/js/bgStretch.js','','',true);
      
      wp_enqueue_script('sImg', get_template_directory_uri() . '/js/sImg.js','','',true);
      wp_enqueue_script('jquery-mobilemenu', get_template_directory_uri() . '/js/jquery.mobilemenu.js','','',true);
      /*wp_enqueue_script('MathUtils', get_template_directory_uri() . '/js/MathUtils.js','','',true);*/
      wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js','','',true);
      wp_enqueue_script('jquery-isotope-min', get_template_directory_uri() . '/js/jquery.isotope.min.js','','',true);
   }
   add_action('wp_enqueue_scripts', 'my_javascripts');
   
   
   function theme_styles() 
   {
     wp_enqueue_style( 'google-font-style', 'http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300', array(), '1.0', 'all' );
     wp_enqueue_style( 'reset-style', get_template_directory_uri() . '/css/reset.css', array(), '1.0', 'all' );
     wp_enqueue_style( 'jquery-style', get_template_directory_uri() . '/css/jquery.fancybox-1.3.4.css', array(), '1.0', 'all' );
     wp_enqueue_style( 'layout-style', get_template_directory_uri() . '/css/layout.css', array(), '1.0', 'all' );
   /*
    wp_enqueue_style( 'css-style', get_template_directory_uri() . '/style.css', array(), '1.0', 'all' );
     
   if (get_option($pego_prefix.'responsive_theme') != 'false') {
       wp_enqueue_style( 'media-style', get_template_directory_uri() . '/css/media.css', array(), '1.0', 'all' );
     }   
   */
    
   }
   add_action('wp_enqueue_scripts', 'theme_styles');
   
   
   
   /* start menu */
   function pego_addmenu() {
      register_nav_menus(
         array(
            'main_nav' => 'The Main Menu',
         )
      );
   }

   add_action( 'init', 'pego_addmenu' );

   function pego_nav() {
      if ( function_exists( 'wp_nav_menu' ) )
         wp_nav_menu( 'menu=main_nav&menu_id=menu&fallback_cb=pego_nav_fallback' );
      else
         pego_nav_fallback();
   }

   function pego_nav_fallback() {
      echo '<nav class="menu">';
            echo   '<ul id="menu">';
            
                  $page_argss = array('parent' => 0,'sort_order' => 'ASC', 'sort_column' => 'menu_order');
                  $pagess = get_pages($page_argss);
                  $numberOfPages=0;

                  foreach ($pagess as $single_pagee) {
                     $pageIdd=$single_pagee->ID;
                     $show_page_in_menuu =  get_post_meta($pageIdd , 'show_page_in_menu' , true);
                     if($show_page_in_menuu != 'No') {
                           $numberOfPages++;
                     }
                  }
   
               $page_args = array('parent' => 0,'sort_order' => 'ASC', 'sort_column' => 'menu_order');
               $pages = get_pages($page_args);
               foreach ($pages as $single_page) {
                     $trenutni="";
                     $pageId=$single_page->ID;
                     $children = get_pages('child_of='.$pageId.'&sort_column=menu_order&parent='.$pageId);
                     
                     $external_link =  get_post_meta($pageId , 'external_link' , true);
                     $page_template =  get_post_meta($pageId , 'page_template' , true);
                     $show_page_in_menu =  get_post_meta($pageId , 'show_page_in_menu' , true);
                  
                     $trenutni='';
                     global $blogReturn;
                     if($page_template=='Blog') {$blogReturn= get_option("siteurl")."#!/".$single_page->post_name;}
                     if(($page_template=='Blog')&&(is_single())){ $trenutni="class='markBlogAsActive'"; }   
                     $url_tab='#!/';
                     if (!is_front_page()){
                      $url_tab = get_option("siteurl")."#!/";
                     }
                     if($show_page_in_menu != 'No')
                     {
                                 
                        if(count($children) == 0){ 
                           if ($external_link == '') {
                              if ($page_template == 'Home') {
                                    echo '<li><a href="'.$url_tab.'">' . $single_page->post_title . '</a></li>';
                              }
                              else {
                              
                                 echo '<li '.$trenutni.' ><a href="'.$url_tab.''.$single_page->post_name .'">' . $single_page->post_title . '</a></li>';
                            }
                           }
                           else
                           if ($external_link == '#') {
                              echo '<li><a href="'.$url_tab.'#">' . $single_page->post_title . '</a></li>';
                           }
                           else
                           {
                              echo '<li><a href="'.$external_link.'">' . $single_page->post_title . '</a></li>';
                           }
                        }
                        if(count($children) != 0){ 
                           if ($external_link == '') {
                              if ($page_template == 'Home') {
                                 echo '<li  class="with_ul"><a href="'.$linkForHome.'">' . $single_page->post_title . '</a>';
                              }
                              else {
                                 echo '<li  class="with_ul"><a href="'.$url_tab.''.$single_page->post_name .'">' . $single_page->post_title . '</a>';
                              }
                                 
                           }
                           else
                           if ($external_link == '#') {
                              echo '<li  class="with_ul"><a href="'.$url_tab.'#">' . $single_page->post_title . '</a>';
                           }
                           else {
                              echo '<li  class="with_ul"><a href="'.$external_link.'">' . $single_page->post_title . '</a>';
                           }
                           echo '<ul class="submenu">';
                           foreach($children as $child)
                           {
                              $subPageId=$child->ID;
                              $grandChildren = get_pages('child_of='.$subPageId.'&sort_column=menu_order&parent='.$subPageId);
                              $subPage_external_link =  get_post_meta($subPageId , 'external_link' , true);
                              
                                 if ($subPage_external_link == '') {
                                    echo  '<li><a href="'.$url_tab.''.$child->post_name.'">'.$child->post_title.'</a></li>';
                                 }
                                 else
                                 {
                                    echo  '<li><a href="'.$subPage_external_link.'">'.$child->post_title.'</a></li>';
                                 }
                              
                           
                     
                           }
                           echo '</ul>';
                           echo '</li>';
                        
                        }
                     }
                  
               }
            

            echo    '</ul>';
            echo '</nav>';
   }
   /* end menu */
   
   
   
   
   add_theme_support( 'automatic-feed-links' );

   if ( function_exists( 'add_image_size' ) ) add_theme_support( 'post-thumbnails' );
   
   if ( function_exists( 'add_image_size' ) ) {
      add_image_size('PortfImg', 179, 125, true);
      add_image_size('HomeSliderImg', 660, 330, true);
      add_image_size('BlogImg', 291, 150, true);
   }



   
   
   
   
   /* specify content width */
   if ( ! isset( $content_width ) ) $content_width = 960;
   
   
   function getPostViews($postID){
      $count_key = 'post_views_count';
      $count = get_post_meta($postID, $count_key, true);
      if($count==''){
         delete_post_meta($postID, $count_key);
         add_post_meta($postID, $count_key, '0');
         return "0 View";
      }
      return $count;
   }
   function setPostViews($postID) {
      $count_key = 'post_views_count';
      $count = get_post_meta($postID, $count_key, true);
      if($count==''){
         $count = 0;
         delete_post_meta($postID, $count_key);
         add_post_meta($postID, $count_key, '0');
      }else{
         $count++;
         update_post_meta($postID, $count_key, $count);
      }
   }
   
   function remove_wpautop($content) {
         $content = do_shortcode( shortcode_unautop($content) );
         $content = preg_replace( '#^<\/p>|^<br \/>|<p>$#', '', $content );
      return $content;
   }


   
   

function remove_empty_tags($html)
{
$pattern = "/<[^\/>]*>([\s]?)*<\/[^>]*>/";
return preg_replace($pattern, '', $html);
}

function remove_images($posttext, $echo = true)
{
    $posttext1 = $posttext;
     
    // We will search for the src="" in the post content
    $regular_expression = '~src="[^"]*"~';
    $regular_expression1 = '~<img [^\>]*\ />~';
     
    // WE will grab all the images from the post in an array $allpics using preg_match_all
    preg_match_all( $regular_expression, $posttext, $allpics );
     
    // This time we replace/remove the images from the content
   
    $only_post_text = preg_replace( $regular_expression1, '' , $posttext1);
    $only_post_text = remove_empty_tags($only_post_text);
   
    if ($echo) echo $only_post_text; else return $only_post_text;
}





/* start for comments */
if ( ! function_exists( 'adorable_comment' ) ) :
function adorable_comment( $comment, $args, $depth ) {
   $GLOBALS['comment'] = $comment;
   switch ( $comment->comment_type ) :
      case 'pingback' :
      case 'trackback' :
   ?>
   <li class="post pingback">
      <p><?php 'Pingback:' ?> <?php comment_author_link(); ?><?php edit_comment_link( 'Edit', '<span class="edit-link">', '</span>' ); ?></p>
   <?php
         break;
      default :
   ?>
   <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
      <article id="comment-<?php comment_ID(); ?>" class="comment">
         <footer class="comment-meta">
            <div class="comment-author vcard">
               <?php
                  $avatar_size = 39;
                  if ( '0' != $comment->comment_parent )
                     $avatar_size = 39;

                  echo get_avatar( $comment, $avatar_size );

                  /* translators: 1: comment author, 2: date and time */
                  printf(  '%1$s <span class="date-and-time">%2$s</span>',
                     sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
                     sprintf( '<a href="%1$s"><time pubdate datetime="%2$s">%3$s</time></a>',
                        esc_url( get_comment_link( $comment->comment_ID ) ),
                        get_comment_time( 'c' ),
                        /* translators: 1: date, 2: time */
                        sprintf(  '%1$s at %2$s', get_comment_date(), get_comment_time() )
                     )
                  );
               ?>

               <?php edit_comment_link( __( 'Edit', 'pego_tr' ), '<span class="edit-link">', '</span>' ); ?>
            </div><!-- .comment-author .vcard -->

            <?php if ( $comment->comment_approved == '0' ) : ?>
               <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'pego_tr' ); ?></em>
               <br />
            <?php endif; ?>

         </footer>

         <div class="comment-content"><?php comment_text(); ?></div>

         <div class="reply">
            <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'pego_tr' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
         </div><!-- .reply -->
      </article><!-- #comment-## -->

   <?php
         break;
   endswitch;
}
endif; // ends check for adorable_comment()
   
/* end for comments */






function no_wpautop($content)
{
        $content = do_shortcode( shortcode_unautop($content) );
        $content = preg_replace( '#^<\/p>|^<br \/>|<p>$#', '', $content );
        return $content;
}

function page_have_children($id){
   $children = get_pages('child_of='.$id);
   if(count($children) == 0){
      return false;
   }
   else{
      return true;
   }
}


   include("functions/custom-page.php");
   include("functions/custom-portfolio.php");
   include("functions/custom-post.php");
   include("functions/custom-slider.php");
   include("functions/shortcodes.php");

   
   
   define('PEGO_FILEPATH', get_template_directory());
   define('PEGO_DIRECTORY', get_template_directory_uri());

   require_once (PEGO_FILEPATH . '/admin/admin-functions.php');
   require_once (PEGO_FILEPATH . '/admin/admin-interface.php');
   require_once (PEGO_FILEPATH . '/functions/theme-options.php');
   require_once (PEGO_FILEPATH . '/tinymce/tinymce.loader.php');
   
   
   
   



?>
I skladník ve šroubárně si může psát vlastní SQL příkazy.


  • Mohlo by vás zajímat
    Odpovědi
    Zobrazení
    Poslední příspěvek
  • CMS: WordPress či něco jiného?
    od Grander » 14 lis 2024 19:10 » v Programování a tvorba webu
    3
    4190
    od Grander Zobrazit poslední příspěvek
    20 lis 2024 15:04

Zpět na “Programování a tvorba webu”

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 5 hostů