Problem with an child Theme

Hello,
I tried to to an child theme with this method. https://codex.wordpress.org/Child_Themes
But it didn’t work, what did I do wrong ? Or did I use the wrong methode ?

Greetings Natasha

Dear Natasha,

Is there any error message displayed on your screen? If so, please paste it here.

Could you please share your child theme you have made to the free file hosting like Dropbox or Google Drive, so I can install it on my test site and correct it?

Regards,
Kharis

Hei Kharis
There is no Error Messages. The files are here: https://drive.google.com/open?id=0BzEE01_y7E0SQm5STGM3R3liZG8

Please remove the PHP closing tag (?>) at the bottom of the functions.php of your child theme. Let me know how it goes.

Regards,
Kharis

No that doesn’t change anything :frowning:

Hello there,

Sorry for the misled. I guess you tried to override the default projects widget from child theme, but it won’t work as expected. Is that the exact problem you would like to resolve? Please advise.

Regards,
Kharis

Yes, I want to change the Projects widget. Is it not how i can do that ?

Hello there,

Actually it can’t be overridden from the child theme. Alternatively, you can replicate it from child theme by doing the following steps:

  1. Open the moesia-pro-ii-child/widgets/fp-projects.php file on your code editor
  2. Replace this line:

class Moesia_Projects extends WP_Widget

to


class Moesia_Projects_Extended extends WP_Widget

  1. Replace these lines:

// constructor
    function moesia_projects() {
		$widget_ops = array('classname' => 'moesia_projects_widget', 'description' => __( 'Show your most intresting projects.', 'moesia') );
        parent::__construct(false, $name = __('Moesia FP: Projects', 'moesia'), $widget_ops);
		$this->alt_option_name = 'moesia_projects_widget';

		add_action( 'save_post', array($this, 'flush_widget_cache') );
		add_action( 'deleted_post', array($this, 'flush_widget_cache') );
		add_action( 'switch_theme', array($this, 'flush_widget_cache') );
    }

with:


// constructor
    function __construct() {
  		$widget_ops = array('classname' => 'moesia_projects_widget', 'description' => __( 'Show your most intresting projects.', 'moesia') );
          parent::__construct(false, $name = __('Moesia FP: Projects 2', 'moesia'), $widget_ops);
  		$this->alt_option_name = 'moesia_projects_widget_2';

  		add_action( 'save_post', array($this, 'flush_widget_cache') );
  		add_action( 'deleted_post', array($this, 'flush_widget_cache') );
  		add_action( 'switch_theme', array($this, 'flush_widget_cache') );
    }

  1. Open the moesia-pro-ii-child/functions.php file

  2. Add this code:


// Load widget file
if ( function_exists('siteorigin_panels_activate') ) {
	require get_stylesheet_directory() . "/widgets/fp-projects.php";
}

// Init new widget
add_action('widgets_init', 'moesia_child_widgets_init');
function moesia_child_widgets_init(){
  if ( function_exists('siteorigin_panels_activate') ) {
    register_widget( 'Moesia_Projects_Extended' );
  }
}

  1. Save changes then upload

Regards,
Kharis

Hei Kharis

I tried that but it didn’t work. What i actually want is to change the behaviour of the picture. I want that when ther user is on hover, there is only one icon the link icon. And when the user clicks on the picture (not only on the icon) it would get to the post. How is this possible ?`This on hover

Hello there,

Sorry, I forgot to mention that you have to insert a new widget: Moesia FP: Projects 2.

Regards,
Kharis

Hei Kharis

That worked thank you. But now the projects are not showed there. How can I change that?
regards, Natasha

Hello there,

Please share your moesia-pro-ii-child/widgets/fp-projects.php file to kharisblank@gmail.com, so I can troubleshoot it on my test site.

Regards,
Kharis