小编ban*_*ing的帖子

从哪里开始开发WordPress/WooCommerce主题?

我已经交了一些PSD,需要使用WordPress和WooCommerce创建一个电子商务网站.我找到了几个用于创建WordPress主题的资源... http://codex.wordpress.org/Theme_Development http://themeshaper.com/2009/06/22/wordpress-themes-templates-tutorial/

...但是因为我将要使用WooCommerce,我是否仍然需要遵循这些指南,或者WooCommerce开发阶段是否会使上述指南变得多余?

我已经研究了这个,但是如果你不熟悉WordPress和WooCommerce,我发现的资源并不清楚从哪里开始.

先感谢您.

html php wordpress e-commerce woocommerce

8
推荐指数
1
解决办法
7341
查看次数

使用Intent以纵向模式打开相机

我能够从我打开设备的摄像头Activity使用Intent,如下所示:

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
Uri fileUri = getOutputMediaFileUri();
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
cameraIntent.putExtra("android.intent.extras.CAMERA_FACING", 1);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
Run Code Online (Sandbox Code Playgroud)

我的问题是我Activity的设置为横向模式,因此当相机打开时,它也会以横向模式打开- 但我只需要在纵向模式下打开相机.

因此,请在使用Intent启动设备的相机时告诉我如何执行此操作.

谢谢...

android android-camera android-camera-intent

8
推荐指数
1
解决办法
6226
查看次数

如何通过id而不是位置设置微调器选择

我创建了一个简单的Spinner将它绑定到a SimpleCursorAdapter.我正在SimpleCursorAdapter填写内容提供商的城镇列表.

当我去保存用户选择时,我打算保存正在填充的行ID SimpleCursorAdapter.

我正在使用以下代码来获取ID.

townSpinner.getSelectedItemId();
Run Code Online (Sandbox Code Playgroud)

我无法弄清楚当我拉回保存的项目时如何最好地设置选择.

以下代码有效但只按位置编号设置选择.

townSpinner.setSelection(2);
Run Code Online (Sandbox Code Playgroud)

我应该创建一个循环来根据Id确定正确的位置值吗?

long cityId = Long.parseLong(cursor.getString(CityQuery.CITY_ID));

for (int i = 0; i < citySpinner.getCount(); i++) {              
    long itemIdAtPosition2 = citySpinner.getItemIdAtPosition(i);
    if (itemIdAtPosition2 == cityId) {
        citySpinner.setSelection(i);
        break;
    }
}
Run Code Online (Sandbox Code Playgroud)

android

7
推荐指数
1
解决办法
7296
查看次数

woocommerce breadcrumb缺少商店链接

我有一个WordPress网站,使用woocommerce(在内部页面),我的网页结构如下:

mysite的/店/

woocommerce页面上的痕迹只显示主页链接:您在这里:主页

和我的产品页面网址:

MYSITE /产品类别/ CATEGORY_NAME /

我的店铺面包屑显示如下:

You are here: Home 
Run Code Online (Sandbox Code Playgroud)

我的类别页面痕迹显示如下:

You are here: Home
Run Code Online (Sandbox Code Playgroud)

我需要把它显示为:

你在这里:主页/购物/ category_name

我检查了永久链接选项,但似乎没问题.我检查了breadcrumb.php模板文件,似乎认为shop()页面是我网站的主页.

如果我编辑breadcrumb.php或我的设置中有错误,我该如何解决这个问题?提前致谢.

wordpress wordpress-theming woocommerce

7
推荐指数
4
解决办法
1万
查看次数

Eclipse - 无法完成安装,因为找不到一个或多个必需项(org.apache.httpcomponents.httpclient)

我正在尝试安装Eclipse Git Team ProviderJGit在我的版本的Eclipse ADTvia中Help > Install New Software > "EGit - http://download.eclipse.org/egit/updates"但是安装失败并出现此错误...

无法完成安装,因为找不到一个或多个必需的项目.正在安装的软件:Git的Java实现 - 使用Apache httpclient的可选Http支持3.3.1.201403241930-r(org.eclipse.jgit.http.apache.feature.group 3.3.1.201403241930-r)
缺少要求:Apache HttpComponents HttpClient OSGi bundle 4.1. 3.v201209201135(org.apache.httpcomponents.httpclient 4.1.3.v201209201135)需要'package org.apache.commons.codec.binary 1.4.0'但无法找到它无法满足依赖:来自:Git的Java实现 - 使用Apache httpclient可选的Http支持3.3.1.201403241930-r(org.eclipse.jgit.http.apache.feature.group 3.3.1.201403241930-r)To:org.apache.httpcomponents.httpclient [4.1.3.v201209201135]

它说我需要安装org.apache.httpcomponents.httpclient 4.1.3.v201209201135或者package org.apache.commons.codec.binary 1.4.0(虽然,我不清楚哪一个丢失了,或者两者都丢失了?)......

如何将它/它们添加到Eclipse

我可以找到很多关于如何将jar添加到单个项目的库中的信息,但这不是我想要的(如果我错了,请纠正我),我需要将它们添加到Eclipse中Help > Install New Software.

我看到很多人发布了与其他依赖项类似的问题,但是没有找到解释如何添加这个特定软件的答案.

我是Eclipse的新手,所以任何帮助都会非常感激.

eclipse apache git dependencies android

7
推荐指数
1
解决办法
3万
查看次数

Android/Google Plus - 无法与我的内容提供商共享图片

我已经使用了这段代码,并且可以通过我的Android应用程序成功地将图像(来自我手机的图库)与文本分享到谷歌+.

但是,当我尝试从我的应用内容提供商发布图片时,图片会显示在我的Google +页面上,就像这样......

在此输入图像描述

...即使在谷歌+应用预览屏幕上显示的预期图像很好.

我用来分享的代码是:

String message = "My message"; 
Uri localImageUri = ContentUris.withAppendedId(DbContentProvider.CONTENT_URI_PRODUCTS, mProductId;
PlusShare.Builder builder = new PlusShare.Builder(getActivity());
builder.setText(message);
builder.addStream(localImageUri);
builder.setType("image/jpeg");
Intent shareIntent = builder.getIntent();
startActivityForResult(shareIntent, RC_GOOGLE_PLUS);
Run Code Online (Sandbox Code Playgroud)

...而且,就像我说的,如果localImageUri值是针对我手机图库中的资源,则图像会成功显示在最终的Google +页面上 - 如果我localImageUri从应用程序自己的内容提供商设置为uri,则显示上面的占位符图像.

所以我认为我的内容提供商一定存在问题,我的清单中将其定义为:

<provider
    android:name=".DbContentProvider"
    android:authorities="com.example.provider"
    android:exported="true"
    android:grantUriPermissions="true" />
Run Code Online (Sandbox Code Playgroud)

那么,我的清单中是否会遗漏一些东西 - 甚至是我的searchable.xml文件:

<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
    android:label="@string/app_name"
    android:hint="@string/search_hint"

    android:searchSuggestAuthority="com.example.provider"
    android:searchSuggestIntentAction="android.intent.action.VIEW"
    android:searchSuggestIntentData="content://com.example.provider/suggest"
    android:searchSuggestThreshold="3"

    android:includeInGlobalSearch="true"
    android:searchSettingsDescription="@string/search_settings_description"
    android:queryAfterZeroResults="true"
    android:voiceSearchMode="showVoiceSearchButton" >   
</searchable>
Run Code Online (Sandbox Code Playgroud)

如果没有,那么问题是什么呢?

更新(遵循CommonsWare的评论)

异常确实是由Google+信息库抛出,因为也做在查询_data栏(其存在),借助Google+ API,也一直在寻找一个不存在的列-即datetaken,date_added,date_modified.

所以我已经将这些列添加到我的数据库表中 …

android share image android-contentprovider google-plus

7
推荐指数
1
解决办法
688
查看次数

Android - 在SearchView建议中防止文本截断?

默认情况ListView下显示在我的SearchView包含文本下面的建议被截断.我希望文本完整显示(如有必要,可以在多行显示).

我已经提出了两种可能的方法来解决这个问题但是,由于没有在网上找到的例子,我希望有人在这里可以帮助...

方法#1/Q1:如何直接访问和修改包含SUGGEST_COLUMN_TEXT_1SUGGEST_COLUMN_TEXT_1文本的TextView的外观?

方法#2/Q2:或者,SearchView有一个setSuggestionsAdapter(CursorAdapter adapter)看起来比方法#1更合适的方法(更多?).虽然我已经阅读了CursorAdapters并且已经在我的应用程序中实现了一个,但我不确定如何为SearchView配置一个(特别是在访问光标方面),所以任何人都可以帮我一些一般的指导还是一个骨架的例子?

以下是我的SearchViewFragment类中的现有代码:

public class SearchViewFragment extends Fragment {

public SearchViewFragment() {
}

@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
    Bundle savedInstanceState) {

    // Inflate the layout for this fragment
    View fragmentView =  inflater.inflate(R.layout.fragment_search_view, container, false);

    // Use the Search Manager to find the SearchableInfo related to this Activity
    SearchManager searchManager = (SearchManager)getActivity().getSystemService(Context.SEARCH_SERVICE);
    SearchableInfo searchableInfo = searchManager.getSearchableInfo(getActivity().getComponentName()); …
Run Code Online (Sandbox Code Playgroud)

customization android search-suggestion searchview android-cursoradapter

7
推荐指数
1
解决办法
1275
查看次数

Android - 如何从 ParcelFileDescriptor 访问文件?

根据FileProvider 文档,fileProvider.openFile()方法返回

一个新的ParcelFileDescriptor,您可以使用它访问该文件。

我查看了ParcelFileDescriptor,但我看不到如何访问该文件。那么如何从 ParcelFileDescriptor 访问文件呢?

android android-file android-fileprovider

7
推荐指数
0
解决办法
6382
查看次数

WooCommerce - 如何在calculate_shipping函数中获得购物车物品的运输类别?

我创建了一个WooCommerce插件,为订阅者提供免费送货服务.在最近的WooCommerce升级后,它似乎已经破裂.

具体而言,问题似乎是可能无法正确检索购物车物品的运输类别.

这是我的calculate_shipping代码 - 任何人都可以建议什么是错的?

/**
 * Add free shipping option for customers in base country with an active subscription,
 * but only if the cart doesn't contain an item with the 'heavy-item-shipping-class'.
 *
 * @access public
 * @param mixed $package
 * @return void
 */
public function calculate_shipping($package) {

    global $woocommerce;

    // Check country and subscription status
    if (is_user_in_base_country() && does_user_have_active_subscription()) {

        // This flag will be set to TRUE if cart contains heavy items
        $disable_free_shipping = FALSE;

        // Get …
Run Code Online (Sandbox Code Playgroud)

php wordpress woocommerce

6
推荐指数
1
解决办法
8573
查看次数

Android - insertOrThrow()什么时候抛出异常?

在阅读文档之前,如果插入不成功,我希望SQLiteDatabaseinsertOrThrow()方法抛出异常.

但是,文档说的insertOrThrow()方法

返回新插入行的行ID,如果发生错误则返回-1

那么,如果它-1在发生错误时返回,在什么情况下会抛出异常?

sqlite android android-database

6
推荐指数
1
解决办法
3233
查看次数