Jump to content
Sign in to follow this  
anvilmediainc

Help adding post category name to Continue Reading link?

Recommended Posts

anvilmediainc

I'd like to inject the category name into the "Continue Reading" link that follows posts excerpts. I'm in the PlatformBase template.postloop.php file looking at: <?php the_content(__('<p>Continue reading »</p>','pagelines'));?> I think I'm close to the right area...but I'm not sure what to change. Has anybody else done this? Basically I just want this to say "Continue Reading on [category name here]"

Share this post


Link to post
Share on other sites
cmunns

should work with something like this `the_content(__("Continue reading " . the_category('', '', false),'pagelines'));?>`

Share this post


Link to post
Share on other sites
anvilmediainc

I can't seem to be able to get this to work. I can see this in 4 different places in the template.postloop.php file of the base theme: `__('Continue Reading', 'pagelines'))` would the `. the_category('', '', false)` piece needed to get added to each of these? My php skills are very shaky...to put it lightly.

Share this post


Link to post
Share on other sites
bryan-hadaway

Forwarding to developers. Thanks, Bryan

Share this post


Link to post
Share on other sites
anvilmediainc

I saw in the 1.1.5 changelog: "Refinement - Excerpt Continue Reading Link" but can't tell what actually changed. Any details?

Share this post


Link to post
Share on other sites
makeylon

I'm interested in this as well. I'd like to do something similar, by adding the post title as part of the Continue Reading link. Any answers on this yet? I found the code:

<div class="post-excerpt">
	<?php the_excerpt(); ?>
	" title="<?php _e("View", 'pagelines');?> <?php the_title_attribute(); ?>">
	<?php e_pagelines('continue_reading_text', __('Continue Reading', 'pagelines'));?>  <span class="right_arrow"><?php _e('→', 'pagelines');?></span>
	
	<?php pagelines_register_hook( 'pagelines_loop_clip_excerpt_end', 'theloop' ); //hook ?>
	</div>[/code]

	
	I tried different variations such as:
	
	
[code]<?php e_pagelines('continue_reading_text', __('Continue Reading ' . the_title(), 'pagelines'));?> <span class="right_arrow"><?php _e('→', 'pagelines');?></span>
and:
<?php e_pagelines('continue_reading_text' . the_title(), __('Continue Reading ', 'pagelines'));?>  <span class="right_arrow"><?php _e('→', 'pagelines');?></span>

In both cases (and a couple others) I wound up seeing the output like this: Nature of the Euro Rally from $1.2900Continue Reading ?†’ It seems I can't figure out how to get it to print the "Continue Reading" before the output of the title. What I'm trying to get it to do is this: Continue Reading Nature of the Euro Rally from $1.2900 ?†’ So, any ideas anybody?

Share this post


Link to post
Share on other sites
catrina

Try this code:

<?php the_content("Continue Reading" . get_the_title('', '', false)); ?> <span class="right_arrow"><?php _e('?†’', 'pagelines');?></span>


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
makeylon

Whew. Just found this post again. Wish there was a way to find posts I've commented in. lol. Okay, so I'm not sure where to place that code, as it is the_content instead of the_excerpt. And should I insert that code someplace? Or replace some code with it?

Share this post


Link to post
Share on other sites
bryan-hadaway

You can subscribe to topics from the sidebar RSS link. The code placement referred to in this topic is: Appearance > Editor > template.postloop.php Or copied over to PlatformBase if you're using it. Thanks, Bryan

Share this post


Link to post
Share on other sites
makeylon

Yes, I know which file it goes into, just not where in the file to put it. Just added to the end? Replacing some specific text? Included inside some specific text? All I'm looking to do is add the title of the post to the "Continue Reading" link but it doesn't seem to be working for me. See above.

Share this post


Link to post
Share on other sites
Kate

Hey Mark, Didn't test the code, but Catrina's code: `<?php the_content("Continue Reading" . get_the_title('', '', false)); ?> <?php _e('?†’', 'pagelines');?>` would replace the_excerpt().

Continue Reading Nature of the Euro Rally from $1.2900 ?†’
This one looks close to what you want, no? Maybe I'm missing it... Have you checked out the WP codex? http://codex.wordpress.org/Customizing_the_Read_More

Share this post


Link to post
Share on other sites
makeylon

That didn't work. It wound up posting the entire content instead of just the title with continue reading. I have reserched that info, and am currently using a string replacement to get the desired effect, but that isn't a very good solution as it doesn't work exactly like I'd like. It also leaves a second Continue Reading on the home page excerpts. Ugh.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×