i have a question about where custom files can be saved
i see they can be saved in the default theme folder, but when the default theme updates it often removes files and folders not associated with the official theme. is it possible to save custom files in a folder called ‘plugin-templates’ in wp-content? as far as i know that directory would be safe from update deletion
thanks
]]>I am using the php everywhere plugin to include the list.php page (from the plugin themes/default directory) into another page, and it works just fine with the submission page, (submission.php) but for some reason, using the include statement with the list page, gives me a 500 error.
So I’m stumped as to why this works:
include (‘wp-content/plugins/awesome-support/themes/default/submission.php’);
…but this does not
include (‘wp-content/plugins/awesome-support/themes/default/list.php’);
It just gives me a 500 error when viewing the page in the browser. Is there something about the list page that prevents it from being included into another page?
thanks!
]]>This may seam like a minor inconvenience, but it prevents me from using the mobile Android app to create posts and pages. Also some of the plug-ins are security related and it would be great not to have to remember to check all the correct settings each time I post.
I’ve search the support forums but could find anything related to this, but perhaps I didn’t known the correct terms to use.
Thanks for the help!
]]>The plug in came with two set pages “jobs” and “resumes”. The job page has other links that you can select such as post a job, view jobs,etc.
Porblem is they all share the same wordpress content, everytime I create text or anytype of style it links to all job pages
ex.
mydomain.com/jobs-3
mydomain.com/jobs-3/create-add
mydomain.com/jobs-3/employer-logout
they all are different pages but they wont stop sharing the same content.
I tried to make them separate templates , but maybe im doing it wrong
Can someone help?
]]>I started off using custom page template, creating a page and setting the page template to my custom php so that I could use the slug to load the file.
This was a little sloppy since now there are a bunch of black pages whos only purpose is to add a route and load the custom php.
The files still uses things like get_header() && get_footer() for the most part but some are just form processing and a redirect to a thank you page.
Next I messed around with adding add_submenu_page( NULL …) with a null parent as to not create a menu item. This also worked to accomplish what I wanted to do but it still did not feel like the correct way.
So in attempts to clean this method up I started hooking into after_setup_theme
function new_route() {
if($_GET['page'] == 'checkout'){
load_template( dirname( __FILE__ ) . '/templates/checkout.php' );
exit;
}
}
add_action( 'after_setup_theme', 'new_route' );
Above is what I am currently using however is this really the best way to do this? It seems like a hack.
The page route does not have to be ‘page=XYZ’ really any slug would do I just need to be able to pull in my custom php files based on a uri slug.
I appreciate any advice.
]]>Is there anyway around this?
function create_pages() {
$templates= array(
//name=template
'Advert-Payment' => 'ad-payment-screen'
);
foreach ($templates as $name=>$template) {
if(get_option($name)===False) {
$post= array(
'post_title' => $name,
'post_name' =>$name,
'post_status' => 'publish',
'post_type' => 'page',
'post_content' => '',
'post_author' => 1,
'page_template' => $template
);
$postid=wp_insert_post( $post );
add_option( $name, $name );
}
}
}
add_action('wp_loaded', 'create_pages');
]]>