Skip to content

Commit

Permalink
filter html
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanisler committed May 9, 2022
1 parent bb7bcd4 commit ce84b74
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 8 deletions.
59 changes: 59 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,65 @@







// Login - Register Logo Change
function siforum_logo_change() { ?>
<style type="text/css">
body{
background:#14191f !important;
font-size:20px !important;
}
.login form{
border-radius:10px;
}

#login h1 a, .login h1 a {
background: url(<?php echo get_stylesheet_directory_uri(); ?>/img/logo.png) center no-repeat red;
height:105px;
width:320px;
padding-bottom: 30px ;
border-radius:10px;
}
</style>
<?php }
add_action( 'login_enqueue_scripts', 'siforum_logo_change' );




// Allow most of the html tags like the_content output

function filter_html_usage() {
global $allowedtags;
$allowedtags['code'] = array('class'=>array());
$allowedtags['pre'] = array('class'=>array());
$allowedtags['p'] = array('class'=>array());
$allowedtags['strong'] = array('class'=>array());
$allowedtags['href'] = array('class'=>array());
$allowedtags['a'] = array('class'=>array());
$allowedtags['ul'] = array('class'=>array());
$allowedtags['li'] = array('class'=>array());
$allowedtags['i'] = array('class'=>array());
$allowedtags['h1'] = array('class'=>array());
$allowedtags['h2'] = array('class'=>array());
$allowedtags['h3'] = array('class'=>array());
$allowedtags['b'] = array('class'=>array());
$allowedtags['abbr'] = array('class'=>array());
$allowedtags['acronym'] = array('class'=>array());
$allowedtags['blockquote'] = array('class'=>array());
$allowedtags['cite'] = array('class'=>array());
$allowedtags['em'] = array('class'=>array());
}

// Add WordPress hook to use the function
add_action('init', 'filter_html_usage',11);




// Settings
function siforum_customize_register($wp_customize){

Expand Down
15 changes: 14 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<title><?php if(is_front_page() || is_home()){ echo get_bloginfo('name'); } else{ echo wp_title(''); }?></title>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="<?php bloginfo("stylesheet_directory"); ?>/style.css?v=0.1<?php echo rand(); ?>">
<?php wp_head(); ?>

Expand All @@ -28,6 +27,20 @@
'menu_class' => 'header_menu',
) );
?>

<div class="forum-header-profile">
<?php if( is_user_logged_in() ){ ?>
<a href ="<?php bloginfo('url'); ?>/members/<?php echo get_the_author_meta( 'login', get_current_user_id() ); ?>" >
<?php echo get_avatar( get_current_user_id() , 30); ?>
<?php echo get_the_author_meta( 'login', get_current_user_id() ); ?>
</a>
<?php } else{ ?>
<a href ="<?php bloginfo( 'url' ); ?>/wp-login.php?redirect_to=<?php bloginfo( 'url' ); ?>" >
Giriş Yap
</a>
<?php } ?>
</div>

</div>
</div>
</header>
Expand Down
18 changes: 14 additions & 4 deletions single.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
<?php get_header(); ?>







<?php $cc = get_the_category(); $c_id = $cc[0]->cat_ID; $color_code = get_term_meta($c_id, 'color_code', true); ?>
<div class="category-header" style="background:<?php echo $color_code; ?>">
<div class="container">
<span class="dashicons <?php echo get_term_meta($c_id, 'icon_slug', true); ?>"></span>
<span class="category-header-title"><?php echo $cc[0]->cat_name; ?></span>
<a href="<?php echo get_category_link( get_the_ID() ); ?>" class="category-header-link">
<span class="dashicons <?php echo get_term_meta($c_id, 'icon_slug', true); ?>"></span>
<span class="category-header-title"><?php echo $cc[0]->cat_name; ?></span>
</a>
<h1 style=""><?php if(is_category() or is_tag()){ echo category_description( $c_id ); } ?> <?php the_title(); ?></h1>
</div>
</div>





<div class="container">
<div class="row">
<div class="col-md-10 forum-post-block">
Expand Down Expand Up @@ -116,7 +126,7 @@
divide_p_with_p = clear_percentage / postcount;

// Count Print
jQuery('.scroll-container-position').html(percent.toFixed(1) + " / " + postcount);
jQuery('.scroll-container-position').html(percent.toFixed(1) + " / " + postcount );

// CSS Pos
jQuery(".scroll-container-position").css("top", clear_percentage * 3);
Expand Down Expand Up @@ -200,7 +210,7 @@

};

selection_range = sel.toString ()
// selection_range = sel.toString ()

jQuery(document).on('click',"#share-reply", function(){ jQuery('#comment').val(function(i, text) { return text + selection_range }); });

Expand Down
42 changes: 39 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ img { max-width: 880px;}
line-height: 69px;
background: #C10C0C;
box-shadow: 0px 4px 10px #000000;
position: relative;
z-index: 999;

}
Expand Down Expand Up @@ -78,6 +79,32 @@ img { max-width: 880px;}
font-weight: bold;
}

.forum-header-menu .row{
position: relative;
}

.forum-header-menu .forum-header-profile{
position: absolute;
right: 0px;
z-index: 99;
padding-right: 20px;
}


.forum-header-menu .forum-header-profile a {
color: #fff;
font-weight: 400;
font-size: 14px;
text-transform: uppercase;
font-weight: bold;
}

.forum-header-menu .forum-header-profile img {
margin-right: 5px;
border-radius: 15px;
}


/* HEADER CATEGORY PAGE STYLES */

body.category .forum-header-menu{
Expand All @@ -87,10 +114,9 @@ body.category .forum-header-menu{
.category-header{
width: 100%;
height: 150px;
padding-top: 50px;
padding-top: 40px;
text-align: center;
position: relative;
z-index: -1;
margin-bottom: 40px;
opacity: 0.8;
}
Expand All @@ -116,6 +142,16 @@ body.category .forum-header-menu{
font-size:29px
}

.category-header-link{
z-index: 9999;
color:white;
position: relative;
}

.category-header-link:hover{
color:white;
}




Expand Down Expand Up @@ -445,7 +481,7 @@ body.category .forum-header-menu{
height: 210px;
color: white;
padding: 10px ;
margin-top: 10px;
margin-top: 22px;
border: none;
line-height: 30px;
background: #101317;
Expand Down

0 comments on commit ce84b74

Please sign in to comment.