Bootstrap 4 Optimization

You just make a big mistake. use this guideline. header.php <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css” integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”> You also made a mistake calling js file. Frist needs jQuery then popper.js then bootstrap and the big mistake is you call all of them in the header file, that’s why when the page is loaded it takes time to … Read more

change the icon of a custom post type in WordPress to use twitter boostrap

I always like using this tutorial which would give you this code. <?php add_action( ‘admin_head’, ‘cpt_icons’ ); function cpt_icons() { ?> <style type=”text/css” media=”screen”> #menu-posts-POSTTYPE .wp-menu-image { background: url(<?php bloginfo(‘template_url’) ?>/images/YOURIMAGE.png) no-repeat 6px -17px !important; } #menu-posts-POSTTYPE:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { background-position:6px 7px!important; } </style> <?php } ?>

How to echo a different field if another field is empty?

You might try to replace the foreach( $myCarousel as $carousel ) with: foreach($myCarousel as $carousel){ $myimg = get(‘projectdetails_image’,1,$carousel); if ( !$myimg ) { // use this if you want to show a default image when no image is available in the post $myimg = get_template_directory_uri().’/images/default_banner.jpg’; } if ( $myimg ) { echo “<div class=”item”.( $counter … Read more

Display WP posts in 3 responsive columns

<?php $the_query = new WP_Query(“showposts=6&cat=1&orderby=rand”); while ( $the_query ->have_posts() ) {$the_query ->the_post(); $i++; if ($i == 1){echo “<div class=row-fluid>”;} ?> <div class=”span4″> Random Post <?php echo $i ; ?> </div> <?php if ($i == 3){echo “</div><div class=row-fluid>”;} if ($i == 6){echo “</div>”;$i=0;} } wp_reset_postdata(); ?>

How to display thumbnail if post is assigned one otherwise not

you just need to clean up the if statement: <?php if ( has_post_thumbnail() ) { ?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> </div> <?php } ?> here’s the whole bit cleaned up: <?php query_posts(‘posts_per_page=1’) ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”jumbotron”> <?php if ( has_post_thumbnail(); { )?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)