Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #280169

    Hi
    I’m using a child Enfold theme and want to add some custom php to display some promo boxes under my content on the homepage

    The promo boxes are controlled by custom fields in that page

    To do this I need to save a copy of the php page template to my child theme so which php template is the default template using? page.php or index.php

    I copied page and then my full screen slider was no longer full screen. So I then tried copying index.php and the related loop-index.php and then I got weird results so just wondered if you can guide me on how to create a new php template based on the enfold default page template please

    regards
    Jonathan

    #280211

    I actually wanted the promo boxes to appear inside the content area so am now wondering if better to add a widget area for my homepage and use advanced text widget that can output php… then drag one of your template builder widget area elements to where i want it.

    #280254

    Hey!

    You could do that with this plugin:
    https://wordpress.org/plugins/php-text-widget/

    Regards,
    Josue

    #280290

    Thank you.

    And if I did want to change the default page template in my child theme would I need to copy page.php or index.php from the enfold page template files?

    It’s my homepage I’d want to clone

    #280293

    Yes, or you could use a filter, like:

    function alter_content_func($content) {
    	$modified_content = do_shortcode("[shortcode]");
    	$modified_content .= $content;
    
    	return $modified_content;
    }
    add_filter('the_content', 'alter_content_func');

    Cheers!
    Josue

    #280502

    Thank you

    I got it working nicely using your widget element and used Advanced Text Pro widget that allows PHP

    Great :)

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Copy the homepage template’ is closed to new replies.