ThemeShaper Forums » Thematic

Code Snippets

(20 posts)
  • Started 5 years ago by Chris
  • Latest reply from Chris
  • This topic is not a support question
  1. Hey,

    I hereby declare the bar officially open!

    Took me a while but finally the Code Snippets area on my blog is up and running and has its own RSS feed.

    At the moment there's nothing more than the Welcome Message. Starting tomorrow, I'll collect all my code snippets posted here, test everything once again and publish the code snippets on my site.

    This is the link to the Code Snippet Area: Code Snippets

    And here's the RSS Feed: Thematic - Code Snippets

    Cheers,

    Chris

    Posted 5 years ago #
  2. This is great Chris!

    Posted 5 years ago #
  3. Thanks a lot, Danny!

    The first article How to use a different layout for a certain page? is online.

    Will attach all files for download to prevent character mess during copy & paste.

    Cheers,

    Chris

    Posted 5 years ago #
  4. Downloads addded.

    Posted 5 years ago #
  5. Hey Chris, could I translaete the page ii italian (credtis to you, as always)???

    Posted 5 years ago #
  6. Hey Danny,

    Yes .. you can take this and all future content published for Thematic and translate it for your blog :-)

    Cheers,

    Chris

    Posted 5 years ago #
  7. Thank you. But could I post "that" pic aside your name??? ;)

    Posted 5 years ago #
  8. May I do the same to spanish?

    Posted 5 years ago #
  9. Feel free to translate it and use it on your blog.
    Cheers,
    Chris

    Posted 5 years ago #
  10. in my opinion, we have to create a sort of webring:

    from wikiP:

    A webring in general is a collection of websites from around the Internet joined together in a circular structure. When used to improve search engine rankings, webrings can be considered a search engine optimization technique.

    To be a part of the webring, each site has a common navigation bar; it contains links to the previous and next site. By clicking next (or previous) repeatedly, the surfer will eventually reach the site they started at; this is the origin of the term webring. However, the click-through route around the ring is usually supplemented by a central site with links to all member-sites; this prevents the ring from breaking completely if a member site goes offline.

    Webrings are usually organized around a specific theme, often educational or social. Web rings usually have a moderator who decides which pages to include in the web ring. After approval, webmasters add their pages to the ring by 'linking in' to the ring; this requires adding the necessary HTML or JavaScript to their site.

    only with links to different languages, not with the common navigation... in this way we could gain two (or more) linkbacks each... what do you think???

    Posted 5 years ago #
  11. Perfect idea .. there's only one thing for me to check. Let's ask Ian if anything speaks against publishing my articles on his blog first. I would publish the German version on my site .. in this case the whole webring idea dealing with the same content in different languages would be consistent.

    And we would need some more people supporting this idea.

    Cheers,

    Chris

    Posted 5 years ago #
  12. New article: How to remove the sidebar from a certain page?

    Cheers,

    Chris

    Posted 5 years ago #
  13. Hi Chris, great function, I'm using it with success. Quick question...can I designate several pages in the same function? I tried adding a page a couple different ways.

    Adding as comma separated list:

    function remove_sidebar() {
    	// We test if we are on the page 'Literature Request Form'
    	if (is_page('literature-request-form,residential-products')) {
    		// Yes, we are .. now we switch off the sidebar
    		return FALSE;
    	} else {
    		// we are not .. we leave the switch on
    		return TRUE;
    	}
    }
    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');

    This didn't work.

    Adding like this:

    function remove_sidebar() {
    	// We test if we are on the page 'Literature Request Form'
    	if (is_page('literature-request-form'))
    		// Yes, we are .. now we switch off the sidebar
    	// We test if we are on the page 'Residential Products'
    	if (is_page('residential-products')) {
    		// Yes, we are .. now we switch off the sidebar
    		return FALSE;
    	} else {
    		// we are not .. we leave the switch on
    		return TRUE;
    	}
    }
    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');

    This removed the sidebar on ALL pages.

    I have a feeling I'm missing something simple. Can anyone advise?

    Posted 5 years ago #
  14. Missing several tiny bits ;)

    It should be:

    is_page(array('literature-request-form', 'residential-products'))

    Chris

    Posted 5 years ago #
  15. Thanks Chris, I had tried that too and couldn't get it to work. I just tried again and I couldn't get it.

    function remove_sidebar() {
    	// We test if we are on these pages
    if (is_page(array('literature-request-form', 'residential-products')) {
    // Yes, we are .. now we switch off the sidebar
    		return FALSE;
    	} else {
    		// we are not .. we leave the switch on
    		return TRUE;
    	}
    }
    // Connect the filter to thematic_sidebar()
    add_filter('thematic_sidebar', 'remove_sidebar');

    What I did find to work for me was this:

    if (is_page('literature-request-form') || is_page('residential-products')) {

    But I have a feeling that using an array would be more efficient. Does my code look correct?

    Posted 5 years ago #
  16. I hate it ;)

    Ok .. could take some time to find out if this is a problem with WordPress.

    First I need to fix the famous z-index bug in IE6 / IE7 for the PowerBlog theme.

    Chris

    Posted 5 years ago #
  17. Ha! Cool, I'll just leave as is for now and revisit this later. I'll just add more
    || is_page()
    as necessary:)

    Thanks Chris!

    Posted 5 years ago #
  18. Chris, I got your code to work by putting an extra closing bracket at the end

    if (is_page(array('home', 'gallery')))

    This is a great place to learn WP and php
    d_rec

    Posted 4 years ago #
  19. Hi,

    thanks a lot for your help! :)

    Chris

    Posted 4 years ago #
  20. Hi,

    thanks a lot for your help! :)

    Chris

    Posted 4 years ago #

RSS feed for this topic

Reply

You must log in to post.