Page layout is broken when viewing search results.

Check out the markup. On the search results page, the <body> element is assigned the classes search and search-no-results. <body class=”search search-no-results”> Looking at the CSS, the styles for .search are intended to be used for the search input. They are working for that, but they are also being applied to the body due to … Read more

How to create table in wordpress without plugin? [closed]

I am not sure i understand the question but if ur looking to create a table you can do it with simple HTML and CSS. Take a look at this: https://www.w3schools.com/html/html_tables.asp Again, if you need this in all posts then you might consider adding this code inside your theme’s loop.php (or other equivalent file which … Read more

Adding Custom css file

Put this code in functions.php file for add new css file (more info here). add_action( ‘wp_enqueue_scripts’, ‘enqueue_my_styles’ ); function enqueue_my_styles() { wp_enqueue_style( ‘my-theme-ie’, get_stylesheet_directory_uri() . “/css/ie.css”); } if using a parent theme then put code in parent theme function.php file and use get_template_directory_uri() if using a child theme then put code in child theme function.php … Read more

How to make container class in PHP

You can do this using below code. if ($slide_title) { $strret .= ‘<div class=”container”>’; $strret .= ‘<a class=”‘.$slide_linkurl.'”><h2>’.$slide_title.'</h2></a>’; $strret .= ‘<p>’.$str.'</p>’; $strret .= ‘<a href=”‘.$slide_linkurl.'” class=”da-link”>’.$slide_linktext.'</a>’; $strret .= ‘</div>’; }

Sidebar button click redirect when user is not logged in instead displays it

when you want interaction between client side and server side you should use ajax . i think this Link will be very helpful to you 🙂 Put this in your javascript var data = { action: ‘is_user_logged_in’ }; jquery.(‘.x-btn-widgetbar’).on(‘click’,function(){ jQuery.post(ajaxurl, data, function(response) { if(response == ‘yes’) { // user is logged in, do your stuff … Read more

header_image() with CSS

No, in general, it’s not possible to use php in CSS. But you can set background image in php file. Like.. <div class=”headerimg” style=”background-image: url(<?php echo header_image(); ?>)”></div> Then in CSS file using class you can set all the other properties you need like height, width, background-position and so on.

Using custom HTML tags to WordPress [closed]

[*] You can expand list of KSES allowed tags (and their attributes): add_filter(‘wp_kses_allowed_html’, ‘wpse_283385_blocktip_tag’); function wpse_283385_blocktip_tag($allowed_tags) { $allowed_tags[‘blocktip’] = array( ‘name’ => true, ‘id’ => true, ‘class’ => true, ‘style’ => true ); return $allowed_tags; } add_filter(‘tiny_mce_before_init’, ‘wpse_283385_blocktip_tag_tinymce’); function wpse_283385_blocktip_tag_tinymce($init) { $tags=”blocktip[*]”; if ( isset( $init[‘extended_valid_elements’] ) ) { $init[‘extended_valid_elements’].= ‘,’.$tags; } else { $init[‘extended_valid_elements’] … Read more