WordPress.org

Ready to get started?Download WordPress

Forums

HMK Featured Images for Categories and pages.
[resolved] Help with HMK Featured Images for Categories and pages Plugin (15 posts)

  1. Androulla
    Member
    Posted 7 months ago #

    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/

  2. Kashif Ali
    Member
    Plugin Author

    Posted 6 months ago #

    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.

  3. subper
    Member
    Posted 5 months ago #

    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

  4. Kashif Ali
    Member
    Plugin Author

    Posted 5 months ago #

    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.

  5. Kashif Ali
    Member
    Plugin Author

    Posted 5 months ago #

    I hope that helped.

  6. subper
    Member
    Posted 5 months ago #

    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

  7. Kashif Ali
    Member
    Plugin Author

    Posted 5 months ago #

    where you want to display the image on front end ?

  8. subper
    Member
    Posted 5 months ago #

    I'd like header images for each category page

  9. Kashif Ali
    Member
    Plugin Author

    Posted 5 months ago #

    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.

  10. subper
    Member
    Posted 5 months ago #

    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.]

  11. algerdes
    Member
    Posted 4 months ago #

    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.

  12. n.allen
    Member
    Posted 3 months ago #

    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?

  13. Kashif Ali
    Member
    Plugin Author

    Posted 1 month ago #

    @ 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.

  14. Kashif Ali
    Member
    Plugin Author

    Posted 1 month ago #

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

  15. n.allen
    Member
    Posted 1 month ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic