Jump to content


Photo
- - - - -

Add Title to Carousel

carousel title Add

Best Answer ratputin , 12 July 2013 - 01:45 AM

I have implemented an ugly work around...but it works in IE8-10, FF, Chrome & Safari as well on an iPad. In the end, I have done the following...

 

Add this code to plugins > page lines-customize > functions.php

 
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {
printf( '<p class="cat-see-more">&nbsp;</p>' . the_category( ) );
}

*note: the p class was needed in order to have the carousel position properly under the new title.

 

Add this CSS to the Child Theme Stylesheet:

 
#carousel .content ul li a span.list-title { 
line-height:10px;
/* The following was added because alpha background was acting wonky in IE8 */
height:115px;
padding-top:50px; 
bottom:-75px;
background-image: url(/wp-content/uploads/2013/07/pixel_000-75pct.png);
background-color:transparent;
 }

#carousel .content ul li a:before { content:"See more in "; } /* Adds verbiage before the_category */

.section-carousel .content ul li a img { margin-top:-25px; } /* hides the verbiage that shows up above the carousel pictures */

.cat-see-more { margin-bottom: 20px; line-height:35px; } /* Added this for some position love */

This isn't the most elegant solution, but it does the job until a better one comes along. Thanks to all who helped along the way.

 

~Rat

 

Go to the full post


  • Please log in to reply
34 replies to this topic

#1 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 17 September 2012 - 09:11 PM

I have read the thread at

Please Login or Register to see this Hidden Content

as well as the "add Hooks docs but am having an issue adding a title to the Carousel. I have adding the code provided in the referenced thread to my functions.php and init.php foles no avail. The code looks like this:

Please Login or Register to see this Hidden Content


When I try to use it, I receive a syntax error. Any ideas?

TIA
~Rat

#2 batman

batman

    Bat Learning

  • Members

  • 2115 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 17 September 2012 - 10:02 PM

Hi
You can try with

Please Login or Register to see this Hidden Content


Please see first this link

Please Login or Register to see this Hidden Content


  • ratputin likes this

#3 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 17 September 2012 - 10:38 PM

Hi
You can try with

Please Login or Register to see this Hidden Content


Please see first this link

Please Login or Register to see this Hidden Content



Worked perfectly and thanks for the plugin tip! Perhaps you could help me one more thing...how would I go about adding the Current Category (i.e. <p><?php single_cat_title('Currently browsing '); ?>.</p>) into the "YOUR TITLE HERE" verbiage?

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 17 September 2012 - 10:43 PM

I have to check with our developers but it seems to me that the hook isn't structured to work properly. I will ask one of my developers to take a look in the morning and apologize for the delay.

#5 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 17 September 2012 - 10:45 PM

Thanks Rob and no worries. Any help is greatly appreciated!

~Rat

#6 batman

batman

    Bat Learning

  • Members

  • 2115 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 17 September 2012 - 11:03 PM

Hi rat
You can try with

Please Login or Register to see this Hidden Content


and move with css rules


Please Login or Register to see this Hidden Content


but i´m not sure

#7 batman

batman

    Bat Learning

  • Members

  • 2115 posts
  • LocationBuenos Aires, Argentina
  • Framework Version:DMS
  • Country: Country Flag

Posted 17 September 2012 - 11:05 PM

Upppsss sorry, is best to wait as rob said ....
;)

#8 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 12:22 AM

Upppsss sorry, is best to wait as rob said ....
;)


LOL...I have just discovered that :)

#9 bxbmedia

bxbmedia

    Advanced Member

  • Members

  • 79 posts
  • LocationAnn Arbor, MI

Posted 18 September 2012 - 03:08 AM

Doesn't seem to be a problem to me.

This:

Please Login or Register to see this Hidden Content


Produces this:
Posted Image

If you wanted to wrap that text in a <div> or <p> tag or add some other code to it, you'd need to do things a little differently like so (although this isn't the only way to do it):

Please Login or Register to see this Hidden Content



#10 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 01:55 PM

@bxbmedia thanks for the help. I tried the first code you posted prior to starting this thread...doesn't work for me. Your second code does show the "Currently browsing:" text, but not the category name. It's prob something I've done incorrectly. Here's a link/creds for reference:

URL

Please Login or Register to see this Hidden Content



Username: removed
Password: removed

Edited by Simon Prosser, 18 September 2012 - 02:24 PM.
removed login details!!


#11 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 18 September 2012 - 02:25 PM

Never EVER include login details in a public forum!!!
This forum software has an excellent private message feature please use that.

#12 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 02:41 PM

Never EVER include login details in a public forum!!!
This forum software has an excellent private message feature please use that.


It is a temp Subscriber account setup specifically for previewing the site.

#13 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 18 September 2012 - 02:44 PM

Doesn't matter, just dont do it, use a private message, these forums are indexed everyday, you will have spambots hammering your site for that login even if it is deactivated.

#14 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 02:49 PM

I appreciate the concern. However that is a dev build and the URL will be discarded once the site is completed and migrated. If it were otherwise I wouldn't have posted it. Thanks again.

KO

#15 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 18 September 2012 - 08:20 PM

Many people post logins with full admin access here. It's our policy to always redact any login information posted publicly, no matter what access level it may include.

Please let us know if bxbmedia's solution worked.

#16 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 08:25 PM

I see your point about the login. RE the fix...unfortunately, this still applies:

@bxbmedia thanks for the help. I tried the first code you posted prior to starting this thread...doesn't work for me. Your second code does show the "Currently browsing:" text, but not the category name. It's prob something I've done incorrectly. Here's a link/creds for reference:

URL

Please Login or Register to see this Hidden Content



Username: removed
Password: removed



#17 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 18 September 2012 - 10:16 PM

Send me a PM with your login info so I can see the site.

#18 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 18 September 2012 - 11:31 PM

@Rob - just saw this. PM sent.

TIA
~Rat

#19 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 19 September 2012 - 12:57 AM

Rat, from what I see here, it appears to be working correctly. Is there some particular place I should view where it isn't working, where there are posts in the category?

I'm looking at /tristonefirst-community-bank/

#20 ratputin

ratputin

    Advanced Member

  • Members

  • 66 posts

Posted 19 September 2012 - 01:47 AM

/tristonefirst-community-bank/ is a post in the category "Financial/Corporate" which is a sub-category of "Portfolio." zThe client was having a look at the site's progress so I changed the code to read:

Please Login or Register to see this Hidden Content


The issue is that the "single_cat_title" doesn't show. At least, I can't see it :)

Visual Reference
Posted Image





Also tagged with one or more of these keywords: carousel, title, Add