Wordpress - display-posts shortcode plugin has nextgen shortcode issue - php

I am using the plugin display-posts http://wordpress.org/support/plugin/display-posts-shortcode
which lets me display all posts (venues) from a particular category on a page, rather than just using a category.
(This is so that I can in a higher up area of my website use the child-pages shortcode plugin to display a list of these pages (locations), as there seems to be no plugin available to display categories with a thumbnail chosen from one of its posts.)
The problem I am having is that I can set a featured image and text in the post to get pulled into this listing of posts page, but my nextgen gallery shortcode which I am using to display a selection of thumbnails for each venue within the post, is being displayed as plaintext and not activating the shortcode.
If I directly view the post on its own then the shortcode is working fine and the thumbs appear, I presume its something to do with using a shortcode within something already being generated by a shortcode?
This happens whether I am using include_excerpt="true" and manually placing the shortcode in the excerpt box as well as the main content area, or if I use include_content="true".
My shortcode in my page to pull in these posts is
[display-posts category="ayia-napa" order="ASC" orderby="title" include_excerpt="true" include_content="true"]
My shortcode for nextgen sat in individual post is
[ngg_images gallery_ids="1" display_type="photocrati-nextgen_basic_thumbnails"]
I'm not sure if the problem is specific to the plugin/code I am using or whether Wordpress has this problem in general.
I have followed advice online to include an add_filter in my functions.php file for showing shortcodes within excerpts but this doesn't seem to be working.
Thanks
Cathy

Related

How to place featured image below post title

I found this solution to getting the featured image to default below the post title.
wordpress add featured image below post title
Where do I place this php?
Will it work for all posts?
Please have a look at the wordpress template hierarchy in themes:
https://developer.wordpress.org/themes/basics/template-hierarchy/
You can edit the look of single post views inside the single.php, if using a custom post type single-{post-type}.php. If you are using a theme that is not made by yourself and might get updated, make sure to use a child theme, so your changes will not be overwritten when the parent theme is getting updated.
This is a nice tutorial for creating child themes in wordpress:
https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/
In the template file you get the featured image with get_the_post_thumbnail() function and the post title with get_the_title() function.
Search for the lines in the code, where you can find the functions and change the location to your desired place. Or if there is no featured image, you can add the code you already found.
Where do I place this in php?
Inside of the single page template of your theme.
Will it work for all posts?
If you use the single.php file, yes. All posts use this template. But you can only apply the changes to specific post types as described above - if you like to. You can also make it work for some specific category terms with category-{term}.php or maybe you want to change the post listing in your archive.php. Please check the link above, Wordpress Template Hierarchy will make this clear, very easy to understand.
Hope this helps!

How to render a Wordpress blog list to display below WP Bakery content

I am using the WP Bakery Page Builder plugin. On one of my pages, I am using this plugin to create a title along with some text. I then changed the template to a Blog template, when previewing my changes I can see my posts displaying correctly however the title and paragraph built with the page builder is showing underneath the blog posts.
How can I change this, as I am unable to see the code for where the blog posts pull in within WP Admin.
Created a copy of the grid.php file and moved the code that creates a loop to change where the code is being rendered.

How to add dynamic content using ACF on a taxonomy listing?

I'm going to excuse myself for not adding any code to this question, but there is no need for that because my whole code works fine. My problem is explained next.
I've made a template called template-listing-products.php for displaying posts from a custom post type called products, which is being used by a page in my WordPress website. In that page I have slideshow where I load images into it using ACF(Advanced Custom Fields) and list all the custom post type taxonomies names with links.
When I click a custom post type taxonomy from that page it redirects me to the template called taxonomy-products.php where I have the posts from that taxonomy. My problem is how to use ACF to add dynamic content to those pages? Like the slideshow where I have a page.
UPDATE: Problem solved.
I already had a repeater to add images for the slideshow on every taxonomy and I didn't understood why it's not appearing on every category/subcategory in admin. I updated ACF and now works. Maybe this will help someone else.
Ok. So I will answer my own question.
Problem solved.
I already had a repeater to add images for the slideshow on every taxonomy and I didn't understood why it's not appearing on every category/subcategory in admin. I updated ACF and now works. Maybe this will help someone else.

WordPress: 3.5+ Attach Gallery To Post and Use Template Tag

Just wonder if WordPress 3.5+ still attach gallery even if it is not added to the post content area.
Earlier WordPress was adding gallery as an attachment and allowing to populate via template tag even if it is not added to the content area. Now with version 3.5.1 I am trying to create a gallery and it is displaying if I add to the post content but as soon as I remove from the post content than gallery just disappear from the media library as well and there is no attachment found for the post.
Just wonder and trying to understand how they have changed the media library and gallery. I understand the basic that before they were creating a gallery id but now they are adding only image id so there is no more gallery id. Is that correct?
So question how can I add gallery using template tag something like <?php echo do_shortocode('[gallery link="file"]'); ?> or similar?
You have almost answered this question yourself!
Check the codex for the specifics.
I needed to do this with with a custom meta box and the details can be found here. Pre-Select Images when opening WordPress 3.5 media manager.
EDIT:
For the benefit of other readers and for clarification, something like this is required
echo do_shortcode( '[gallery ids="139,138,137,136"]' );
Where the ids is a comma seperated list of attachment id's you want included. This is it in the simplest form - check the codex for more options.

How can my website show only links of posts in wordpress and one feature article?

I looked in documentation but have no clue. My goal is that the main div should contain a featured post I choose and under a set of catgeories in a div, it should display links to posts that include a certain tag. HELP?
You can create a custom page template that outputs the posts as you described using custom queries, create a page that uses this template, then set your site's home page to be this page.

Categories