Tag Info

Hot answers tagged

5

Here is another CSS-only approach, without any inline-PHP and needless CSS-spam in the head. If your theme is correctly using body_class() and a user is logged in, Wordpress adds a class "logged-in" to the body-element, so we can use this in our stylesheet: <--logged out--> .sellertitle { float: none; width: 49%; } .otherseller { display: ...


2

As far as I've seen you're missing bootstrap CSS grid markup inside your page div, so to start add container class to page div and below that a .row element, for more inforamation on how the Bootstrap grid works check documantation and remember that all Js and styles are based on the correct markup selectors_


1

You'll want to use a PHP if statement in combination with is_user_logged_in If you're editing your header try this: <?php if (!is_user_logged_in()) { ?> // Your social media icons code goes here <?php } ?> The exclamation point before is_user_logged_in() means 'is not' in PHP, so your code essentially says, "If the user is not logged in, show ...


1

Give this a try? function oddeven_post_class ( $classes ) { global $current_class; $classes[] = $current_class; $current_class = ($current_class == 'odd') ? 'even' : 'odd'; return $classes; } add_filter ( 'post_class' , 'oddeven_post_class' ); global $current_class; $current_class = 'odd'; and be sure you're using <?php post_class(); ?>


1

you could try something like this... this will add css on the head add_action('wp_head', 'add_css_head'); function add_css_head() { if ( is_user_logged_in() ) { ?> <style> .sellertitle { float: left; width: 49%; } </style> <?php } else { ?> ...


1

I had a very similar issue. I needed to target a specific wp_nav_menu() and replace the a links with a class. Here is my solution in reference to the OP: function theme_add_menuclass( $classes, $args ) { if ( $args->theme_location == 'your-menu-location' ) { return preg_replace( '/<li /i', '<li class="your-class"', $classes ); } ...


1

This isn't a WordPress issue, although it IS an easy CSS fix. The small space between the end of image and the slideshow is axtually 2 pixels wide and caused by the #left-area div. You can just up the width by 2 pixels on #left-area. Like this: #left-area { width: 639px; } It is currently 637px. You could also up the padding-left by 2 pixels to ...


1

WordPress does remove style tags. While it allows HTML to some degree in post content, it's not really meant for full range of it. It's a content, not markup data. You could use tiny_mce_before_init filter to adjust extended_valid_elements for TinyMCE instance. See this answer on SO for some examples.


1

I've found the solution to the problem myself. for anyone out there, surround your header call with the conditional 'is_product_category( 'day' )'. you can read more about it here: http://docs.woothemes.com/document/conditional-tags/


1

do not use <font> html tag, it is old and i'm not even sure if can work in modern browsers. instead use <span> (for inline text) or <p> (for paragraph). php and html can work together but there's an appropriate way to write it. generally speaking, html code is wrapped with double quotes "html" and php with periods .php.: echo "html code ...


1

...there's no way to include the style in Wordpress posts, at all? You need to add the style tag to the list of allowed post tags, and also ensure TinyMCE recognises it in the editor: function wpse_180472_wp_kses_allowed_html( $tags, $context ) { if ( $context === 'post' ) $tags['style'] = array(); return $tags; } add_filter( ...



Only top voted, non community-wiki answers of a minimum length are eligible