رفتن به مطلب

بستن یک Div در یک پلاگین


پست های پیشنهاد شده

سلام خسته نباشید تو این پلاگین نیاز هست تگ Div بسته بشه ! هر کار کردم نشد ، یعنی یا بعد از li ها چاپ میشد یا قبلش ! (واسه منو هستش)


<?php
/**
* @package Helix Framework
* @author JoomShaper http://www.joomshaper.com
* @copyright Copyright (c) 2010 - 2013 JoomShaper
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later
*/
// Menu output mods
class HelixMenuWalker extends Walker_Nav_Menu {
function start_lvl(&$output, $depth) {
$indent = str_repeat("\t", $depth);
$depth = $depth+1;
$sub_level_child = ($depth>1) ? 'sub-level-child ' : 'sub-level ';
$output .= "\n$indent<div class=\"sp-submenu-wrap level-$depth\"><ul class=\"sp-menu sp-submenu level-$depth\">\n";
}
function start_el(&$output, $item, $depth, $args)
{
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
if(in_array('current-menu-item', $classes)){
$classes[] = 'active';
}
if(in_array('current_page_parent', $classes)){
$classes[] = 'active';
}
$class_names .= join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$output .= $indent . '<li id="menu-item-'. $item->ID . '" class="' . esc_attr( $class_names ) .'" >';
$attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : '';
$attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : '';
$attributes .= ! empty( $item->xfn ) ? ' rel="' . esc_attr( $item->xfn ) .'"' : '';
$attributes .= ! empty( $item->url ) ? ' href="' . esc_attr( $item->url ) .'"' : '';
$item_output = $args->before;
$item_output .= '<a class="menu-item"'. $attributes .'>';
$item_output .= $args->link_before .apply_filters( 'the_title', $item->title, $item->ID );
$item_output .= $args->link_after;

$item_output .= '</a>';
$item_output .= $args->after;
$output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
}
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output )
{
$id_field = $this->db_fields['id'];
if ( is_object( $args[0] ) ) {
$args[0]->has_children = ! empty( $children_elements[$element->$id_field] );
}
// $id_field = $this->db_fields['id'];
if ( !empty( $children_elements[ $element->$id_field ] ) ) {
$element->classes[] = 'parent';
}
return parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
}
}

خط 20

لینک به ارسال

دوستان کمک کنید دیگه میخوام بعد از بسته شدن </ul> این هم به همین صورت بسته شه </div>

لینک به ارسال

از تابع end_lvl در کلاس استفاده کنید

http://code.tutsplus...class--wp-25401

تشکر آقا پارسا خوده خودش بود. یه سوال دیگه هم دارم که تو سورس افزونه all in one seo pack یه متا تگ به نام


<meta property="og:image" content="http:/*****//wp-content/plugins/all-in-one-seo-pack-pro/images/default-user-image.png" />
<meta itemprop="image" content="http://****/wp-content/plugins/all-in-one-seo-pack-pro/images/default-user-image.png" />

چطور میتونم حذفش کنم از توی سورس؟

ویرایش شده توسط ho3ein
لینک به ارسال

تشکر آقا پارسا خوده خودش بود. یه سوال دیگه هم دارم که تو سورس افزونه all in one seo pack یه متا تگ به نام


<meta property="og:image" content="http:/*****//wp-content/plugins/all-in-one-seo-pack-pro/images/default-user-image.png" />
<meta itemprop="image" content="http://****/wp-content/plugins/all-in-one-seo-pack-pro/images/default-user-image.png" />

چطور میتونم حذفش کنم از توی سورس؟

حتما در تنظیمات افزونه بخشی برای تنظیمات OpenGraph داره

لینک به ارسال

حتما در تنظیمات افزونه بخشی برای تنظیمات OpenGraph داره

پیدا نکردم مچین چیزی رو !


function my_title($title,$separator,$position) {
if (condition) {
remove_action('wp_head','jetpack_og_tags'); // JetPack
if (defined('WPSEO_VERSION')) { // Yoast SEO
global $wpseo_front;
remove_action('wp_head',array($wpseo_front,'head'),1);
}
if (defined('AIOSEOP_VERSION')) { // All-In-One SEO
global $aiosp;
remove_action('wp_head',array($aiosp,'wp_head'));
}
remove_action('wp_head','rel_canonical');
remove_action('wp_head','index_rel_link');
remove_action('wp_head','start_post_rel_link');
remove_action('wp_head','adjacent_posts_rel_link_wp_head');
add_action('wp_head','my_head',0);
// do whatever you need to $title here
}
return $title;
}
add_filter('wp_title','my_title',20,3);

امکان پذیر هست با این کد در فاکنشن؟

لینک به ارسال

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

×
×
  • اضافه کردن...