任何问题请联系WX:uu16853

买模板送网站采集器 让你轻松放开双手运营网站!

购买更多有优惠!

WordPress 技巧:移除 WordPress 3.1 的 Admin Bar

WordPress 3.1 在用户登陆的情况下会出现 Admin Bar,我们可以通过在主题的 functions.php 文件中添加下面的代码移除 WordPress 3.1 的 Admin Bar: add_filter( ‘show_admin_bar’, ‘__return_false’ ); 标签:WordPress 技巧

WordPress 技巧:给 Admin Bar 添加自定义链接

WordPress 3.1 之后引进了 Admin Bar,对于某些人来说这个 Bar 基本没用,我前面也介绍了如何移除 WordPress 3.1 的 Admin Bar,但是对于另外一些同学来说这个 Admin Bar 又非常有用,今天就给大家讲讲如何给 Admin Bar 添加自定义链接: 在当前主题的 functions.php 文件添加如下代码: add_action( ‘wp_before_admin_bar_render’, ‘my_admin_bar_render’ ); function my_admin_bar_render() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘parent’ => false, // ‘false’ 为添加住菜单,也可以输入父级菜单的 ID ‘id’ => ‘my_product’, // 自定义链接的 ID, ‘title’ => __(‘我的产品’), // 自定义链接标题 ‘href’ => admin_url( ‘admin.php?page=orders’), // […]

Action Bar使用方法 – Android活动栏(一) Android开发技术

  在Android 3.0中除了我们重点讲解的Fragment外,Action Bar也是一个重要的内容,Action Bar主要是用于代替传统的标题栏,对于Android平板设备来说屏幕更大它的标题使用Action Bar来设计可以展示更多丰富的内容,方便操控。   Action Bar主要功能包含:   1. 显示选项菜单  2. 提供标签页的切换方式的导航功能,可以切换多个fragment.   3.  提供下拉的导航条目.  4. 提供交互式活动视图代替选项条目   5. 使用程序的图标作为返回Home主屏或向上的导航操作。   首先我们一起来看下Action Bar代替传统Title的效果,下面一个平板应用的标题栏,是不是图标很大啊。     Android开发网提示在你的程序中应用ActionBar需要注意几点,SDK和最终运行的固件必须是Android 3.0即honeycomb,在androidmanifest.xml文件中的uses-sdk元素中加入android:minSdkVersion或android:targetSdkVersion,类似 <manifest xmlns:android="http://schemas.android.com/apk/res/android"       package="com.android123.cwj"       android:versionCode="1"       android:versionName="1.0">     <uses-sdk android:minSdkVersion="honeycomb" />     <application … >         …     </application> </manifest>   如果需要隐藏Action Bar可以在你的Activity的属性中设置主题风格为NoTitleBar在你的manifest文件中,Android123提示大家,下面的代码在3.0以前是隐藏标题,而在3.0以后就是隐藏ActionBar了,代码为   <activity android:theme="@android:style/Theme.NoTitleBar">    一、添加活动条目 […]

Action Bar示例代码 (一) Android开发技术

   今天一起来看下Android Action Bar的示例代码,我们通过活动栏做一个简单选项菜单。下面这个例子将演示ActionBar.NAVIGATION_MODE_STANDARD、ActionBar.NAVIGATION_MODE_TABS和                     : ActionBar.NAVIGATION_MODE_STANDARD等模式的效果。最后Android123仍然提示大家Action Bar是Android 3.0 honeycomb才开始有的特性,老版本的SDK和固件无法使用。 public class ActionBarDisplayOptions extends Activity  implements View.OnClickListener, ActionBar.TabListener {    private View mCustomView;     @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.action_bar_display_options);         findViewById(R.id.toggle_home_as_up).setOnClickListener(this);        findViewById(R.id.toggle_show_home).setOnClickListener(this);        findViewById(R.id.toggle_use_logo).setOnClickListener(this);        findViewById(R.id.toggle_show_title).setOnClickListener(this);        findViewById(R.id.toggle_show_custom).setOnClickListener(this);        findViewById(R.id.toggle_navigation).setOnClickListener(this);        findViewById(R.id.cycle_custom_gravity).setOnClickListener(this);         mCustomView = getLayoutInflater().inflate(R.layout.action_bar_display_options_custom, null);         final ActionBar bar = getActionBar();        bar.setCustomView(mCustomView,                new ActionBar.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));         bar.addTab(bar.newTab().setText("Tab 1").setTabListener(this));        […]

100% Secure Checkout

PayPal / MasterCard / Visa