Image Problems
-
Hi there,
I have very limited coding experience (I took 1 class in college several years ago). So I understand the basics, but can’t seem to wrap my mind around the image issue. I read through the one post on it, and tried everything. Can you please help?
I copied the plugin code into my child theme and then tried adding the code suggested. Here’s what I have, could you possible copy it, add in the needed code, and the send the whole thing back?
I’d just love for images to appear as they do in the post, or at minimum a featured image. Also, I don’t know if mine is just showing an except, but if so I’d like the whole post to be displayed!
Thank you SO much!
*/
if ( !function_exists( ‘add_action’ ) )
wp_die( ‘You are trying to access this file in a manner not allowed.’, ‘Direct Access Forbidden’, array( ‘response’ => ‘403’ ) );if ( ! defined( ‘POSTSPAGE_DIR’ ) )
define( ‘POSTSPAGE_DIR’, plugin_dir_path( __FILE__ ) );if ( ! defined( ‘POSTPAGE_URL’ ) )
define( ‘POSTPAGE_URL’, plugin_dir_url( __FILE__ ) );require_once ‘lib/page_posts.php’;
class ICAddPostsToPage {
public function __construct( ) {
add_shortcode( ‘ic_add_posts’, array( &$this, ‘posts_in_page’ ) );
add_shortcode( ‘ic_add_post’, array( &$this, ‘post_in_page’ ) );
add_action( ‘admin_menu’, array( &$this, ‘plugin_page_init’ ) );
add_filter( ‘plugin_action_links_’. plugin_basename( __FILE__ ), array( &$this, ‘plugin_action_links’ ), 10, 4 );
}/**
* Add settings link on plugins page.
*/
public function plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
if ( is_plugin_active( $plugin_file ) )
$actions[] = ‘‘ . __( ‘ Help’, ‘posts_in_page’ ) . ‘‘;
return apply_filters( ‘post_in_page_actions’, $actions );
}/**
* Main shortcode
*
* @param array $atts An array of shortcode parameters. None required
*/
public function posts_in_page( $atts ) {
$posts = new ICPagePosts( $atts );
return $posts->output_posts( );
}/**
* Deprecated shortcode (routing to posts in page function now)
*
* @todo Remove this depreciated function.
*/
public function post_in_page( $atts ) {
return self::posts_in_page( $atts );
}/**
* Init plugin, add menu page, and setup hooks to load assets on the plugin options page
*/
public function plugin_page_init() {
if ( ! current_user_can( ‘administrator’ ) )
return;$hooks = array( );
$hooks[] = add_options_page( __( ‘Posts In Page’ ), __( ‘Posts In Page’ ), ‘read’, ‘posts_in_page’,
array( $this, ‘plugin_page’ ) );foreach ( $hooks as $hook ) {
add_action( “admin_print_styles-{$hook}”, array( $this, ‘load_assets’ ) );
}
}/**
* Enqueue plugin assets (scripts & styles)
*/
public function load_assets( ) {
wp_enqueue_style( ‘postpagestyle’, POSTPAGE_URL. ‘/assets/post-page_styles.css’ );
wp_enqueue_script( ‘postpagescript’, POSTPAGE_URL. ‘/assets/post-page_scripts.js’ );
}/**
* Plugin Settings page – includes view for the page
*/
public function plugin_page( ) {
require_once ‘assets/posts_in_page_help_view.php’;
}}
/**
* Instantiate the Plugin – called using the plugins_loaded action hook.
*/
function init_ic_posts_in_page( ) {
new ICAddPostsToPage( );
}add_action( ‘plugins_loaded’, ‘init_ic_posts_in_page’ );
The topic ‘Image Problems’ is closed to new replies.