Skip to content

Instantly share code, notes, and snippets.

View lawrencebrown's full-sized avatar
💭
Pizza

Lawrence Brown lawrencebrown

💭
Pizza
View GitHub Profile
@lawrencebrown
lawrencebrown / gets-array-and-echo.php
Last active March 21, 2020 18:47
Gets the_field and stores its arrays, then echo inserts them using square brackets.
<?php $button = get_field('name_of_field'); ?>
<a href="<?php echo $button['url']; ?>"
target="<?php echo $button['target']; ?>">
<?php echo $button['title']; ?>
</a>
@lawrencebrown
lawrencebrown / the-content-wp-linlk-pages.php
Created April 8, 2020 05:52
Wordpress the_content filed, page links at bottom of post
<div class="entry-content">
<?php
the_content();
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'larryworld' ),
'after' => '</div>',
) );
?>
</div>
@lawrencebrown
lawrencebrown / get_edit_post_link.php
Created April 8, 2020 06:32
Used at the bottom of posts for logged in users to edit
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'larryworld' ),
array(
'span' => array(