الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعدة في التعديل على ثيم ووردبريس

بدأه zaykem في 7 أكتوبر 2012 · 1 رد · 356 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله تعالى وبركاته

إخواني عندي مشكلة في التعديل على ثيم ووردبريس

لما أدخل على الرابط التالي

http://demo.woothemes.com/premiere/video-category/comedy/

لاحظو هادي الصورة

http://mockupr.com/mu/igjj0460

أريد إضافة تصنيف ثالث خاصة بالشركات company

كيف يتم عمل ذلك بعد بحث طويل وقراءة للسكربت أظن أن هذه الوظائف هي المسؤولة عن ذلك

if ( ! function_exists( 'woo_sorting_bar' ) ) {
	function woo_sorting_bar ( $url ) {
		if ( ! $url ) { return; }

		// Supported sorting types.
		$allowed_sorting = array( 
								'date' => __( 'Date Added', 'woothemes' ),
								'title' => __( 'Name', 'woothemes' ),
								'company'=> __('Company','woothemes')
								);

		// Sorting toggle.
		$sorting = 'asc';
		if ( $_GET['video-order'] && in_array( $_GET['video-order'], array( 'asc', 'desc' ) ) ) {
			$current_sort = strtolower( strip_tags( $_GET['video-order'] ) );
			if ( $current_sort == 'asc' ) { $new_sort = 'desc'; } else { $new_sort = 'asc'; }
			$sorting = $new_sort;
		}

		// Sortby "active" CSS class toggle.
		$current_sortby = 'date';
		if ( $_GET['video-sortby'] && in_array( $_GET['video-sortby'], array_keys( $allowed_sorting ) ) ) {
			$current_sortby = strtolower( strip_tags( $_GET['video-sortby'] ) );
		}

		$html = '';

		$html .= '<ul class="sorting">' . "\n";
		$html .= '<li class="sortby">' . __( 'Sort by:', 'woothemes' ) . '</li>' . "\n";

		foreach ( $allowed_sorting as $k => $v ) {
			$css_class = 'sortby-item';

			$direction_indicator = '↑';
			if ( $sorting == 'desc' ) { $direction_indicator = '↓'; }

			if ( $k == $current_sortby ) { $css_class .= ' active'; }

			$html .= '<li class="' . $css_class . '"><a href="' . $url . '?video-sortby=' . $k . '&video-order=' . $sorting . '" title="' . esc_attr( sprintf( __( 'Sort by %s', 'woothemes' ), $v ) ) . '">' . $v;
			if ( $k == $current_sortby ) { $html .= ' <span class="direction-indicator">' . $direction_indicator . '</span>' . "\n"; }
			$html .= '</a></li>' . "\n";
		}

		$html .= '</ul>' . "\n";

		return $html;

	} // End woo_sorting_bar()
}

/*-----------------------------------------------------------------------------------*/
/* Order videos on video taxonomy screens using query variables. */
/*-----------------------------------------------------------------------------------*/

if ( ! is_admin() && ! is_home() ) {
	add_filter( 'pre_get_posts', 'woo_sort_in_taxonomy' );
}

if ( ! function_exists( 'woo_sort_in_taxonomy' ) ) {
	function woo_sort_in_taxonomy ( $query ) {
		if ( ( ! is_admin() && ! is_home() ) && ( is_tax() || is_post_type_archive() ) ) {
			if ( $query->is_tax || $query->is_post_type_archive ) {

				$allowed_directions = array( 'asc', 'desc' );
				$allowed_sorting = array( 'date', 'title','company' );

				$default_direction = 'desc';
				$default_sorting = 'date';

				$direction = $default_direction;
				$sorting = $default_sorting;

				if ( isset( $_GET['video-order'] ) && in_array( $_GET['video-order'], $allowed_directions ) ) { $direction = strtolower( strip_tags( $_GET['video-order'] ) ); }
				if ( isset( $_GET['video-sortby'] ) && in_array( $_GET['video-sortby'], $allowed_sorting ) ) { $sorting = strtolower( strip_tags( $_GET['video-sortby'] ) ); }

				$query->set( 'orderby', $sorting );
				$query->set( 'order', strtoupper( $direction ) );

				$query->parse_query();

			}
		}

		return $query;
	} // End woo_sort_in_taxonomy()
}

أتمني مساعدتى فأنا في أمس الحاجة لمعرفة كيف يتم فعل ذلك

وشكرا

#2

أرجو ا الرد من دوي الخبرة والله محتاج الحل

مواضيع مشابهة