With inline posts shortcodes, is there a way to hide author, date, category? Also, is it possible for inline posts to open in a new tab? I can’t find the way to do it.
Thanks!
]]>I’m wondering if it’s possible to align an inline post in the right or left side of the post/page. For example, in the Expertly theme (example here) in the “Single Grid Post” section you can see that they have align the inline post in the left side of the post. How can I do the same?
]]>In the regular posts I have taken away the line with date and number of comments (link) and “top” link. However that line doesn’t disappear in the posts displayed in the static page where I use Inline Posts.
Does anyone know where I take that away?
]]>I am new in using WordPress as a CMS for my websites. I got stuck, so I’ve searched the internet for many hours, but cannot find an answer that works for me. So I will post it here.
My issue:
I have a page named ‘home’ which I set as front page via the built-in function. On this page I am showing some content (text). Underneath this content I want to show my posts (making it partially a blog page). The problem is that I do not know how to script this.
Below you will find my page.php file. I do not know what code to use at the location where I echo.
<?php get_header(); ?>
<div id="main">
<div id="mainLeft">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="hoofdItem">
<div class="hoofdItemContent">
<span class="hoofdItemContentTitel"><?php the_title(); ?></span><br />
<?php the_content(); ?>
</div>
</div><!-- end hoofdItem -->
<?php endwhile; ?>
<?php endif; ?>
<?php if (is_front_page()) : ?>
<div class="actieBanner">
Onze Acties
</div>
<?php echo 'This line will does echo! But what code to put here, in order to show my posts?'; ?>
<?php endif; ?>
</div><!-- end mainLeft -->
<?php get_sidebar(); ?>
<div class="clear"></div>
</div><!-- end main -->
<?php get_footer(); ?>
]]>When I use the GD star rating everything works great, though when I integrate single posts on a page with the plugin ” inline posts” & ” tab slides” it shows the same rating for all posts…
Here is where is fails: https://www.venuexperience.com/just-addresses/asia/kuala-lumpur
When displaying the posts in a category, everything works normal: https://www.venuexperience.com/category/addresses/venues-kuala-lumpur
Could anybody help me with this? I would love to layout the posts without the additional information header bar & tags.
Thanks,
Selmar
Here is an example of what happens on this page right here. If you go straight to the text and hover over it you will see that it becomes underlined. If you hover over the Post Title, and then just work your way down the page, you see that it stays showing the URL of the original post:
https://outsidervocals.com/alternative-indie/
And here is all the code that is in the inline page editor screen…..can someone please tell me if I took a character out I shouldn’t have? Thanks!
<?php
/*
Plugin Name: Inline Posts
Plugin URI: https://aralbalkan.com/wordpress/
Description: Allows you to include posts in pages (and in other posts). To include a post, just enter its ID in square brackets in the body of a page or another post (e.g., 42).
Version: 2.1.2.g
Author: Aral Balkan
Author URI: https://aralbalkan.com
*/
//
// Options/admin panel
//
add_option(‘inlineposts_title_tag’, ‘h2’, ‘The tag you want the titles of posts to appear in.’);
// Add page to options menu.
function addAdminPage()
{
// Add a new submenu under Options:
add_options_page(‘Inline Posts Options’, ‘Inline Posts’, 8, ‘inlineposts’, ‘displayAdminPage’);
}
// Display the admin page.
function displayAdminPage()
{
if (isset($_POST[‘inlineposts_update’]))
{
check_admin_referer();
// Update title tag
$titleTag = $_POST[‘inlineposts_title_tag’];
if ($titleTag == ”) $titleTag = ‘h2’;
update_option(inlineposts_title_tag, $titleTag);
// echo message updated
echo “<div class=’updated fade’><p>Inline Posts options updated.</p></div>”;
}
?>
<div class=”wrap”>
<h2>Inline Posts Options</h2>
<form method=”post”>
<fieldset class=’options’>
<table class=”editform” cellspacing=”2″ cellpadding=”5″ width=”100%”>
<tr>
<th width=”30%” valign=”top” style=”padding-top: 10px;”>
<label for=”inlineposts_title_tag”>Title tag:</label>
</th>
<td>
<input type=’text’ size=’16’ maxlength=’30’ name=’inlineposts_title_tag’ id=’inlineposts_title_tag’ value='<?= get_option(‘inlineposts_title_tag’); ?>’ />
The tag you want the titles of posts to appear in.
</td>
</tr>
<tr>
<td colspan=”2″>
<p class=”submit”><input type=’submit’ name=’inlineposts_update’ value=’Update Options’ /></p>
</td>
</tr>
</table>
</fieldset>
</form>
</div>
<?php
}
//
// Actual functionality
//
function includePosts ($content = ”)
{
// Get the Post IDs to include. Post IDs are in the form [nnn].
preg_match_all(‘/(?<=\\[\\[)\\d+?(?=\\]\\])/’, $content, $matches, PREG_PATTERN_ORDER);
// Create a table of contents for the top of the page.
$tableOfContents = ‘
$numMatches = count($matches[0]);
for ($i = 0; $i < $numMatches; $i++)
{
$titleTag = get_option(‘inlineposts_title_tag’);
$postId = $matches[0][$i];
$post = get_post($postId);
$linkToPost = ‘‘;
$postTitle = $post->post_title;
// Update the table of contents
$tableOfContents .= ‘
‘;
$postTitleText = “<$titleTag>$linkToPost$postTitle$anchorTag</$titleTag>”;
$postBodyText = ‘<p>’.format_to_post($post->post_content).'</p>’;
$text = $postTitleText. $postBodyText;
// Remove comments and any line breaks before the tags
// so that these don’t cause WordPress to insert extra
//
tags.
$content = preg_replace(‘/<!–.*?–>/’, ”, $content);
$content = str_replace(“\r\n[[“, ‘[[‘, $content);
// Replace the post placeholder with the actual post.
$content = str_replace(“[[$postId]]”, $text, $content);
}
$tableOfContents .= ‘
‘;
// Add top anchor
$content = ‘<p id=”top” />’.$content;
// Add the TOC if user requested it
$content = str_replace(“TOC“, $tableOfContents, $content);
error_log($tableOfContents);
return $content;
}
//
// Hooks
//
add_action(‘admin_menu’, ‘addAdminPage’);
add_filter(‘the_content’, ‘includePosts’, 1);
?>
]]>Thanks for your help.
John