Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > Code เดียวกันแสดงไม่เหมือนกันคับ ไม่รู้เป็นเพราะอะไร



 

Code เดียวกันแสดงไม่เหมือนกันคับ ไม่รู้เป็นเพราะอะไร

 



Topic : 070168

Guest




ผมได้ดาว์โหลด code wordpress มาลงคับแต่มันไม่แสดงเหมือน Live ที่ดูในเว็บก่อนดาว์โหลด ตรงเมนูมันเพี้ยนไป

รูปต้นฉบับ

เมนู
ต้นฉบับ

กด F12 ดู code

ccc

จะเห็นในวงกลมสีแดงได้ว่าจะชี้ไปยัง Class >> cnav_menu


รูปที่ลงใน wordpress localhost

เมนู
ลงเครื่อง

กด F12 ดู code
ccc

ในวงกลมสีแดงมันจะชี้ไป class menu พอผมลองเปลี่ยน โดยใช้ Tools ของบราวเซอร์ จาก class menu เป็น class cnav_menu ผลมันแสดงออกมา เหมือนต้นฉับ


ส่วนนี้เป็น code header.php

Code (PHP)
<body>
    <div id="navcat">
    <div class="center">
	<div id="catmenus"><?php  wp_nav_menu( array( 'container_class' => 'cnav_menu', 'theme_location' => 'primary' ) ); ?></div>
</div></div>
<div id="header">
<div class="center">
    <div id="logo">
	  <h1><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
	  <div class="description"><?php bloginfo('description'); ?></div>
	   </div>
    </div>
    </div>


นี้ code css คับ คร่าวๆคับ


Code (PHP)
   
#catmenus{
    width:1000px;
    height:45px;
    margin:0 auto;
    padding:0px;
    z-index:210;
    font-family: "Trebuchet MS", Helvetica, Garuda, sans-serif;
    font-weight: normal;
    font-size:14px;
    text-transform:capitalize;
    line-height: 45px; 
    text-align: center; 
    }
    
#catmenus .cnav_menu,div.catmenu{
    width:1000px;
    height:37px;
    }
    
#catmenus .cnav_menu ul,div.catmenu ul{
    list-style:none;
    margin:0;
    }
    
#catmenus .cnav_menu li,div.catmenu li{
    float:left;
    position:relative;
    line-height: 45px;
    margin:0 2px 0 0;
    position: relative;
    z-index:220;
    padding: 0 0 0 10px;
    }





ปล.ปัญหาคือ code เหมือนกันทุกอย่าง แต่แสดง เมนูออกมาต่างกัน ชี้ class ไปคนละที่ ของจริงชี้ไป cnav_menu ของผมชี้ไป menu โดยไม่ได้ปรับแต่ง code แต่อย่างใด รบกวนช่วยดูทีคับ จนปัญญาจริงๆ



Tag : PHP, HTML/CSS







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-12-10 19:42:58 By : รอความช่วยเหลือ View : 1270 Reply : 12
 

 

No. 1

Guest


ขออภัยคับลงรูปผิด

code ที่ลงเครื่องแล้ว มันชี้ไปยัง class menu

คลาสที่ถูกต้องมันต้องชี้ไป cnav_menu
เเเ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-10 19:47:03 By : แก้ไข
 


 

No. 2



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ขอดูไฟล์ functions.php หน่อยครับ อยู่ใน folder เดียวกันครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-10 20:17:57 By : kerb
 

 

No. 3

Guest


ตอบความคิดเห็นที่ : 2 เขียนโดย : kerb เมื่อวันที่ 2011-12-10 20:17:57
รายละเอียดของการตอบ ::
Code (PHP)
.rm_wrap{
	width:740px;
}

.rm_section{
	border:1px solid #ddd;
	border-bottom:0;
	background:#f9f9f9;
}

.rm_opts label{
	font-size:12px;
	font-weight:700;
	width:200px;
	display:block;
	float:left;	
}
.rm_input {
	padding:30px 10px;
	border-bottom:1px solid #ddd;
	border-top:1px solid #fff;
}
.rm_opts small{
	display:block;
	float:right;
	width:200px;
	color:#999;
}
.rm_opts input[type="text"], .rm_opts select{
	width:280px;
	font-size:12px;
	padding:4px;
	color:#333;
	line-height:1em;
	background:#f3f3f3;
}
.rm_input input:focus, .rm_input textarea:focus{
		background:#fff;
}
.rm_input textarea{
	width:280px;
	height:175px;
	font-size:12px;
	padding:4px;
	color:#333;
	line-height:1.5em;
	background:#f3f3f3;
}
.rm_title h3 {
	cursor:pointer;
	font-size:1em;
	text-transform: uppercase;
	margin:0;
	font-weight:bold;
	color:#232323;
	float:left;
	width:80%;
	padding:14px 4px;
}

.rm_title{
	cursor:pointer;
	border-bottom:1px solid #ddd;
	background:#eee;
	padding:0;
	}

.rm_title h3 img.inactive{
	margin:-8px 10px 0 2px;
	width:32px;
	height:32px;	
	background:url('images/pointer.png') no-repeat 0 0;
	float:left;
	-moz-border-radius:6px;
	border:1px solid #ccc;
}

.rm_title h3 img.active{
	margin:-8px 10px 0 2px;
	width:32px;
	height:32px;	
	background:url('images/pointer.png') no-repeat  0 -32px;
	float:left;
	-moz-border-radius:6px;
	-webkit-border-radius:6px;
	border:1px solid #ccc;
}
		
.rm_title h3:hover img{
	border:1px solid #999;
}

.rm_title span.submit{
	display:block;
	float:right;
	margin:0;
	padding:0;
	width:15%;
	padding:14px 0;
}

.clearfix{
	clear:both;
}

.rm_table th, .rm_table td{
	border:1px solid #bbb;
	padding:10px;
	text-align:center;
}

.rm_table th, .rm_table td.feature{
	border-color:#888;
	}




code จาก ไฟล์ funtions.php

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-10 22:46:26 By : แก้ไข
 


 

No. 4



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ไม่ใช่แล้วมั้งครับ functions.php มันต้องเป็น code php สิครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-10 22:52:20 By : kerb
 


 

No. 5

Guest


โทษคับ ผิดอันขอรับ

Code (PHP)
<?php
include 'controlpanel.php';
include 'guide.php';
if ( function_exists('register_sidebar') )
    register_sidebar(array(
        'name' => 'Sidebar',
        'before_widget' => '<li id="%1$s" class="sidebar %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="sidebartitle">',
        'after_title' => '</h2>',
    ));

register_sidebar(array(
	'name' => 'Footer',
    'before_widget' => '<div class="footlinks">',
    'after_widget' => '</div>',
	'before_title' => '<h3 class="foothead">',
    'after_title' => '</h3>',
    ));	

/* ADD FEATURED THUMBNAIL */

if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
	add_theme_support( 'post-thumbnails' );

}

/* GET THUMBNAIL URL */

function get_image_url(){
	$image_id = get_post_thumbnail_id();
	$image_url = wp_get_attachment_image_src($image_id,'large');
	$image_url = $image_url[0];
	echo $image_url;
	}



// WP nav menu
if (function_exists('wp_nav_menu')) {
register_nav_menus(array('primary' => 'Primary Navigation'));

}

function zbench_page_menu_args( $args ) {
	$args['show_home'] = true;
	return $args;
}
add_filter( 'wp_page_menu_args', 'zbench_page_menu_args' );





add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 70; }

function my_excerpt_more($more) {
return '&nbsp;[..]';
}
add_filter('excerpt_more', 'my_excerpt_more');


function the_breadcrumb() {
	if (!is_home()) {
		echo '<a href="';
		echo get_option('home');
		echo '">';
		bloginfo('name');
		echo "</a> » ";
		if (is_category() || is_single()) {
			the_category('title_li=');
			if (is_single()) {
				echo " » ";
				the_title();
			}
		} elseif (is_page()) {
			echo the_title();
		}
        
	}
}



function dimox_breadcrumbs() {
 
  $delimiter = '&raquo;';
  $name = 'Home'; //text for the 'Home' link
  $currentBefore = '<span class="current">';
  $currentAfter = '</span>';
 
  if ( !is_home() && !is_front_page() || is_paged() ) {
 
    echo '<div id="crumbs">';
 
    global $post;
    $home = get_bloginfo('url');
    echo '<a href="' . $home . '">' . $name . '</a> ' . $delimiter . ' ';
 
    if ( is_category() ) {
      global $wp_query;
      $cat_obj = $wp_query->get_queried_object();
      $thisCat = $cat_obj->term_id;
      $thisCat = get_category($thisCat);
      $parentCat = get_category($thisCat->parent);
      if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' ' . $delimiter . ' '));
      echo $currentBefore . 'Archive by category &#39;';
      single_cat_title();
      echo '&#39;' . $currentAfter;
 
    } elseif ( is_day() ) {
      echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
      echo '<a href="' . get_month_link(get_the_time('Y'),get_the_time('m')) . '">' . get_the_time('F') . '</a> ' . $delimiter . ' ';
      echo $currentBefore . get_the_time('d') . $currentAfter;
 
    } elseif ( is_month() ) {
      echo '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a> ' . $delimiter . ' ';
      echo $currentBefore . get_the_time('F') . $currentAfter;
 
    } elseif ( is_year() ) {
      echo $currentBefore . get_the_time('Y') . $currentAfter;
 
    } elseif ( is_single() && !is_attachment() ) {
      $cat = get_the_category(); $cat = $cat[0];
      echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
      echo $currentBefore;
      the_title();
      echo $currentAfter;
 
    } elseif ( is_attachment() ) {
      $parent = get_post($post->post_parent);
      $cat = get_the_category($parent->ID); $cat = $cat[0];
      echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
      echo '<a href="' . get_permalink($parent) . '">' . $parent->post_title . '</a> ' . $delimiter . ' ';
      echo $currentBefore;
      the_title();
      echo $currentAfter;
 
    } elseif ( is_page() && !$post->post_parent ) {
      echo $currentBefore;
      the_title();
      echo $currentAfter;
 
    } elseif ( is_page() && $post->post_parent ) {
      $parent_id  = $post->post_parent;
      $breadcrumbs = array();
      while ($parent_id) {
        $page = get_page($parent_id);
        $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>';
        $parent_id  = $page->post_parent;
      }
      $breadcrumbs = array_reverse($breadcrumbs);
      foreach ($breadcrumbs as $crumb) echo $crumb . ' ' . $delimiter . ' ';
      echo $currentBefore;
      the_title();
      echo $currentAfter;
 
    } elseif ( is_search() ) {
      echo $currentBefore . 'Search results for &#39;' . get_search_query() . '&#39;' . $currentAfter;
 
    } elseif ( is_tag() ) {
      echo $currentBefore . 'Posts tagged &#39;';
      single_tag_title();
      echo '&#39;' . $currentAfter;
 
    } elseif ( is_author() ) {
       global $author;
      $userdata = get_userdata($author);
      echo $currentBefore . 'Articles posted by ' . $userdata->display_name . $currentAfter;
 
    } elseif ( is_404() ) {
      echo $currentBefore . 'Error 404' . $currentAfter;
    }
 
    if ( get_query_var('paged') ) {
      if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' (';
      echo __('Page') . ' ' . get_query_var('paged');
      if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')';
    }
 
    echo '</div>';
 
  }
}






?>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 02:37:17 By : แก้ไข
 


 

No. 6



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ลอง Comment มันออกไปครับ ลบไปเลยก็ได้คับ Line 39-43
Code (PHP)
// WP nav menu
if (function_exists('wp_nav_menu')) {
     register_nav_menus(array('primary' => 'Primary Navigation'));
}

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 06:03:37 By : kerb
 


 

No. 7

Guest


เหมือนเดิมคับไม่มีอะไรเกิดขึ้น ลองเอา ไฟล์ them ไปลองดูไหมคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 06:56:20 By : แก้ไข
 


 

No. 8



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

ไปโหลดมาจากไหนครับ เด๋วผมไปโหลดมาลอง
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 07:29:03 By : kerb
 


 

No. 9



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

สงสัยที่ผมบอกไปจะไม่ใช่ละ 555 เบลอ ลองอันนี้ดู

Code (PHP)
// WP nav menu
if (function_exists('wp_nav_menu')) {
     register_nav_menus(array('primary' => 'ชื่อ theme'));
}


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 07:46:17 By : kerb
 


 

No. 10

Guest


http://www.mediafire.com/?3k0vjunxbp75ls1

อัพให้แล้วนะคับ ช่วยลองแก้ให้ดูทีนะคับ them wordpress คับผม

ขอบคุณอย่างยิ่งคับ แล้วผมจะติดตามอยู่เรื่อยๆนะคับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 08:05:54 By : แก้ไข
 


 

No. 11



โพสกระทู้ ( 708 )
บทความ ( 0 )



สถานะออฟไลน์
Facebook

แก้ในไฟล์ header ครับ Line 63 container_class => menu_class

ใน ไฟล์ functions.php ไม่ต้องแก้อะไรครับ ผมดูผิด ขอโทษทีครับ

Code (PHP)
<div id="catmenus"><?php  wp_nav_menu( array( 'menu_class' => 'cnav_menu', 'theme_location' => 'primary' ) ); ?></div>



ประวัติการแก้ไข
2011-12-11 14:14:46
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 14:14:22 By : kerb
 


 

No. 12

Guest


ขอบคุณคับ แค่เปลี่ยนเป็น menu_class ก็ได้แล้วคับ สุดยอดจริงๆคับท่าน

ที่เหลือก็แค่โม แล้วอัพขึ้นเว็บ ขอบคุณจริงๆคับท่าน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-12-11 15:56:47 By : แก้ไข
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : Code เดียวกันแสดงไม่เหมือนกันคับ ไม่รู้เป็นเพราะอะไร
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่