Assuming you are using module 1, you would edit your includes/modules/td_module_1.php file.
Find the section of code that looks like this(mine starts at line 49):
if ($this->show_excerpt === true) { //module 7 uses this
$buffy .= '<p>' . $this->get_excerpt(td_util::get_option('tds_' . 'mod7_content_excerpt')) . '</p>';
$buffy .= '<div class="more-link-wrap wpb_button td_read_more clearfix">';
$buffy .= '<a href="' . $this->href . '">' . __td('Continue', TD_THEME_NAME) . '</a>';
$buffy .= '</div>';
} else {
$buffy .= $this->get_content();
}
$buffy .= '<footer class="clearfix">';
$buffy .= $this->get_post_pagination();
$buffy .= $this->get_review();
$buffy .= $this->get_the_tags();
$buffy .= $this->get_source_and_via();
$buffy .= $this->get_social_sharing();
$buffy .= $this->get_next_prev_posts();
$buffy .= $this->get_author_box();
$buffy .= '</footer>';
and replace it with this:
if ($this->show_excerpt === true) { //module 7 uses this
$buffy .= '<p>' . $this->get_excerpt(td_util::get_option('tds_' . 'mod7_content_excerpt')) . '</p>';
$buffy .= '<div class="more-link-wrap wpb_button td_read_more clearfix">';
$buffy .= '<a href="' . $this->href . '">' . __td('Continue', TD_THEME_NAME) . '</a>';
$buffy .= '</div>';
} else {
$buffy .= $this->get_content();
$buffy .= $this->get_author_box();
}
$buffy .= '<footer class="clearfix">';
$buffy .= $this->get_post_pagination();
$buffy .= $this->get_review();
$buffy .= $this->get_the_tags();
$buffy .= $this->get_source_and_via();
$buffy .= $this->get_social_sharing();
$buffy .= $this->get_next_prev_posts();
$buffy .= '</footer>';
Ok, I’m sorry I didn’t pick up on the fact that you are trying to do this from the Theme Panel.
There is no way for you to change that in the Theme Panel(or anywhere in the wordpress admin). That is something that requires modification of the theme itself. The theme does not have an option for you to choose where to put the author box.
The instructions that I gave are for modifying the files that exist on your server.
are you using the child theme?
I’ve got to head out for about an hour. I can help more when I get back.
Just to clarify on what I’m looking for, I’ve made a mockup:
http://www.thisisanfield.com/wp-content/uploads/moveauthorbox.png
That’s based on this post:
http://www.thisisanfield.com/2014/02/can-liverpool-end-seven-year-arsenal-jinx/
Well, as far as I can tell you are using module 1, which is the default module for single posts.
If that is true then making the edits that I suggested in wp-content/themes/Newspaper/includes/modules/td_module_1.php would do exactly what you want. How are you editing these files?
One way we can check to see what module is being loaded is to echo the variable.
On line 94 of your single.php file change <?php to <?php echo $loop_module_id;
Then, just inside the container div on your post you should see a single digit and that is the module number that is being called.
Got it.. okay, here’s where we’re at.
Your original method DID work. However, because there is an advert and our social media icons plugin in between the bottom of the post and the author box, it didn’t show any differently. I just moved $buffy .= $this->get_author_box(); above the content, and the box appeared above. So your method did work afterall.
However, I need a way to get that author box above the social media icons plugin and the advert, effecively taking priority as the very first thing after the post content.
Any ideas?! Thank you for your help.
Ahh, the plot thickens…
Most likely your social plugin is using add_filter() to add their output to the end of the_content();
In that case, I think you would you would need to do something like this in your functions.php
// Filter the_content BEFORE the plugin does, this is by setting the priority argument, which is represented by the X. Need to make sure that number is higher than the one that the plugin uses to add their filter
add_filter( 'the_content', 'my_td_authorbox', X );
function my_td_authorbox($content){
// Not sure if $this will work in this context, just have to see.
$content .= $this->get_author_box();
return $content;
}
Yeah, the_content() doesn’t understand $this->get_author_box().
Does this work?
function my_td_authorbox($content){
global $post;
$content .= get_author_box($post->ID);
return $content;
}
In that case, perhaps a different approach. Add your own hook and change the plugin to call later
In your td_module_1, you could add a hook. Change $buffy .= $this->get_content();
To this:
$buffy .= $this->get_content();
my_after_content_hook($buffy);
Then in your plugin files, you need to find the add_filter( 'the_content', 'the_plugin_function_name', $priority); and change it to add_filter( 'my_after_content_hook', 'the_plugin_function_name', $priority);
-
This reply was modified 12 years by
webmaster808.
-
This reply was modified 12 years by
webmaster808. Reason: Need to modify $buffy with the filter, not $content
That probably won’t work though, because the plugin is most likely coded to return $content and not $buffy…
That’s all I got. Good luck!