0
votes

I'm trying to incorporate some custom made php files in a WordPress site. In these files made links to other files.

<?
    echo "<a href=show.php?x=" . $row['Name'] . ">" $row['Name'] . "</a><br> ";
?>

This works fine with an php-execute plugin for WordPress. The only thing is that the show.php opens without the WordPress theme and layout.

How can I make a link so that a new php file will open in the same (side)bar/frame with the same layout as the WordPress page?

2

2 Answers

1
votes
you need to create a custom template for that

The syntax is something like this:

<?php
/*
Template Name: My Custom Page
*/
get_header();
?>

Here your HTML coding goes

<?php get_footer(); ?>

This will give you the look and feel you are looking for!!
0
votes

Found my own work around

Create a page in WordPress (page_id=x) and include an exec-php plugin. Include this code on the page.

<? 
$page_include =$_GET["page_include"];
include $page_include; 
?>

If you want to show a custom page in the wordpress them make the following link:

<? 
echo "<a href=?page_id=x&page_include=" . $page_link . "> link </a>"
?>