posts

facebook graph api - how to search for specific keywords in posts

做~自己de王妃 提交于 2019-12-12 03:18:49
问题 When using the graph api feed (https://developers.facebook.com/docs/graph-api/reference/v2.6/page/feed) to display feeds from a FB page, is it possible to pass in specific keywords to the query and only return those message posts containing those keywords? Thanks a lot. 回答1: No, that is not possible. Public Post Search is deprecated, and there is no way to search for keywords in a specific Page Feed either. Just get all the posts, chache them in your database and do the seach on your own. 来源:

Get user Posts and/or Comments in a sharing blog using SQL

浪尽此生 提交于 2019-12-12 03:17:19
问题 This (My)SQL problem will make me crazy if not solved this week-end! A simple shared blog (means many authors contribute). Let's consider that two tables on my database: Posts : id author_id title content Comments : id author_id post_id content Goal: I want to display all the activities of a contributor (=> fixed author_id) . What I mean by activity is: If the user created the post and commented: Display the post title and the user comment If the user created the post but doesn't comment:

Wordpress - How can i get the posts from the users i follow

孤者浪人 提交于 2019-12-11 19:14:11
问题 I have this function to retrieves all the users that the specified user follows. This code from plugin "Users Following System", and all i need to get the posts from the users i follow! <?php /** * Retrieves all users that the specified user follows * * Gets all users that $user_id followers * * @access private * @since 1.0 * @param int $user_id - the ID of the user to retrieve following for * @return array */ function pwuf_get_following( $user_id = 0 ) { if ( empty( $user_id ) ) { $user_id =

How can I set the limit number of the posts of a specify category into a page of that category?

倖福魔咒の 提交于 2019-12-11 16:21:20
问题 I would to know how can I set the limit number of the posts visible into a page of a specify category. 回答1: Put this in your functions.php function main_query_mods( $query ) { if(!$query->is_main_query()) { return; } // show 15 posts per page if category has id 7 // check http://codex.wordpress.org/Conditional_Tags#A_Category_Page if ( is_category('7')) { $query->set('posts_per_page',15); } } add_action( 'pre_get_posts', 'main_query_mods' ); 回答2: You should use this: <?php $the_query = new WP

Showing “Subscriber” Posts And User's Own Posts

北慕城南 提交于 2019-12-11 13:16:39
问题 This has stumped me for some time. My problem: I have 2 different tables.. A table for user posts and a table for subscribers. The subscribers table looks like this: SubscriberID -> ProfileID 1 -> 2 1 -> 3 2 -> 3 2 -> 4 3 -> 2 My posts table looks like this: PostID -> AuthorID -> PostDate -> PostBody 1 -> 2 -> 12/20/12 -> Hello Word 2 -> 3 -> 12/21/12 -> Bye Bye World 3 -> 1 -> 12/22/12 -> Oh Wait 4 -> 4 -> 12/23/12 -> Is anyone still here? Basically, how it works is that the user with the ID

Add “Recent Posts” from a wordpress blog to a html static page

浪尽此生 提交于 2019-12-11 12:29:57
问题 I'm working on a new project and my client needs a site with blog . But I'm a terrible PHP programmer.. So I created the entire site on HTML/CSS and the blog with wordpress. OK, sounds good! but how to put the "Recent posts" from the blog(wordpress) in my index html page? 回答1: Method 1 : wp_get_recent_posts() According to WordPress codex: wp_get_recent_posts() will return a list of posts. Different from get_posts which returns an array of post objects. <?php include('blog/wp-load.php'); //

Is it possible to get all Linkedin Profile Posts with Linkedin Api

此生再无相见时 提交于 2019-12-11 07:57:37
问题 I am trying to use linkedin API for showing the feeds of my profile what i have posted from the day first. posts include media, images, video etc. I would like to know is there any Api available for that where i can pass some parameter and get all posts of my linkedin Profile. Please help if anyone have done this before Thanks!! 回答1: You can Retrieve Shares with the api using the person id: curl -X GET \ -H "Authorization:Bearer token<>" \ 'https://api.linkedin.com/v2/shares?q=owners&owners

Most recent post does not come above post if there was already made an comment

大憨熊 提交于 2019-12-11 07:13:33
问题 @Dianuj solved my issue a week ago, when I asked how I can get a recent comment above a post . That all worked very well, but yesterday, when I tested it, I saw a little issue, which I not want on my Wordpress site. Let me explain it to you... If someone makes a comment on a post that has none comments before you comment, then the function on this page How to get most recent commented post above new submitted post in Wordpress? will work flawlessly. I thank Dianuj for making my life easier.

How to ignore offset in jekyll when previous post is skipped

雨燕双飞 提交于 2019-12-11 07:05:20
问题 i'm trying to create my first blog on jekyll. And i stucked in one stupid thing. so the theme is next: i have a section for one of my categories, let it be "news": <section class="news"> <div class="container"> <div class="row no-gutters"> {% for post in site.categories.news limit: 2 offset: 0 %} {% include news-item-col-6.html %} {% endfor %} {% for post in site.categories.news limit: 3 **offset: 2** %} {% include news-item-col-4.html %} {% endfor %} </div> </div> </section> news-item-col-6:

How to get most recent commented post above new submitted post in Wordpress?

爱⌒轻易说出口 提交于 2019-12-11 06:15:59
问题 I have this function: $ids = $wpdb->get_col("SELECT DISTINCT comment_post_ID FROM $wpdb->comments ORDER BY comment_date DESC LIMIT 0 , 30"); foreach ($ids as $id) { $post = &get_post( $id ); setup_postdata($post); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php } ?> Which shows the latest commented posts in a list, which is fine. What I want to do is give a priority to this one and combine it