WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Help with HMK Featured Images for Categories and pages Plugin

[Resolved] Help with HMK Featured Images for Categories and pages Plugin

  • I tried to install the plugin HMK Featured Images for Categories and pages and I stack in the below instruction:

    The image can be displayed o front-end by using shortcode [‘header_ads_image’] or Use <?php if (function_exists(‘hmk_taxonomy_image_url’)) echo hmk_taxonomy_image_url(); ?> to get the url and put it in any img tag in header or any page template.

    Could you please give me more detailed instructions since I am newly introduced in this area?

    Also, I can upload an image in category but it cannot displayed in the website. Could you give me a hint?

    http://wordpress.org/plugins/hmk-add-images-for-categories-and-pages/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Muhammad Kashif

    @xpertone

    you need to display the image manually either by PHP function mentioned above or by using the provided shortcode in any page or post or in sidebar.

    Hi,

    this plugin would be great, unfortunatelly the image I set for categories doesn’t display on frontend. I can see it in the admin, but no image in the live site. What can be the problem?
    http://elegazhozza.hu/category/mav/
    Thanks for your help!

    subper

    Plugin Author Muhammad Kashif

    @xpertone

    Hey,

    the plugin don’t display the image on front end automatically because it provides the choice to display that image on any place via shortcode or php function :

    The image can be displayed on front-end by using shortcode [‘header_ads_image’] or Use <?php if (function_exists(‘hmk_taxonomy_image_url’)) echo hmk_taxonomy_image_url(); ?> to get the url and put it in any img tag in header or any page template.

    Plugin Author Muhammad Kashif

    @xpertone

    I hope that helped.

    Hi,
    thanks for your reply!
    Sorry, I’m not a coder, can you please tell me where to put either the shortcode or the php script?

    Thanks much!

    subper

    Plugin Author Muhammad Kashif

    @xpertone

    where you want to display the image on front end ?

    I’d like header images for each category page

    Plugin Author Muhammad Kashif

    @xpertone

    here is an example code :

    <img src=”<?php echo hmk_taxonomy_image_url(); ?>” />

    You can place above code for image in your themes header.php at your desired position.

    Thank you, but I have no idea where can be the desired position, I’m not a coder. Can you please show me the exact place? Thanks! Here is my header php:

    <body class="<?php hybrid_body_class()?>">
    
    	<?php do_action( 'mantel_body_open' ); ?>
    
    		<div id="page" class="site">
    
    			<?php do_action( 'mantel_header_before' ); ?>
    
    				<header id="masthead" class="site-header" role="banner">
    
    					<?php do_action( 'mantel_header_open' ); ?>
    
    						<div class="blocks">
    
    								<div class="header">
    
    									<div class="site-branding">
    										<?php mantel_site_title(); ?>
    									</div><!-- .site-branding -->
    
    									<nav class="top-link" role="navigation">
    
    <ul>
    											<li class="search-wrap">
    
    											<span class="open-s">open s</span>
    												<?php
    													if ( is_plugin_active( 'yith-woocommerce-ajax-search/init.php' ) && class_exists('woocommerce') )
    														do_shortcode( '[yith_woocommerce_ajax_search]' );
    													elseif( is_plugin_active( 'woocommerce/woocommerce.php' ) )
    														get_search_form();
    												?>
    
    											<?php if ( ! is_user_logged_in() ) { global $woocommerce; ?>
    
    <li><a>" title="<?php esc_attr_e( 'Login', 'mantel' ); ?>"><?php _e( 'Login', 'mantel' ); ?></a></li>
    											<?php } else { 
    
    												$myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
    
    												if ( $myaccount_page_id ) {
    
    												 $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
    
    												 if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' )
    												 $logout_url = str_replace( 'http:', 'https:', $logout_url );
    												}
    
    												?>
    
    <li><a>"><?php _e( 'Logout', 'mantel' ); ?></a></li>
    											<?php if ( function_exists( 'mantel_my_account_url' ) ) mantel_my_account_url(); ?>
    
    											<?php } ?>
    											<?php if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) : global $woocommerce; ?>
    											<li id="open-cart">
    												<a href="#"><?php _e( 'My Cart', 'mantel' ); ?>
    													<span class="mycart">
    														<?php echo $woocommerce->cart->cart_contents_count; ?>
    													</span>
    												</a>
    
    												<?php get_template_part( 'dropdown', 'cart' )?>
    
    											<?php endif; ?>
    
    </ul>
    									</nav><!-- .top-link -->
    
    								</div><!-- .header -->
    
    								<?php //do_action( 'mantel_header' ); ?>
    
    						</div><!-- .blocks -->
    
    					<?php do_action( 'mantel_header_close' ); ?>
    
    				</header><!-- #masthead .site-header -->
    
    			<?php do_action( 'mantel_header_after' ); ?>
    
    			<?php if ( ! is_page_template( 'page-templates/landing.php' ) ) get_template_part( 'menu', 'primary' ); // Loads the menu-primary.php template. ?>
    
    			<?php do_action( 'mantel_main_before' ); ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum’s parser.]

    I too do not understand this placement of code.

    An example, with specifics, would go a long way toward understanding – especially for those of us who are very new.

    I’ve installed your plugin, that’s so much for writing this! I have zero PHP knowledge, but recognize how to update code. I see that you offered a short code, but how does the short code know which image to display based on the category page being viewed? I’m looking for banner images, rather than header images to display. Where would the short code be inserted?

    Plugin Author Muhammad Kashif

    @xpertone

    @ n.allen , its coded in a way it detects automatically the page or category being displayed and will display the image accordingly.

    you can place the short-code in content , in sidebar or any other position of your choice.

    Plugin Author Muhammad Kashif

    @xpertone

    @ algerdes do you want to place it via shortcode or via PHP ?

    Thanks, Kashif. I’m using the short-code now. I appreciate the help!

    waynecoda

    @waynecoda

    Hi Kashif Ali,

    GREAT plugin first of all. I am using an ecommerce plugin called ‘woocommerce’ to sell products. I have managed to use this php code:

    <img src=”<?php if (function_exists(‘hmk_taxonomy_image_url’)) echo hmk_taxonomy_image_url(); ?>” >

    in order to make the category header image change, however, i cannot seem to change the main shop page. Any ideas why? Other than that i works on the pagaes and product category, just not the main shop archive page.

    Thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Resolved] Help with HMK Featured Images for Categories and pages Plugin’ is closed to new replies.