Link for the page archive for posts, like using custom post types with get_post_type_archive_link

I use a shortcode: function shortcode_article_list() { $posts_array = get_posts( array(‘posts_per_page’ => -1, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’) ); $output=”<ul>”; foreach ($posts_array as $post) { $a = explode(‘ ‘, $post->post_date); $output .= ‘<li><a href=”‘ . home_url(“https://wordpress.stackexchange.com/”) . $post->post_name . ‘.html”>’ . $post->post_title . ‘</a> (‘ . $a[0] . … Read more

Working Bootstrap Carousel Conversion to WP – Technical Questions

I had a similar situation recently, making a Bootstrap carousel dynamic. Here’s my functions.php code for that: //Images Slider function themename_slider_home_images_setup($wp_customize) { $wp_customize->add_section(‘home-slider-images’, array( ‘title’ => ‘Home Slider’, )); $wp_customize->add_setting(‘home-slider-first-image’); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, ‘home-slider-first-image’, array( ‘label’ => __( ‘First Image’, ‘theme_name’ ), ‘section’ => ‘home-slider-images’, ‘settings’ => ‘home-slider-first-image’ ) ) ); $wp_customize->add_setting(‘home-slider-second-image’); $wp_customize->add_control( new … Read more

Automatic Excerpt Not Working

It turns out my client added shortcodes to the beginning of the posts and the only thing I can think of is that the_excerpt was choosing what words to use from the content before stripping shortcode tags out, thus, returning a blank excerpt. Hope this helps someone in the future

get_page_by_title() not returning anything [closed]

You are missing the second parameter in get_page_by_title. See get_page_by_title() reference. When you are testing without explicitly specified $output and $post_type, this function returns the post of type ‘page’ object by default. So you have to return $page->post_parent for patient’s parent page ID: add_filter(‘gform_field_value_parent_id’, ‘parent_id’); function parent_id() { // three parameters here $page = get_page_by_title(‘TESTID’, … Read more

WordPress won’t save any post

Following advices from other contributors I’m posting here the “solution” for future reference, just in case someone is experiencing the same issues. As I wrote in one of the comments, while investigating the REST API problem – by the way, I’d have never narrowed it down without some help from @SallyCJ – I found out … Read more

Retrieving and Storing Images Linked from Other Domains on Local Server?

@Jan: The cache images plugin: http://blog.milandinic.com/wordpress/plugins/cache-images/ helped me with this, it does not on demand replace the links but rather goes through all links but basically does the same. One note on this: when I ran it on a small blog it worked pretty well. On another blog (http://edward.de.leau.net) it did a lot of posts … Read more

Alternate custom content in the loop

You could initialize a second counter variable that increments when your first counter variable increments, and use that with modulus to alternate your code blocks. First initialize two counter variables: <?php if (have_posts()) : $show_alternate = 1; $which_alternate = 1; while (have_posts()) : the_post(); ?> Then in your .pin-alternate-content output code you could do something … Read more