HR Easy Blog WordPress theme logo removal - wordpress

Currently for a blog of mine I'm using HR Easy Blog WordPress theme. There I have a problem on how to remove the HR Easy Blog logo on the home page. I tried several methods but nothing worked for me.enter image description here

You need to go to your theme's header.php file and remove or comment below code:
<div class="header hidden-xs clearfix">
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="logo pull-left">
<?php $logo = (get_option('hires_logo') <> '') ? get_option('hires_logo') : get_template_directory_uri().'/images/logo.png'; ?><img src="<?php echo $logo; ?>" alt="<?php bloginfo('name'); ?>" id="logo"/>
</div>
</div>
<div class="col-lg-8">
<?php /* Home Ad #1 */
if( get_option('hires_ad_480_60_enable') == 'on'){
echo '<div class="pull-right top-ads">';
echo get_option('hires_ad_480_60_code');
echo "</div>";
} ?>
</div>
</div>
</div>
</div>

Related

Get all post in Wordpress

I am building a custom wordpress theme. I want to get my posts on my frontpage
I added this in my front-page.php
<?php
if ( have_posts() ) {
// Start the Loop.
while ( have_posts() ) {
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'archive' );
}
}
?>
content-archive.php
I have this
<div class="container">
<article class="post">
<div class="post-preview col-10 no-gutter">
<h2><?php the_title(); ?></h2>
<p><?php the_excerpt(); ?></p>
<p class="meta">
<?php the_modified_author();?> in <?php the_category();?> <i class="link-spacer"></i> <i class="fa fa-bookmark"></i> 23 minute read
</p>
</div>
<div class=" col-2 no-gutter">
<img src="img/profile-1.jpg" class="user-icon" alt="user-image">
</div>
</article>
When I visited the current homepage, I get the homepage as post and its snipper, then read more button.
What I am trying to pull are the posts.
Update content-archive.php to:
<div class="container">
<article class="post">
<div class="post-preview col-10 no-gutter">
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
<p class="meta">
<?php the_modified_author();?> in <?php the_category();?> <i class="link-spacer"></i> <i class="fa fa-bookmark"></i> 23 minute read
</p>
</div>
<div class=" col-2 no-gutter">
<img src="img/profile-1.jpg" class="user-icon" alt="user-image">
</div>
</article>

Bootstrap 4 grid system within Wordpress loop

I'll get quickly to the point: I'm creating a Wordpress theme for my blog, using _s starter theme. I'm using the bootstrap 4 grid system, in order to achieve a 2 column post (on home page/search/archive): the post thumbnail inside a div on the left, while the post content (title, excerpt etc.) on the right.
I want to set the post thumbnail as a background-image of the div, I already achieved that, on desktop/tablet no problem, but on mobile when the thumbnail is above the post content, it won't show up, unless I set a fixed height to the image, I'm ok with that, but the issue is that some posts do not have a post thumbnail, so you can imagine that the result is pretty brutal, with blank space on post without thumbnail;
Maybe this is stupid and easy, but the question is: is there a way to solve this? Maybe it's possible to set the fixed height on mobile but only on posts that has the thumbnail?
<div class="container-fluid">
<div class="row">
<div class="post-thumbnail col-md-5" <?php echo 'style="background-image: url(' . get_the_post_thumbnail_url() . ')"' ?>>
</div>
<div class="post-content <?php echo (has_post_thumbnail())?$small:$large;?>">
</div> <!-- post content -->
</div> <!-- row -->
</div> <!-- container fluid -->
If I understood you correctly, maybe you could try something like this
<div class="container-fluid">
<div class="row">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article>
<div class="col-md-6">
<h2>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
</h2>
<?php the_content(); ?>
</div>
<div class="col-md-6">
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumbnail" style="background: url('<?php get_the_post_thumbnail_url(); ?>') center center / cover"></div>
<?php else : ?>
<div class="post-thumbnail" style="background: url('[some fixed image url]') center center / cover"></div>
<?php endif; ?>
</div>
</article>
<?php endwhile; else: ?>
<p>There no posts to show</p>
<?php endif; ?>
</div>
</div>

Screen goes white when setting home display to static on server site (Wordpress)

:)
I have made a Wordpress site, which I have migrated from local to a server. I have created a one pager with images in the bottom that links to the different post of my site. I have used the plugin Advanced custom fields in order to make my site editable.
After a lot of searching online, I found that it was not possible to add custom fields to your index php directly but that you could make a template in which you copied all your old code from the index.php into.
I got it to work on my local host by going to Settings - Readings in my wordpress admin panel an under set my homepage displays as static - Homepage (which is the name of my template).
But when I try to do the same thing on the server site, the screen goes white... Maybe it is something with the file structure?
I've taken a screen shot of whole the files are located in my FTP (Cyberduck). I don't know if its enough to help..
Thanks in advance
<div class="section" id="section2">
<div class="row">
<div class="col-12 col-md-6 col-lg-6" id="left">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/pen.png" id="pen" class="img-fluid animation" alt="Responsive-image"/>
<lol><h2 id="About">3 Facts</h2></lol>
</div>
<div class="col-12 col-md-6 col-lg-6" id="right">
<div class="image_field d-none d-md-block"> <!-- image field-->
<?php $post_image = get_field('avatar_image')['sizes']['large']; ?>
<img src = "<?php echo $post_image; ?> " id="avatarimage" class="img-fluid" alt="Responsive image">
</div>
<div class="col-md-12 col-lg-12">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/Onefinal.svg" id="One"/> <!-- class="img-fluid" alt="Responsive-image" -->
<div class="container" id=text>
<?php
$my_query = new WP_Query('pagename=hej');
while ($my_query->have_posts() ) : $my_query->the_post();
the_content();
endwhile;
wp_reset_postdata();
?>
</div>
</div>
Template of the static homepage should be stored in a file called front-page.php which needs to be placed in /wp-content/themes/elnino directory.
Copy code of your template (except comment with template name) and paste it inside front-page.php file.
<div class="section" id="section2">
<div class="row">
<div class="col-12 col-md-6 col-lg-6" id="left">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/pen.png" id="pen" class="img-fluid animation" alt="Responsive-image" />
<lol>
<h2 id="About">3 Facts</h2>
</lol>
</div>
<div class="col-12 col-md-6 col-lg-6" id="right">
<div class="image_field d-none d-md-block">
<!-- image field-->
<?php $post_image = get_field('avatar_image')['sizes']['large']; ?>
<img src="<?php echo $post_image; ?> " id="avatarimage" class="img-fluid" alt="Responsive image">
</div>
<div class="col-md-12 col-lg-12">
<img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/Onefinal.svg" id="One" />
<!-- class="img-fluid" alt="Responsive-image" -->
<div class="container" id=text>
<?php
$my_query = new WP_Query('pagename=hej');
while ($my_query->have_posts() ) : $my_query->the_post();
the_content();
endwhile;
wp_reset_postdata();
?>
</div>
</div>

How to display the first tab in my Wordpress loop?

I'm working with Wordpress and Foundation Tabs.
Objective:
To display Wordpress posts from a specific category in vertical Foundation tabs.
I currently have a static version displayed here:
http://www.aos-engineering.com (Under Projects)
Problem:
On the page load, the first tab displayed is empty. However, when you click through the tabs, they display correctly.
Question
How do I display the fist tab item on the page load?
Here is a test page displaying the problem:
http://www.aos-engineering.com/test/
Code
<div class="full-width" id="projects">
<div class="row">
<div class="small-4 medium-3 large-3 columns">
<dl class="tabs vertical profile-tabs" data-tab>
<?php
$displayposts = new WP_Query();
$displayposts->query('category_name=Projects');
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
?>
<dd><?php the_title(); ?></dd>
<?php endwhile; ?>
</dl>
</div>
<div class="small-8 medium-9 large-9 columns">
<div class="tabs-head">Projects</div>
<div class="tabs-content">
<?php
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
?>
<div class="content" id="tab<?php echo $tab_number;?>">
<h2><?php the_title(); ?></h2>
<div class="row">
<div class="medium-9 large-9 columns">
<?php the_post_thumbnail(); ?>
<p><small><?php the_field('img_caption'); ?></small></p>
</div>
<div class="medium-3 large-3 columns">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
Please let me know if I can provide more information. Thank you in advance.
You need to have your code add the class active to the .tabs > dl and the .tabs-content > div you want displayed on page load.
Add this to the two lines after $tab_number = ... to have the first tab be the active tab on load:
$active_class = (1 == $tab_number) ? 'active' : '';
Then in the output:
<dd class="<?php echo $active_class;?>" ><a href=...
<div class="content <?php echo $active_class;?>"...
See the Foundation Tabs documentation for more details.
Hat tip CPILKO for the solution.
Here is how to display Wordpress posts from a specific category in vertical Foundation tabs.
To display your posts, simply add your category name
'category_name=YourCategoryName'
Solution
<div class="full-width" id="projects">
<div class="row">
<div class="small-4 medium-3 large-3 columns">
<dl class="tabs vertical profile-tabs" data-tab>
<?php
$displayposts = new WP_Query();
$displayposts->query('category_name=Projects');
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
$active_class = (1 == $tab_number) ? 'active' : '';
?>
<dd class="<?php echo $active_class;?>"><?php the_title(); ?></dd>
<?php endwhile; ?>
</dl>
</div>
<div class="small-8 medium-9 large-9 columns">
<div class="tabs-head">Projects</div>
<div class="tabs-content">
<?php
while ($displayposts->have_posts()) : $displayposts->the_post();
$tab_number = $displayposts->current_post + 1;
$active_class = (1 == $tab_number) ? 'active' : '';
?>
<div class="content <?php echo $active_class;?>" id="tab<?php echo $tab_number;?>">
<h2><?php the_title(); ?></h2>
<div class="row">
<div class="medium-9 large-9 columns">
<?php the_post_thumbnail(); ?>
<p><small>Show above: Huiit Zolars</small></p>
</div>
<div class="medium-3 large-3 columns">
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>

drupal7 theme page creation

I have created home page in drupal.it's work fine.But I don't able to create other pages(like,service contact,client.) (home page and other pages are different).I have create page.tpl.php.I could create region in .info file? here I have attached my page.tpl.php file.Could you please any one tell me.( other page format like one leftcontent and 2 rightcontent structure.).
page.tpl.php:
<div id="wrapper">
<header id="header">
<div class="section clearfix">
<div class="logo_left">
<?php if ($logo): ?>
<a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
<img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
</a>
<?php endif; ?>
</div>
<nav class="logo_right"><?php print render($page['header']);?></nav>
</div></header> <!-- /.section, /#header -->
<div id="menu">
<!--ul>
<li>About</li>
<li>Service</li>
<li>Client</li>
<li>Contact</li>
</ul-->
<?php print render($page['header_menus']); ?>
</div>
<div id="content">
<article>
<div id="content" class="column">
<?php
$url = request_uri();
if(strpos($url, "user"))
{
}
else
{
?>
<?php if ($breadcrumb): ?>
<div id="breadcrumb"><?php print $breadcrumb; ?></div>
<?php endif; ?>
Create another file " page--front.tpl.php " for home page and other files can use page.tpl.php
you can set home page on "Default front page" by using below link
"admin/config/system/site-information"

Resources