• 0

Add Title to Carousel


Question

Posted · Report post

I have read the thread at http://www.pagelines.com/forum/topic/11137-how-to-add-title-to-carousel/ 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:

[CODE]
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {?>
[/CODE]

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

TIA
~Rat

Share this post


Link to post
Share on other sites

34 answers to this question

  • 0

Posted · Report post

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

 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi
You can try with

[code]
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {?>
YOUR TITLE HERE
<?php
}
[/code]

Please see first this link
[color=#215e9b][url="http://www.pagelines.com/wiki/How_to_Use_the_PageLines_Customize_Plugin"]How_to_Use_the_PageLines_Customize_Plugin[/url][/color]
1 person likes this

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

[quote name='batman' timestamp='1347919361' post='127182']
Hi
You can try with

[code]
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {?>
YOUR TITLE HERE
<?php
}
[/code]

Please see first this link
[color=#215e9b][url="http://www.pagelines.com/wiki/How_to_Use_the_PageLines_Customize_Plugin"]How_to_Use_the_PageLines_Customize_Plugin[/url][/color]
[/quote]

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. [color=#000000][font=Consolas, Monaco, 'Courier New', Courier, monospace][size=3][background=rgb(243, 243, 247)]<p><?php single_cat_title('Currently browsing '); ?>.</p>)[/background][/size][/font][/color] into the "YOUR TITLE HERE" verbiage?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

~Rat

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi rat
You can try with

[code]
add_action('pagelines_inside_top_carousel', 'add_my_cat');
function add_my_cat( ) {
printf( '<div class="add_my_cat">%S</div>',the_category() );
}
[/code]

and move with css rules


[code]
#carousel .content ul li {
float: none;
text-align: left;
position: relative;
}[/code]

[size=4]but i´m not sure[/size]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

[quote name='batman' timestamp='1347923151' post='127190']
Upppsss sorry, is best to wait as rob said ....
;)
[/quote]

LOL...I have just discovered that :)

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Doesn't seem to be a problem to me.

This:

[CODE]
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {
single_cat_title('Currently browsing ');
}
[/CODE]

Produces this:
[img]http://i.imgur.com/KIE5T.png[/img]

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):

[CODE]

add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {

printf( '<p>Currently browsing: %s</p>', single_cat_title('', false) );

}
[/CODE]

Share this post


Link to post
Share on other sites
  • 0

Posted (edited) · Report post

@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 [url="http://millerlandscapearchitecture.com/tristonefirst-community-bank/"]http://millerlandsca...community-bank/[/url]

Username: [i][s]removed[/s][/i]
Password: [i][s]removed[/s][/i] Edited by Simon Prosser
removed login details!!

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

[quote name='Simon Prosser' timestamp='1347978312' post='127252']
Never EVER include login details in a public forum!!!
This forum software has an excellent private message feature please use that.
[/quote]

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

[quote name='ratputin' timestamp='1347976505' post='127248']
@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 [url="http://millerlandscapearchitecture.com/tristonefirst-community-bank/"]http://millerlandsca...community-bank/[/url]

Username: [i][s]removed[/s][/i]
Password: [i][s]removed[/s][/i]
[/quote]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

@Rob - just saw this. PM sent.

TIA
~Rat

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

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 [b]/tristonefirst-community-bank/[/b]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

[b]/tristonefirst-community-bank/ [/b]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:

[CODE]
add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {
printf( '<h1>See more in this Category <br /><br /> %s</h1>', single_cat_title('', false) );
}
[/CODE]

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

Visual Reference
[img]http://millerlandscapearchitecture.com/screenie.png[/img]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hi,

Can you check to see if the text color is set to black and therefore would be unable to see it. You can check this in Firebug/Google Chromes web dev tool.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Danny,
It is not black....lol...always good to cover the basics. :) The "h1" tag is set to "#fff". I also do not see the cat name in the Elements code.

Visual reference in case I missed something (I have highlighted the title to try to reveal any text):
[img]http://millerlandscapearchitecture.com/screenie-02.png[/img]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Honestly, I think this is going to require the assistance of one of our pro developers found at http://www.pagelines.com/pros.

Apologies, but our moderators aren't necessarily developers and validating or correcting a hook like this could result in errors on your site that I for one, would not like to create. Likely, this is a quick solution one of them can provide.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Don't give up on me Rob :). I really do not want to go that route if possible. FYI - There has to be some sort of conflict in the framework. The Facebook button will not work in the Sharebar correctly either ( I started a separate thread, but doubt an answer will be found ).

Seems like every time I come up against something with this platform, I have to solve it on my own. If you've got an inkling about the hook, I'm willing to give it a go...and won't hold you accountable :).

Rat

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I just tested the code evan posted and tested cats up to 3 levels deep
http://screencast.com/t/9bsMIYnHGZ

http://screencast.com/t/nhJu4kCpAXD

for ref the code i used is:

add_action('pagelines_inside_top_carousel','add_carousel_title');
function add_carousel_title() {
printf( '<p>Currently browsing: %s</p>', single_cat_title('', false) );
}
and i added it to pagelines-customize.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now