xronox
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: All-in-One Event Calendar] customize main calendar pageOk… I uploaded to standard and it doesn’t have this problem. So the Lite version is too lite for me I guess…
Forum: Themes and Templates
In reply to: [Twenty Twelve] How to get last menu item aligned to the rightYeah…
This was all the code I needed:
$items .= '<li class="menu-item menu-search-form">' . $searchform . '';Thanks!
Forum: Themes and Templates
In reply to: [Twenty Twelve] How to get last menu item aligned to the rightYeah, that’s right – I used browser inspection tools.
In the same browser inspection tool I can change
.main-navigation ul.nav-menu text-align: leftto
.main-navigation ul.nav-menu text-align: rightand all items on the menu change.
This is the live link http://www.vopus.tv/ad-pages/6
PS: the CSS code you gave didn’t work
That line gives me a parse error: syntax error, unexpected
function twentytwelve_child_body_class( $classes ) { if( is_page_template( 'page-templates/custom.php') ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } elseif( is_category( array( 'fase-a', 'fase-b', 'fase-c' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } return $classes; } add_filter( 'body_class', 'twentytwelve_child_body_class', 20 );No, that didn’t work – it suddenly applied for all categories.
This works:
function twentytwelve_child_body_class( $classes ) { if( is_page_template( 'page-templates/custom.php') ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } elseif( is_category( 'fase-a' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } elseif( is_category( 'fase-b' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } elseif( is_category( 'fase-c' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } return $classes; } add_filter( 'body_class', 'twentytwelve_child_body_class', 20 );Looks ugly though… Anyone knows how to make this cleaner (so I learn a little php)?
Yes!!!
This worked – I even added some other category templates
} elseif( is_category( 'fase-a' OR 'fase-b' OR 'fase-c' ) )And this also works 🙂 There is probably even a more clean way of doing that… 😉
Very happy – many thanks @alchymyth!!!
Parse error: syntax error, unexpected 'elseif' (T_ELSEIF)This is what I have now.
function twentytwelve_child_body_class( $classes ) { if( is_page_template( 'page-templates/custom.php') ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } elseif( is_category( 'fase-a' ) ) { } } return $classes; } add_filter( 'body_class', 'twentytwelve_child_body_class', 20 );Nice! It worked…
Now for the category template I supposed something liked this
function twentytwelve_child_body_class( $classes ) { if( is_page_template( 'page-templates/custom.php' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } elseif( is_category_template( 'category-fase-a.php' ) ) { foreach($classes as $key => $value) { if ($value == 'full-width') unset($classes[$key]); } } return $classes; } add_filter( 'body_class', 'twentytwelve_child_body_class', 20 );Didn’t work though…
Any suggestions?
@andrew I tried all kind of things but for now not the right one. 🙂
I’m a beginner at css
This sounds good! I will try.
Got the same problem – I want a sidebar on a certain category page.
The category description and posts push the sidebar of the right and brings it below.
<body class="archive category category-fase-a category-2 logged-in admin-bar custom-background full-width custom-font-enabled single-author customize-support" style="">I have a custom template called category-fase-a.php
Yay, that worked pretty well.
Thanks Andrew Nevins!
I don’t know, hehe.
So installed this plug-in and now what?
Thanks for your patience.
<body class="page page-id-2 page-parent page-template page-template-page-templatescustom-php custom-background full-width custom-font-enabled single-author" style="">These are the classes in the body tag.
Where and how do I change this in my custom.php file?
<?php /* Template Name: My Custom Page */ get_header(); ?> <div id="primary" class="site-content"> <div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content --> </div><!-- #primary --> <?php get_sidebar( 'custom' ); ?> <?php get_footer(); ?>PS: I’d rather do it like this then installing plug-ins… I use child theme style.css for modifications but my custom template doesn’t have a class so I can’t call it yet in css (and I don’t know how and if it is worth the trouble)