Green development of agriculture is inevitable to meet the objective demand of rural ecological environment protection and high-quality agricultural development. Livelihood capital is the basic condition for farmers to carry out the activities of production and management, while ecological cognition is the direct motivation for their behaviors. Based on field research data from 436 farm households in 4 counties of Langao, Fuping, Mian, and Yaozhou in Shaanxi Province, China, the study conducted the double-hurdle model (DHM) to empirically analyze the effects of livelihood capital and ecological cognition on farmer’s decision on green production and the degree of green production. The results show that (1) farmers’ livelihood capital is the basic condition that significantly affects farmers’ green production. Specifically, human capital and social capital have a positive contribution to farmers’ green production decision and degree of green production; natural capital and financial capital do not have a significant effect on green production decision, but have a significant positive effect on the degree of green production behavior; physical capital, as farmers’ stock capital, does not have a significant effect on green production behavior. (2) Ecological cognition plays a positive moderating role in farmers’ decisions on green production, but as a subjective cognition, its contribution to the degree of green production is not significant. This paper explores the relationship between livelihood capital, ecological cognition, and farmers’ green production behavior, and provides suggestions for improving farmers’ participation in green production.