How to put the post link on the date of the posts that appear in the footer

This topic has 12 replies, 3 voices, and was last updated 7 years, 4 months ago ago by Eva Kemp

  • Avatar: Unionfor Web
    Rodrigo
    Participant
    December 5, 2016 at 19:09

    Hello good afternoon,
    I would like to know how to put the link of the post over the date that is in the footer of the site, because when hovering over there is a link <a href="#"> </a> then I would like to know If there is the possibility of changing it to the link of the post so it would have the link in both the title and the date as well.

    To make it clear what I’m talking about, see below a print:

    Screenshot

    Best regards,
    Rodrigo Macedo

    11 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 5, 2016 at 20:04

    Hello,

    You can edit it in wp-content/themes/woopress/framework/widgets.php in line 335.

    Best regards,
    Jack Richardson.

    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 5, 2016 at 20:20

    Hello,
    I had problems to do this, I made the change in the file “widgets.php” as you reported, however I did as follows, I copied the file to the child theme I put the file inside the framework folder in the child theme and added the following line

    Require_once (get_stylesheet_directory (). '/framework/widgets.php');

    But it gave the following error:

    Fatal error: Can not redeclare etheme_register_general_widgets () (previously declared in /home/user/public_html/loja/wp-content/themes/woopress-child/framework/widgets.php:8) in /home/user/public_html/loja/wp-content/themes/woopress/framework/widgets.php on line 19

    I’ve seen this mistake before when I tried to make the change in some file but I do not remember how I fixed it, could you give me that light to correct?

    Thank you in advance

    Best regards,
    Rodrigo Macedo

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 6, 2016 at 17:37

    Hello,

    You can try to remove default “etheme_register_general_widgets” function in the parent theme and rename it to a new function in the child theme as written here http://wordpress.stackexchange.com/questions/145422/redeclare-a-function-in-a-child-theme .

    Best regards,
    Jack Richardson.

    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 6, 2016 at 20:38

    Hello good afternoon,
    Friend, I have tried in many ways and none I have managed, I am very lazy (bad) when the business is to make changes in PHP codes.

    Could you make it more clear to me, please?
    I apologize for the work

    Best regards,
    Rodrigo Macedo

    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 9, 2016 at 13:27

    Hello good day,
    I created a WordPress user for you to make it easier to access, because with this latest WordPress update you can now leave each user with the panel in another language of preference.

    The user created for you follows the private content.

    We also created a user to access FTP to facilitate and not have to go through several folders until you get to WordPress.

    Best regards,
    Rodrigo Macedo

    Please, contact administrator
    for this information.
    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 12, 2016 at 20:22

    Hello good afternoon,
    Did you understand my previous question?

    I realized by the end of last week that you were moving the file because you had a short time when the site exhibited the error when accessing it.

    Best regards,
    Rodrigo Macedo

    Avatar: Eva
    Eva Kemp
    Support staff
    December 13, 2016 at 09:39

    Hello,

    Sorry for a delay.

    You need create a new widget, add this code in widgets.php in child theme

    // **********************************************************************// 
    // ! Your Widget
    // **********************************************************************// 
    class Your_Widget extends WP_Widget {
    
        function Your_Widget() {
            $widget_ops = array('classname' => 'etheme_widget_brands', 'description' => __( "Products Filter by brands", ETHEME_DOMAIN) );
            parent::__construct('etheme-brands', '8theme - '.__('Brands Filter', ETHEME_DOMAIN), $widget_ops);
            $this->alt_option_name = 'etheme_widget_brans';
        }
    
        function widget($args, $instance) {
            extract($args);
    
            $title = $instance['title'];
            echo $before_widget;
            if(!$title == '' ){
    	        echo $before_title;
    	        echo $title;
    	        echo $after_title;
            }
            $current_term = get_queried_object();
    		$args = array( 'hide_empty' => false);
    		$terms = get_terms('brand', $args);
    		$count = count($terms); $i=0;
    		if ($count > 0) {
    			?>
    			<ul>
    				<?php
    				    foreach ($terms as $term) {
    				        $i++;
    				        $curr = false;
    				        $thumbnail_id 	= absint( get_woocommerce_term_meta( $term->term_id, 'thumbnail_id', true ) );
    				        if(isset($current_term->term_id) && $current_term->term_id == $term->term_id) {
    					        $curr = true;
    				        }
    				        ?>
    				        	<li>
    				        		<a href="<?php echo get_term_link( $term ); ?>" title="<?php echo sprintf(__('View all products from %s', ETHEME_DOMAIN), $term->name); ?>"><?php if($curr) echo '<strong>'; ?><?php echo $term->name; ?><?php if($curr) echo '</strong>'; ?></a>
    				        	</li>
    						<?php
    				    }
    				?>
    			</ul>
    			<?php
            }
            echo $after_widget;
        }
    
        function update( $new_instance, $old_instance ) {
            $instance = $old_instance;
            $instance['title'] = $new_instance['title'];
    
            return $instance;
        }
    
        function form( $instance ) {
            $title = isset($instance['title']) ? $instance['title'] : '';
    
    ?>
            <?php etheme_widget_input_text(__('Title', ETHEME_DOMAIN), $this->get_field_id('title'),$this->get_field_name('title'), $title); ?>
    
    <?php
        }
    }

    Add the needed code of the needed widget.

    And this code to functions.php:

    add_action( 'widgets_init', 'your_register_widgets' );
    function your_register_widgets() {
    	register_widget('Your_Widget');
    }

    Regards,
    Eva Kemp.

    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 13, 2016 at 15:38

    Hello good afternoon,
    I did as you told me, I copied the first Widget code you passed me and pasted it into “widgets.php” in the child theme then replaces it after the following line – function Your_Widget() { – by the Widget code that I am trying to sort out.

    When doing this application, I pasted the second code that you passed in “functions.php” in the child theme, however doing this, the site returned the following error, see the image below.

    Screenshot WooPress

    What is wrong ?

    Best regards
    Rodrigo Macedo

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    December 13, 2016 at 19:13

    Hello,

    I’ve edited the files functions.php, widgets.php and vc.php in your child theme.
    Please clear browser cache and check footer now.

    Best regards,
    Jack Richardson.

    Avatar: Unionfor Web
    Rodrigo
    Participant
    December 14, 2016 at 15:05

    Hello good day,
    Yesterday I checked and it was not the same, I thought it had been simple after the change because I was only displaying 2 recent posts, when in reality I had to enter the panel and activate the options again as I was previously configured.

    It was perfect now, thank you very much for the support.

    Best regards,
    Rodrigo Macedo

    Avatar: Eva
    Eva Kemp
    Support staff
    December 14, 2016 at 19:28

    Hello,

    You’re welcome.

    Regards,
    Eva Kemp.

  • Viewing 12 results - 1 through 12 (of 12 total)

The issue related to '‘How to put the post link on the date of the posts that appear in the footer’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.