Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   How to Show Excerpt Only for Specific Post. (http://forum.bytesforall.com/showthread.php?t=11335)

vintario Nov 23, 2010 01:59 AM

How to Show Excerpt Only for Specific Post.
 
Hi.

So basically what I want:

I have single post ID XX.
In Ata options I have set to display full posts on Home and Category Pages.
I want to "display excerpt Only for post ID XX on Catergory Page AND Home Page"
or
"display excerpt Only for Category YY on Category Page (<-I have archieved that) AND Home Page"

I use WP 3.0.1 and ATA 3.5.3

___


In the Ata options I have set to show full post on both home and category pages. I still write manual excerpts but I use them for Feeds, that's why they are usually modified and simplified to display correctly on Feeds, that's why I can't turn on excerpts, they will look ugly on Home Page.

I always use "Read More" tag to get preview displayed on Home and Category Pages, but in this case I can't do it because the preview on the Home/Category Page has to be alittle bit different than the beggining of the post itself when reading the full post.

In case maybe there is another solution instead of using excerpts I will explain what I need.

For example, on the Home/Category Page in the preview of the post there is a image that says "Full info inside" and when you open the full post the same picture says "You are reading the full info" (it's just and example, actually i use image-buttons). If I paste the first picture before the "Read More" tag, and another after it, then everything will be good in preview, but when reading the full post It will still show the first image too that was before the tag, making everything stupid.

Since both image have to be in the same place, have the same size and same look, only with different text inside, maybe there is a way to add 'if' sentence like "if it's 'Home Page' || 'Category Page' then show there picture n1, else (when reading this post) show there picture nr.2" ..
It sounds kinda stupid so I doupt that is an option but It's just an idea.

There are 2 options that could work for me.
The first one is:
"display excerpt Only for post ID XX on Catergory Page AND Home Page"
since
Code:

if (is_single('XX'))
will only display excerpt on this Post Page itself (definitely not what I want) I don't know how to make it happen.

The second one is:
"display excerpt Only for Category YY on Category Page AND Home Page"
I was able to get the first part to work using
PHP Code:

<?php if (!is_category('XX')) { bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); }
else {        global 
$bfa_ata$post;
        echo 
'<div class="post-bodycopy clearfix">'
        
the_excerpt(); 
        echo 
'</div>'; }
?>

, but it shows excerpts only when viewing posts on that Category Page and not for the posts in that category on Home Page. And I don't know how to make it work.


I hope there is somekind of solution for this,

Thank you in advance,
A.L.

vintario Nov 25, 2010 12:46 AM

So can anyone please help?

vintario Dec 2, 2010 02:56 PM

Please, anyone?
Atleast tell me if it's not doable or nobody just wants to help. It's not like I have anywhere to ask for help.
If I won't be able to accomplish this I will need to redo all my posts..

juggledad Dec 2, 2010 07:30 PM

You might be able to do it by adding some code at ato->Style and Edit CENTER Area-> The LOOP. What I'd do is goo look in the actual theme code to see how the excerpt is built, then try and duplicate that code in a php if statement in 'The LOOP' when the conditions you want are met.

vintario Dec 3, 2010 03:02 AM

Thank you for at least trying to help me, but I'm total beginner at this, so I wasn't able to figure it out. Yeah, I found that code that generates excerpts, I tried modifying it and adding in The Loop, but most of the time I just made all posts disappear, other times it added all other posts that were on the page under the post that I'm modifying into that post, so it created one long post..

juggledad Dec 3, 2010 04:58 AM

I'm sure this is doable, but as you see it will take some time and is beyond the scope of the forum. You could look to hire someone with PHP and wordpress knowledge to do it for you if you really need it.


All times are GMT -6. The time now is 02:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.