• Resolved topdo9

    (@topdo9)


    Hi, I’m totally new with hooks in WP so I am probably asking for something simple, but in the vast amount of information on hooks on the internet I just can seem to find what I’m looking for. What I’m trying to do is simply replace a piece of code within a php file that comes with the theme.

    I want to replace this:

    <?php if ( $show_popular_posts ) : ?>
    	<li><a href="#tab-popular"><?php esc_attr_e( 'Popular', 'Avada' ); ?></a></li>
    <?php endif; ?>
    
    <?php if ( $show_recent_posts ) : ?>
    	<li><a href="#tab-recent"><?php esc_attr_e( 'Recent', 'Avada' ); ?></a></li>
    <?php endif; ?>

    with this:

    <?php if ( $show_recent_posts ) : ?>
    	<li><a href="#tab-recent"><?php esc_attr_e( 'Recent', 'Avada' ); ?></a></li>
    <?php endif; ?>
    
    <?php if ( $show_popular_posts ) : ?>
    	<li><a href="#tab-popular"><?php esc_attr_e( 'Popular', 'Avada' ); ?></a></li>
    <?php endif; ?>

    How can I make this specific for just one particular PHP file?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    As you use a commercial theme and need support, please use their official support channel. We feel they are best equipped to support their products.

    https://theme-fusion.com/support/

    Commercial products are not supported in these forums. You are their customer; I am sure they will have no problem supporting you there.

    Thread Starter topdo9

    (@topdo9)

    Well, they state this is a modification to their theme and they do not support that. Using child-theme files won’t work for this file type as it is considered a core-file, and thus they pointed me to using hooks to achieve this: “We have introduced hooks, actions and filters so that aspects of the themes core code can be customised using a child theme and in due course we will be expanding on that too.”

    But your right I’ll revert it back to them how I’m’supposed to handle this in Hooks then.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Replace a piece of code in widget using hooks’ is closed to new replies.