calvinhsu
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: how to modify feed templatesThanks @rahul Sonar,
That’s a good trick.
However, since what I want is quite simple: add the post excerpt before rss post content(since I use excerpt to provide a summary and introduction of post content so there’s no duplicate between excerpt and content), I think maybe some functions would do the job, something like this: https://www.wpbeginner.com/wp-tutorials/how-to-add-post-thumbnail-to-your-wordpress-rss-feeds/
But my code seems not working:
function rss_with_excerpt($content){ global $post; if(has_excerpt($post->ID)){ $content = get_the_excerpt() . get_the_content(); } return $content; } add_filter('the_content_feed','rss_with_excerpt');
Forum: Plugins
In reply to: [Hotlink Protection] [Plugin: WP Hotlink Protection] not working on 3.1.1Thanks @christopherross, I’m running wp on media temple dv plan.
Forum: Fixing WordPress
In reply to: How to make use of the post format "Link"?so the code:
Forum: Fixing WordPress
In reply to: How to make use of the post format "Link"?Since I’m not able to figure out how to use the code @esmi has provided, I tried to study the php function in his code,
stristr()
,substr()
,strlen()
(I know really very little about coding), and finally I came up with some code, they work fine with the purpose what I have originally described–extract the first link from content, or we just put a plain url in content, and the output become the post title linking to the address.Just put the code in loop, and nothing has to be add into
functions.php
[Code moderated as per the Forum Rules. Please use the pastebin]
Since I’m not a php guy, the code is much likely to fail in some case. But as I haven’t yet found an easy way to achieve this on the internet, I just paste them here and hope some veteran would give further advice.
Forum: Fixing WordPress
In reply to: How to make use of the post format "Link"?@chip Bennett
It’s a child theme of twentyten.I have add
link
toadd_theme_support()
Then I tried adding
`if ( has_post_format( ‘link’ )) {
echo ‘this is the link format’;
}`
into loop and it worked.Forum: Fixing WordPress
In reply to: How to make use of the post format "Link"?@esmi Thanks for the code!
But I’m not quite clear how to use the
format-link.php
I created a file named
format-link.php
in my theme directory, but nothing happens.I tried paste the code into loop, error occurs.
What should I do?
Forum: Fixing WordPress
In reply to: Is there an easy way to insert hr tag in posts?thanks @adiant, this plugin is great ! Flexible and easy for end users to use.
Forum: Fixing WordPress
In reply to: content shown based on user role?@vtxyzzy Thanks, your reply helps.
I’m building a site using wp+bp, I want to make the backend of the main blog available only to selected users rather than everyone who has registered, since subscribers have little to do in wp backend.
Forum: Fixing WordPress
In reply to: image resizing doesn't workForum: Fixing WordPress
In reply to: image resizing doesn't workit seems it’s the problem with twentyten.
I switched to other themes and it worked well.
But I’m building a child theme of Twentyten, so is there a way to fix this?