小编Rok*_*kas的帖子

angularjs $ window.height未定义

$ window.height未定义.问题出在哪儿?

FoodSearchControllers.controller('homeCtrl', ['$scope', '$http', '$window', 'filterArgs', function($scope, $http, $window, filterArgs) {
  $scope.popupHeight = $window.height;
  console.log($scope.popupHeight);
}]);
Run Code Online (Sandbox Code Playgroud)

angularjs

49
推荐指数
2
解决办法
6万
查看次数

如何将wordpress图像调整为固定高度和自动宽度

我有一个带有costum img尺寸(固定宽度和高度)的WP滑块,我需要它们可以缩放到固定的330px高度和自动宽度.怎么实现这个?

先感谢您!

wordpress wordpress-theming

11
推荐指数
1
解决办法
2万
查看次数

从前端更新wordpress帖子(使用acf)

我正在为用户添加/编辑他们的帖子制作前端管理员.我已经发布了添加表单并且它有效,但编辑表单不起作用.

的functions.php

function add_new_post( $post_id )
{
    if( $post_id == 'new' ) {
        // Create a new post
        $post = array(
            'post_title' => $_POST["fields"]['field_52c810cb44c7a'],
            'post_category' => array(4),
            'post_status'  => 'draft',
            'post_type'  => 'post'
        );

        // insert the post
        $post_id = wp_insert_post( $post );

        return $post_id;
    }
    else {
        return $post_id;
    }
}add_filter('acf/pre_save_post' , 'add_new_post' );
Run Code Online (Sandbox Code Playgroud)

的index.php

<div id="updateform-<?php the_ID(); ?>" class="collapse">
    <?php
    echo get_the_ID();
    $args = array(
        'post_id' => get_the_ID(), // post id to get field groups from and save …
Run Code Online (Sandbox Code Playgroud)

wordpress advanced-custom-fields

5
推荐指数
1
解决办法
5477
查看次数