Pobranie nazwy, linku do strony przez ID
—
<?php echo get_the_title(332); ?> <?php echo esc_url(get_permalink(332)); ?> <a href="<?php echo esc_url( get_permalink( get_page_by_title( 'Monthly Events' ) ) ); ?>"><?php esc_html_e( 'Monthly Events', 'textdomain' ); ?></a>
—
pobranie linku i tytułu jako urlencode do share fb:
<div class="share-box"> <!-- get page title, url, share mail text --> <?php $pageTitle = get_the_title(); ?> <?php $pageUrl = get_permalink(); ?> <?php $mailText = get_field('mail_share_text', 'option'); ?> <?php $permalink_encoded = urlencode( get_permalink() ); ?> <?php $post_title = urlencode( get_the_title() ); ?> <!-- share link --> Share to: <a href="http://twitter.com/intent/tweet?status=<?php echo $pageTitle; ?>+<?php echo $pageUrl; ?>" target="_blank">Twitter</a> <a href="http://www.facebook.com/sharer.php?u=<?php echo $permalink_encoded; ?>&t=<?php echo $post_title; ?>" target="_blank">Facebook</a> <a href="mailto:?subject=<?php echo $pageTitle; ?>&body=<?php echo $mailText; ?> <?php echo $pageUrl; ?>">Email</a> <!-- end share link --> </div>
—
Hope this helps and happy coding :)