Onengine theme – Add the project title to the hover image
-
Hello Everybody.
I’m currently using Onengine Theme (https://www.enginethemes.com/themes/oneengine/) to build my website.
There is a Portfolio section which shows the thumb img of your project, when the mouse point to the image, it will have hover effect with a magnifying glass icon (fa fa-search) in the middle.I want to delete the magnifying glass icon and I want the project’s title to show when hover so people will know the name of the project when the mouse point to the picture.
Now I figured out how to delete the magnifying glass icon, but I don’t know how to put a script to show the title of the project…
I stuck here for few days and can’t find out the answer to that…Hope someone can help me… Thanks!!!
Here is the portfolio block php (et-portfolio-block.php):
<?php /**
* This file control blog block
*
* @package OneEngine
* @package EngineThemes
*/
// CLEAR BLOCK
if( ! class_exists( ‘OE_Portfolio_Block’ ) ) :
class OE_Portfolio_Block extends AQ_Block {
function __construct() {
$block_options = array(
‘name’ => __( ‘ET Portfolio’, ‘oneengine’),
‘size’ => ‘span12’,
);
//create the block
parent::__construct(‘OE_Portfolio_Block’,
$block_options);
>”>
}
function form($instance) {
$defaults = array(
‘p_number’
‘animation’
‘duration’
‘delay’
‘margin_top’
‘margin_bottom’ => ’10’,
‘span_column’ => ‘span4’,
‘hide_filter’ => ‘0’,
);
$instance = wp_parse_args($instance, $defaults);
extract($instance);
global $include_animation ;
global $include_button_effect;
?>
<p class=”description”>
<label for=”<?php echo $this->get_field_id(‘margin_top’) ?
<?php _e(‘Margin top’,’oneengine’ ); ?>
<?php echo aq_field_input(‘margin_top’, $block_id,
$margin_top, ‘min’, ‘number’) ?> px
</label> –
<label for=”<?php echo $this-
>get_field_id(‘margin_bottom’) ?>”>
=> ’12’,
=> ‘None’,
=> ‘0’,
=> ’10’,
=> ‘300’,
<?php _e(‘Margin bottom’,’oneengine’ ); ?>
<?php echo aq_field_input(‘margin_bottom’, $block_id,
$margin_bottom, ‘min’, ‘number’) ?> px
</label>
</p>
<p class=”description”>
<label for=”<?php echo $this-
>get_field_id(‘p_number’) ?>”>
<?php _e(‘Quantity of porfolio items.
( * Note : with the value \’-1\’, all item will be
displayed ! )’,’oneengine’ ); ?>
<?php echo aq_field_input(‘p_number’, $block_id,
$p_number, ‘min’, ‘number’) ?>
</label>
</p>
<p class=”description”>
<label for=”<?php echo $this-
>get_field_id(‘hide_filter’) ?>”>
<?php _e(‘Hide
filter ?’,’oneengine’ ); ?>
<?php echo
aq_field_checkbox(‘hide_filter’, $block_id, $hide_filter) ?>
</label>
</p>
<?php }
function block($instance) {
extract($instance);
$display_filter
= ”;
$terms = get_terms( ‘portfolio_cat’,
array(‘hide_empty’ => false) );
if($hide_filter == true || $hide_filter == 1 )
$display_filter = ‘ display-none’;
?>
<div class=”portfolio-cat-wrapper container <?php echo
$display_filter ?>”>
id=”portfolio_filter”>
<div class=”row”>
<div class=”col-md-12″>
<ul class=”portfolio-category”-
<a
id=”all_click” href=”#” data-filter=”*”>
<span class=”icon-categories”><i
class=”fa fa-align-justify”></i></span>
_e( ‘All’, ‘oneengine’ ); ?>
<?php
></span><?php
foreach ($terms as $term) {
?> -
data-filter=”.<?php echo $term->slug ?>”>
<span
class=”icon-categories”><?php echo oe_get_tax_icon($term->term_id) ?
<?php echo $term->name ?>
<?php }
?></div>
</div>
</div>
<?php
echo ‘<div class=”portfolio-list isotope animation-
wrapper” id=”portfolio_list”>’;
global $post;
$query = new WP_Query(array(
‘post_type’ => ‘portfolio’,
‘posts_per_page’ => $p_number
));
if($query->have_posts()){
while($query->have_posts()){
‘portfolio_cat’ );
?>
$class ?>”>
>ID ?>”>
$query->the_post();
$terms = get_the_terms( $post->ID,
$class = ”;
if(!empty($terms)){
foreach ($terms as $term) {
$class .= $term->slug.’ ‘;
} }
<div class=”item isotope-item <?php echo
<a href=”#” data-id=”<?php echo $post-
<?php the_post_thumbnail( ‘portfolio-<a href=”#”
thumb’, array(‘class’ => ‘et-portfolio-thumbnail img-responsive’) ); ?
>
i></span></div>
<div class=”hover”><span><i class=”fa fa-search”></
</div>
<?php
}
}
wp_reset_query();
echo ‘</div>’;
echo ‘<div id=”portfolio_content”>
class=”port-control col-md-12″>
class=”prev” href=”#”><span class=”arrow-port left”></
span> ‘.__(‘Prev’,’oneengine’).’
href=”#” class=”close-port”><i class=”fa fa-times”></i>
<a
<a
href=”#” class=”next”>’.__(‘Next’,’oneengine’).’ <span
class=”arrow-port right”></span>
content”>
}
</div>
</div>
<div class=”port-
</div>
</div>
</div>’;
function before_block($instance) {
extract($instance);
echo ‘<div id=”aq-block-‘.$template_id.’-‘.$number.'”
class=”aq-block aq-block-‘.$id_base.'”>’;
echo ‘<div id=”portfolio-page” class=”portfolio-
wrapper” style=”margin:’.$margin_top.’px 0 ‘.$margin_bottom.’px;”>’;
}
function after_block($instance) {
extract($instance);
} }
echo ‘</div>’;
echo ‘</div><!– END ET-PORTFOLIO-BLOCK–>’;
<div class=”container”>
<div class=”row”>
<div
<a
aq_register_block( ‘OE_Portfolio_Block’ );
endif; -
<a
- The topic ‘Onengine theme – Add the project title to the hover image’ is closed to new replies.