Unnecessary border shown when clicked content area on understrap theme - html

I'm developing wordpress theme using Understrap, with using customstrap child theme of livecanvas. It uses Bootstrap 4.
I developed my theme, but there is unnecessary border when I clicked the content area on theme. I checked the code on browser using inspects but i could not find the code that caused this problem.
here is understrap repo: https://github.com/understrap/understrap
and my page.php
<?php
/**
* The template for displaying all pages
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* #package understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
get_header();
$container = get_theme_mod( 'understrap_container_type' );
?>
<div class="wrapper" id="page-wrapper">
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
<div class="row">
<!-- Do the left sidebar check -->
<?php get_template_part( 'global-templates/left-sidebar-check' ); ?>
<main class="site-main" id="main">
<?php
while ( have_posts() ) {
the_post();
get_template_part( 'loop-templates/content', 'page' );
}
?>
</main><!-- #main -->
<!-- Do the right sidebar check -->
<?php get_template_part( 'global-templates/right-sidebar-check' ); ?>
</div><!-- .row -->
</div><!-- #content -->
</div><!-- #page-wrapper -->
<?php
get_footer();
Which selector that I need to use to prevent this problem?
Here is the image of this be like:
1- 1st image is Default
2- 2nd image When I clicked the content area
When I clicked the content area

I'm pretty sure this is outline property in CSS.
As we cannot see your code right now, for debugging I would suggest to try pasting this in your styles to check if that helps:
* {
border: none !important;
box-shadow: none !important;
outline: none !important;
}

Look at the following code there tabindex is used for keyboard accessibility. :focus is triggered Where tabindex is used.
<div class="<?php echo esc_attr( $container ); ?>" id="content" tabindex="-1">
The div mentioned above has an id content so if you'd like to remove outline only from there use the following CSS code.
#content { outline: none !important; }.
Don't use asterisk with :focus like *:focus to solve this then that might also remove outline from some other styles.

When I add the code below to custom css in wordpress:
*:focus{outline: none !important;}
It works.
But I don't understand that why it does not work when I add it into style.css

Related

My custom css is not working when using bootstrap for a wordpress theme

I am just learning Wordpress development and am building a theme. I use bootstrap and my own custom css. I know custom files are to be declared AFTER bootstrap, but this hasn't gotten my css going.
My function's code:
<?php
function smartwp_remove_wp_block_library_css(){
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'wc-block-style' ); // Remove WooCommerce block CSS
}
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css', 100 );
function load_stylesheets() {
wp_register_style('bootstrap',get_template_directory_uri() . '/css/bootstrap.min.css',
array(),false,'all');
wp_enqueue_style('bootstrap');
wp_register_style('style',get_template_directory_uri() . '/style.css',
array(),false,'all');
wp_enqueue_style('style');
}
add_action('wp_enqueue_scripts', 'load_stylesheets');
function loadjs() {
wp_register_script('customjs',get_template_directory_uri() . '/js/scripts.js','',true);
wp_enqueue_script( 'customjs');
}
add_action('wp_enqueue_scripts','loadjs');
You see I tried also some code I found on the net to disable Guttenberg css, but to no effect. I see from the console that my style.css is included and I see bootstrap working.
My css isn't much yet:
/*
Theme name:
Author:
*/
body {
background: "#ff03ab";
}
I must be doing something wrong, typos maybe? Also tried clearing browser history, and variety of css elements in my style.css
To make sure the custom CSS file is loaded after bootstrap, you have to add bootstrap as a dependency in wp_register_style():
https://developer.wordpress.org/reference/functions/wp_register_style/
wp_register_style( 'style', get_template_directory_uri() . '/style.css', array( 'bootstrap' ), false, 'all' );

Remove Inline Style Element Of a HTML Tag

I wanted to add a little Menu Hover Animation to my Wordpress Menu:
https://www.littlesnippets.net/blog/some-css-menu-inspiration-using-animated-lines
Somehow my Wordpress Theme (Avada) writes inline html styles to the tags:
<ul id="menu-menu" class="fusion-menu">
<li ><a href="#Home" data-hover="Home" **style="overflow: hidden; height: 100px;**"><span class="menu-
text">Home</span></a></li>
<li ><a href="#Events" data-hover="Events" **style="overflow: hidden; height: 100px;**"><span
class="menu-text">Events</span></a></li>
</ul>
...
I added this Code to my functions.php:
add_filter( 'the_content', 'the_content_filter', 20 );
function the_content_filter( $content ) {
$content = preg_replace('#<a.*?>(.*?)</a>#i', '<a>\1</a>', $content);
return $content;
}
But this removes too much style elements on my page. How can I adjust the function, that only the inline style tags in the class .fusion-menu get deleted?
Thanks for your help!
$('ul#menu-menu li').attr('style', function(i, style)
{
return style && style.replace(/display[^;]+;?/g, '');
});
Please check with above code , It will remove with jQuery
I've tried already with jQuery but this won't work because I think the function must point exactly on the tag.
The inline style comes from the fusion builder template but I don't know exactly in wich php file this function lies.
My favourite Method would be when someone could complete my function with the preg_replace with the target of all elements in selector class .fusion-menu
Thanks...

Yii2 full width layout in index.php

What is the best practice to make different layouts for pages in Yii2?
The problem I am facing is that Yii2 layout/main.php code looks like
<div class="container">
<?= $content ?>
</div>
Yii2 uses Bootstrap and I need to make full width image only in site/index.php.
Basically in the index.php I need to wrap
<?= $this->render('_search') ?>
into .container-fluid class.
How can I replace .container class to .container-fluid class only for index.php page?
Make a new layout, e.g. layout-fluid.php, and in controller do
public function actionIndex()
{
$this->layout = 'layout-fluid';
return $this->render('index');
}
If fluid container is the only change you need, you can do this instead: in index view file add
$this->params['fluid'] = true;
And in layout file change the desired container to
<div class="container<?= $this->params['fluid'] ? '-fluid' : '' ?>">
params array is a good place to propagate information within view.
If you need just change wrapper class only for site/index, in main.php you can do it like this:
<div class="container<?=($this->context->id=='site' && $this->context->action->id=='index')?'-fluid':'';?>">
<?= $content ?>
</div>

Is it possible to use JSSOR slider on e.g. DIV instead of IMG objects?

I'm creating an automated events display system for a university department that creates posters based on SQL data. The idea is to create both SVG and PDF files of a poster so that the PDF can be used for printing, and the SVG can be displayed on an automatically updating web connected digital signage display (OK, OK, a TV on the wall).
I've got the SVG files formatted how I want them, but when I tried to use the slider libraries to display the .svg files, the formatting of certain elements goes haywire. I've narrowed this down to the fact that SVGs displayed using the IMG tag don't work properly. I've included the file into its own DIV, as it's an HTML5 project; if I move the 'u=image' to the DIV tag, the transition works OK but the SVG breaks once the transition is over (the text origins all seem to reset to upper left).
Just wondered if there was a way of doing this.
<!-- Slides Container -->
<div u="slides" style="cursor: move; position: absolute; left: 0px; top: 0px; width: 764px; height: 1080px; overflow: hidden;">
<?php
// DATA FROM SEMINARS_DETAIL
$query = "SELECT * FROM `seminars_detail` LIMIT 4"; //Date >= NOW()
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
if($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$sem_id = $row["sem_id"];
$file = "../images/posters/$sem_id.svg";
//SVG not working properly.
echo "<div>";
echo "<img u=\"img\" src=\"$file_th\" />";
echo "</div>";
//Compared with...
//Transition works, but text origin shifts when transition finishes.
echo "<div u=\"image\">";
include $file;
echo "</div>";
}
} else {
echo 'NO RESULTS';
}
?>
</div>
First of all, please disable slideshow.
Also, please try use svg as background image.
<div u="slides" ...>
<div style="background-image: url(l.svg);"></div>
<div style="background-image: url(2.svg);"></div>
<div style="background-image: url(3.svg);"></div>
</div>

Remove Link From Title/Remove Small Text From Header On One Wordpress Page

i want to remove the link from my header using CSS so that only the text "my inner yoga" shows, but it is not a hyperlink. i tried to do
#post-28 .site-title.a {display:none;}
but it didnt work. i know it has to do with the site-title because i don't know how to say in CSS that i want to only have the "a" tag not working, but only in the site-title div.
also, is it possible to remove the "learn more" text from the right side of my header? i don't know PHP so that part is confusing to me. i dont know if its possible to do with css.
the link is: http://myinneryoga.com/strange-exotic-fruit-supplement/
Can't be done with CSS, but you can just display the site title itself using
<?php echo $bloginfo('name'); ?>
If you only want it removed on one page, use a conditional IF statement to query the page ID or slug and set a version without the site URL attached and an ELSE to set a version with the URL.
To remove the learn more text, add this code to the end of your functions.php file:
function improved_trim_excerpt($text) { // Fakes an excerpt if needed
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text, '<p>');
$excerpt_length = 100;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words)> $excerpt_length) {
array_pop($words);
array_push($words, '');
$text = implode(' ', $words);
}
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'improved_trim_excerpt');
If I'm correct the theme developer added a custom excerpt ending. Either that or it's just a hardcoded link, in which case go into the header file and use the find function of whatever editor you are using and search for the "learn more" text, then just remove it and the tag around it.
Not sure how you're generating "Learn Now", but if it's just a link you should be able to do something like the following (let's say the post ID is 17).
<?php if (!is_single(17)) { ?>
Learn More
<?php } ?>
Like Corey said above, use <?php echo $bloginfo('name'); ?> to show the name. Remove any <a> tag that might be surrounding it.
Try this..
Modify style.css line 482
#site-title a {
color: #FFFFFF;
cursor: default;
pointer-events: none;
}