Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Excerpts, Read more, Pagination »

[SOLVED] Conditional Excerpt Strip


  #1  
Old Mar 30, 2011, 04:07 PM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
I would like the post excerpts to not strip html tags for a specific page. I tried inputting the following in Configure EXCERPTS > "Don't strip these tags"

<?php if (! is_home() ) {?><iframe><span><p><?php } ?>

but it seems Atahualpa ignores the php conditional test.

Using this so that I can use the full image size or embedded video for the excerpt in all pages except for the home page. The home page is using featured image thumbnails that are a certain size.
__________________
---
>> Los Angeles Search Engine Marketing - Web Development & Marketing

Last edited by SupraTT; Mar 30, 2011 at 04:32 PM.
  #2  
Old Mar 30, 2011, 09:51 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
I am trying to understand what you want. Is the following correct?
  • You want to strip tags on home page
  • You dont' want to strip the iframe span and p tags on all but the home page
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Last edited by juggledad; Mar 31, 2011 at 04:19 AM.
  #3  
Old Mar 30, 2011, 10:07 PM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
Quote:
Originally Posted by lmilesw
I am trying to understand what you want. Is the following correct?
  • You want to strip tags on home page
  • You dont' want to strip the iframe span and p tags on all but the home page
Hi Larry,

Yes, this is exactly what I want to do.

Thank you,

SupraTT
__________________
---
>> Los Angeles Search Engine Marketing - Web Development & Marketing

Last edited by juggledad; Mar 31, 2011 at 04:19 AM.
  #4  
Old Mar 31, 2011, 05:05 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
That is not an area that php is evaluated in.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Mar 31, 2011, 09:47 AM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
Quote:
Originally Posted by juggledad
That is not an area that php is evaluated in.
Hi Juggledad,

Do you know where I can make the necessary modifications? I looked in functions.php:

Code:
function bfa_wp_trim_excerpt($text)
Code:
// Build the excerpt from the post 
		$text = apply_filters('the_content', $text);
 		$text = str_replace(']]>', ']]>', $text);
		$text = strip_tags($text, $bfa_ata['dont_strip_excerpts']);
I don't understand the $bfa_ata['dont_strip_excerpts'] part; is $bfa_ata a function? variable? Is $bfa_ata['dont_strip_excerpts'] equivalent to '<p><iframe><span>' aka the html elements I placed in Atahualpa's dashboard's Don't Strip area?

Sorry my PHP knowledge is basic.
__________________
---
>> Los Angeles Search Engine Marketing - Web Development & Marketing
  #6  
Old Mar 31, 2011, 11:36 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you could try this, change the line
HTML Code:
		$text = strip_tags($text, $bfa_ata['dont_strip_excerpts']);
to
HTML Code:
	if (!is_home()) {
			$text = strip_tags($text, $bfa_ata['dont_strip_excerpts'].'<iframe><span><p>');
		} else {
			$text = strip_tags($text, $bfa_ata['dont_strip_excerpts']);
		} 
theoretically this will add the iframe, span and p when you are not on the home page.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Apr 2, 2011, 02:53 PM
SupraTT's Avatar
SupraTT
 
78 posts · May 2009
Hi Juggledad,

Thank you for the coding help. That worked for me.

SupraTT
__________________
---
>> Los Angeles Search Engine Marketing - Web Development & Marketing

Bookmarks

Tags
conditional, excerpts

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"don't strip these tags" + excerpt issues SC801 Excerpts, Read more, Pagination 17 May 25, 2011 07:21 PM
conditional formatting for custom post types titaniumbones Center area post/pages 0 Feb 22, 2011 09:15 AM
Conditional category styling = PHP bender57 Center area post/pages 1 Dec 17, 2010 07:09 PM
Conditional PHP issue MyJourneytoMillions Center area post/pages 6 Feb 10, 2010 03:11 PM
How do I provide a conditional Widget in the sidebars? bgt Forum How-To 1 Jun 1, 2009 02:16 PM


All times are GMT -6. The time now is 08:42 PM.


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