Exemple #1
0
        public JsonResult GetPostByID(string id)
        {
            Post post = new Post();

            post.content = "Post Not Found";
            WordPressBlog blog = wpc.GetBlog();

            post = blog.GetPostByID(Int32.Parse(id));
            return(Json(post));
        }
Exemple #2
0
        public ActionResult Index()
        {
            WordPressBlog blog = wpc.GetBlog();

            posts = blog.GetTop3Posts();
            PostViewModel postViewModel = new PostViewModel();

            foreach (var post in posts)
            {
                post.excerpt = post.excerpt.CharacterLimit(75);
            }
            postViewModel.Posts = posts;

            return(View(postViewModel));
        }