What exactly do you mean by “the single link”? I suspect it will also be useful to know what theme you are using.
Its a custom theme.
With single link i mean the links to reach the single view.
you can check it here: http://www.pesch-partner.de/?page_id=275
They are added via css and that snippet:
<div id="linky">
<?php
$linksPosts = new WP_Query();
$linksPosts->query('showposts=7&cat=335');
?>
<?php while ($linksPosts->have_posts()) : $linksPosts->the_post(); ?>
<div class="boxy">
<div class="read">
<br>
<?php the_post_thumbnail( $size, $attr ); ?> <br><br>
<a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
<span class="newstext"> <?php the_content('Read the rest of this entry »'); ?></span>
</div>
</div>
<?php endwhile; ?>
</div>
Some of those posts should not have a link in the Title. And iam looking for a solution to add an option in the posts to disable a link in the title.
You can use a custom fields plugin like this one, then add an if statement to your template. A plugin is not strictly needed, but if you have no idea about these things, it will be much easier if you use a plugin.
If you use this plugin, you could create a true/false field with a field name such as no_link_to_single. Then you would edit the following line:
<a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
You could change it to something like this:
<?php
var_dump( get_field('no_link_to_single') );
if( get_field('no_link_to_single') ) { ?>
<h4><?php the_title(); ?></h4>
<?php } else { ?>
<a href="<?php the_permalink(); ?>"><h4><?php the_title(); ?></h4></a>
<?php } ?>
Thus, when the field is selected, no link will be shown. (I do not personally use this plugin. If you have any problems, make sure to read the plugin documentation.)
Wow its working!
Thank you so much!
Only small problem is that here is now a litte Text above the Link with
bool(false) or if activated with bool(true)
Can i somehow hide it?
ok nevermind i just got rid of that line
var_dump( get_field('no_link_to_single') );
you saved my day! thank you again
Sorry yes, I should have mentioned that var_dump is just a testing/debugging tool. Glad to see that you have worked everything out.