Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] WordPress Single Full Post On Front Page Re: [Solved] WordPress Single Full Post On Front Page

#69594
olliekav
Member

Ah okay, sorry I should have posted up that code. So for the next previous links, I just use the function from the recent-posts to create the link in the header…e.g.

Code:

For designate I altered the plugin like so…

Code:
function designate_stylesheet($use_ids = false) {
global $post;

if (is_home() && have_posts() || is_single() || is_page()) {
$custom = get_post_meta($post->ID, ‘stylesheet’, true);

if ($custom && strlen($custom) > 0) {
$slug = preg_replace(‘/.css$/’, ”, $custom);
} elseif ($post->post_name && !$use_ids) {
$slug = $post->post_name;
} else {
$slug = ‘post-style-‘ . $post->ID;
}

if (strlen($slug) > 0) {
$location = “/post-styles/$slug.css”;

if (file_exists(WP_CONTENT_DIR . $location)) {
printf(
nn”,
content_url($location)
);
}
}
}
}

add_action(‘wp_head’, ‘designate_stylesheet’);

function designate_javascript_library($use_ids = false) {
global $post;

if (is_home() && have_posts() || is_single() || is_page()) {
$custom = get_post_meta($post->ID, ‘javascript_library’, true);

if ($custom && strlen($custom) > 0) {
$slug = preg_replace(‘/.js$/’, ”, $custom);
} elseif ($post->post_name && !$use_ids) {
$slug = $post->post_name;
} else {
$slug = ‘post-javascript-‘ . $post->ID;
}

if (strlen($slug) > 0) {
$location = “/post-js/$slug.js”;

if (file_exists(WP_CONTENT_DIR . $location)) {
printf(
nn”,
content_url($location)
);
}
}
}
}

add_action(‘wp_head’, ‘designate_javascript_library’);

function designate_javascript($use_ids = false) {
global $post;

if (is_home() && have_posts() || is_single() || is_page()) {
$custom = get_post_meta($post->ID, ‘javascript’, true);

if ($custom && strlen($custom) > 0) {
$slug = preg_replace(‘/.js$/’, ”, $custom);
} elseif ($post->post_name && !$use_ids) {
$slug = $post->post_name;
} else {
$slug = ‘post-javascript-‘ . $post->ID;
}

if (strlen($slug) > 0) {
$location = “/post-js/$slug.js”;

if (file_exists(WP_CONTENT_DIR . $location)) {
printf(
nn”,
content_url($location)
);
}
}
}
}

add_action(‘wp_head’, ‘designate_javascript’);

function designate_typekit($use_ids = false) {
global $post;

if (is_home() && have_posts() || is_single() || is_page()) {
$custom = get_post_meta($post->ID, ‘typekit’, true);
if ($custom && strlen($custom) > 0) {
printf(

nn”
);
}
}
}

add_action(‘wp_head’, ‘designate_typekit’);

?>

Hope that helps.