I would like to change the floating arrows on a post page to read "previous gallery" and "next gallery" instead of displaying as arrows. Can anyone help point me to the correct file and code snippet? Can I edit it in the WP-admin environment?
Denzel Chia answers:
Hi,
Open up functions.php using your wordpress admin theme editor.
find this <?php on the top of the file.
add the below codes after <?php
function remove_arrow(){
remove_action('thematic_navigation_above', 'autofocus_nav_above',2);
}
add_action('init','remove_arrow');
function new_autofocus_nav_above() {
global $afoptions;
foreach ($afoptions as $afvalue) {
if (isset($afvalue['id']) && get_option( $afvalue['id'] ) === FALSE && isset($afvalue['std'])) { $$afvalue['id'] = $afvalue['std']; }
elseif (isset($afvalue['id'])) { $$afvalue['id'] = get_option( $afvalue['id'] ); }
}
// Grab the ‘Blog’ category ID for exclusion from Next/Prev
$af_blog_catid = get_cat_ID($af_blog_cat);
if (is_single() && in_category($af_blog_catid)) { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav" style="font-size:18px">Previous Gallery</span>', 'thematic'), 1) ?></div>
<div class="nav-next"><?php next_post_link('%link', __('<span class="meta-nav" style="font-size:18px">Next Gallery</span>', 'thematic'), 1) ?></div>
</div>
<?php } elseif (is_single()) { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav" style="font-size:18px">Previous Gallery</span>', 'thematic'), 0, $af_blog_catid) ?></div>
<div class="nav-next"><?php next_post_link('%link', __('<span class="meta-nav" style="font-size:18px">Next Gallery</span>', 'thematic'), 0, $af_blog_catid) ?></div>
</div>
<?php } else { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav" style="font-size:18px">Previous Gallery</span>', 'thematic')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('<span class="meta-nav" style="font-size:18px">Next Gallery</span>', 'thematic')) ?></div>
</div>
<?php } }
add_action('thematic_navigation_above', 'new_autofocus_nav_above', 2);
The above codes will add Previous Gallery and Next Gallery.
If you want to change of the size of the text, just change the font-size:18px to a bigger number!
See attached screenshot as evidence of changing arrows to link text.
Thanks.
Denzel
Sébastien | French WordpressDesigner answers:
go to the folder of your theme, open this file : tjematic-functions.php and replace at line 34
if (is_single()) { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav">←</span>', 'thematic')) ?></div>
<div class="nav-next"><?php next_post_link('%link', __('<span class="meta-nav">→</span>', 'thematic')) ?></div>
</div>
<?php } else { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">←</span>', 'thematic')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('<span class="meta-nav">→</span>', 'thematic')) ?></div>
</div>
<?php } }
with
if (is_single()) { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav">previous gallery</span>', 'thematic')) ?></div>
<div class="nav-next"><?php next_post_link('%link', __('<span class="meta-nav">next gallery</span>', 'thematic')) ?></div>
</div>
<?php } else { ?>
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">previous gallery</span>', 'thematic')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('<span class="meta-nav">next gallery</span>', 'thematic')) ?></div>
</div>
<?php } }