Forum Replies Created

Viewing 15 replies - 76 through 90 (of 106 total)
  • Plugin Contributor Patrick Jackson

    (@pjackson1972)

    @jpwilkinson, it looked like your question was going to get into a different topic, so I created a new post to address it.

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi JPWilkinson,

    Are your Testimonials added as custom post types? If so, then we should be able to handle that by using the post_type attribute.

    For example, the Testimonials post type slug for IvyCat’s testimonials plugin is “testimonials”, so a shortcode for listing all of the testimonials would look like

    [ic_add_posts post_type="testimonials"]

    If you need to filter on a testimonial category, then you MAY be able to use the category attribute if the custom post type is actually set up to use the same category used by posts. In that case, the shortcode would look like

    [ic_add_posts post_type="testimonials" category="Category1"]

    It’s likely that your custom post type will actually use a custom taxonomy to group testimonials. As an example, IvyCat’s plugin uses a custom taxonomy called “Testimonial Groups” to group testimonials.

    In this case, you can filter the list by adding 2 attributes that work together: taxonomy, and term. The slug for IvyCat’s Testimonial Groups taxonomy is “testimonial-group”, and the term is the slug of the group that you created. We’ll call it “term1”.

    So, a shortcode listing the term1 testimonial group using IvyCat’s plugin would look like the following.

    [ic_add_posts post_type="testimonials" taxonomy='testimonial-group' term='term1']

    Does any of that help at all? ??

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi paulwalker,

    I posted a solution to @ysan’s related question that may work for you.

    To do something similar with Categories instead of Tags, you’ll want to use the has_category() function instead of the has_tag function.

    This changes our if-statement to look like the following. Add this to the top of the template….

    <?php if ( has_category('Category1') && has_category('Category2') ) { ?>

    … and close with the curly bracket at the bottom of the template….

    <?php } //if has Category1 & Category2 ?>

    Here’s the full updated template:

    <!-- NOTE: If you need to make changes to this file, copy it to your current theme's main
    	directory so your changes won't be overwritten when the plugin is upgraded. -->
    
    <?php if ( has_category('Category1') && has_category('Category2') ) { ?>
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post">
    	<!-- This is the output of the post TITLE -->
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    	<!-- This is the output of the EXCERPT -->
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div>
    
    	<!-- This is the output of the META information -->
    	<div class="entry-utility">
    		<?php if ( count( get_the_category() ) ) : ?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<?php
    			$tags_list = get_the_tag_list( '', ', ' );
    			if ( $tags_list ):
    		?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    		<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    	</div>
    </div>
    <!-- // End of Post Wrap -->
    <?php } //if has Category1 & Category2 ?>

    Let me know if that helps at all! ??

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi ysan,

    Yes, as you’ve discovered, there are a number of use cases that the plugin doesn’t support right now. This includes a variety of logical expressions. For example, we don’t really have a way to express how to combine categories and tags using AND or OR operators.

    I’ve submitted a feature suggestion to add more expression into the shortcode, so hopefully we’ll be able to free up some time to work on the plugin and see some added features coming down the pipe soon!

    In the mean time, the simplest solution I can think of off hand — and there are drawbacks to this — would be to add a filter in the template. Basically, you’ll use the shortcode to get a larger list of results from the database than you want, then add a bit of code to the template to filter out the ones you don’t want.

    The drawbacks to this are (1) a small efficiency loss due to dealing with extra posts, and (2) it may mess up pagination.

    To illustrate the second point, let’s say you want 5 posts per page. Your shortcode draws 5 posts from the database, but the template filters 4 of these posts out, leaving only 1 viewable post.

    With those caveats in mind, you might give this solution a try and see if it works, but may need to manage expectations.

    If you only want to allow posts that include both tag1 AND tag2, you’ll add an if statement that uses the has_tag() function.

    Add the following line above the line that says <!-- Start of Post Wrap -->

    <?php if ( has_tag('tag1') && has_tag('tag2') ) { ?>

    In English, this line says: if the post has ‘tag1’ and it has ‘tag2’ then include the following. You can use the tag slug or tag name in the parentheses.

    At the bottom of the template, after the <!-- End of Post Wrap --> line, close the if block with another curly bracket:
    <?php } //if has tag1 & tag2 ?>

    The entire updated template would look something like this…

    <!-- NOTE: If you need to make changes to this file, copy it to your current theme's main
    	directory so your changes won't be overwritten when the plugin is upgraded. -->
    
    <?php if ( has_tag('tag1') && has_tag('tag2') ) { ?>
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post">
    	<!-- This is the output of the post TITLE -->
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    	<!-- This is the output of the EXCERPT -->
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div>
    
    	<!-- This is the output of the META information -->
    	<div class="entry-utility">
    		<?php if ( count( get_the_category() ) ) : ?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<?php
    			$tags_list = get_the_tag_list( '', ', ' );
    			if ( $tags_list ):
    		?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
    			</span>
    			<span class="meta-sep">|</span>
    		<?php endif; ?>
    		<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
    		<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
    	</div>
    </div>
    <!-- // End of Post Wrap -->
    <?php } //if has tag1 & tag2 ?>

    I hope this helps! Let me know what you find in any case ??

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi TwilightTigers,

    It looks like you just need to play with the layout and styling a bit.

    What do you want the layout to look like, exactly? Do you want the featured image to be to the left of its title, excerpt, etc.; and for each post to be on its own row?

    You might start by adding a clear class to the outermost div for each post. That will ensure each post entry gets its own row.

    Your style sheet has a clear class defined that applies the clear:both property to its element. Adding this to the post wrapper div will clear any float properties applied between posts that are causing them to bunch up.

    ...
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post clear">
    	<!-- This is the output of the post TITLE -->
    ...

    If you want the image to always be left of the post’s title and excerpt, since the image is already floating left, you should be able to just move the image’s div higher in the content — above the title — so that everything that follows after it will be rendered to its right.

    ...
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post clear">
    
            <!-- This will output of the featured image thumbnail  -->
    	<div class="featured-image">
    	    <?php the_post_thumbnail( array( 180, 9999 ), array( 'class' => 'alignleft' , 'style' => 'border:5px solid white ; margin-right:5px ;' ) ); ?>
    	</div>
    
    	<!-- This is the output of the post TITLE -->
    	<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    
    	<!-- This is the output of the EXCERPT -->
    	<div class="entry-summary">
    		<?php the_excerpt(); ?>
    	</div>
    
    	<!-- This is the output of the META information -->
    ....

    Are we moving in the right direction with these changes?

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Okay, I loaded the rating plugin and did some testing, and it looks like you can add the shortcodes into the posts in page template.

    First, you need to create a custom output template as described in the FAQ under How do I change the output template.

    Then, you need to figure out where you want to add the rating content. I’ve added it under the excerpt below. Use a do_shortcodes statement to insert the rating shortcode.

    <!-- This is the output of the EXCERPT -->
    <div class="entry-summary">
        <?php the_excerpt(); ?>
        <?php echo do_shortcode("[display_rating_form]"); ?>
    </div>

    Does that help?

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi acjdesigns,

    Thanks for posting about this. Looks like a good ole fashioned bug to me.

    What permalink setting are you using?

    I did some testing, and it looks like when permalinks is set to the default (?p=xxx), the pagination links are inserting the page name into the URL. This is (probably) fine for most other permalink strategies, especially Post name, but invalid for the default setting.

    Since the URL is invalid, it triggers a 404 page not found error; and if there’s no page assigned to handle that error, the visitor is sent back to the home page instead.

    This looks like a pretty major bug, so I’ll dig deeper and see if I can come up with a patch. In the mean time, the only quick solution I can think of offhand is trying to use Post Name permalinks.

    Let me know if you find anything more!

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi Alin,

    I’m sorry you aren’t getting the behavior you’re looking for. I’ve replicated the issue, and am still trying to figure out the root cause.

    In the mean time, you can add another filtering step in your template to exclude any but the Page type posts.

    In your custom template, add the following line above the <!– Start of Post Wrap –> line:

    <?php if (get_post_type( get_the_ID() ) === 'page') { //if post_type is 'page' ?>

    And at the end of the template, close the if-statement:

    <?php } //if post_type is 'page' ?>

    Showing more of the template with the middle bits removed…

    <?php if (get_post_type( get_the_ID() ) === 'page') { //if post_type is 'page' ?>
    
    <!-- Start of Post Wrap -->
    <div class="post hentry ivycat-post">
    
    ...  the middle bits for laying out each post listed ....
    
    </div>
    <!-- // End of Post Wrap -->
    
    <?php } //if post_type is 'page' ?>

    Hope this helps! I’ll keep you posted if I learn more.

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    I doubt those will help in this case. There’s usually not much functionality in the index.php file for larger themes, and the style.css file won’t contain the PHP code I’d be looking for. The theme probably has a lot of files that contribute to its overall functionality, and — if there’s no documentation on the subject — we’d need to dig down to the bits of code responsible for storing and calling that media.

    At the end of the day, the theme either needs to provide a nice way to access the media in the form of an API (for programmers) or a shortcode (for designers).

    Barring that, I’d need to hack the theme a little bit, and look under the hood to find the names of the variables and functions they created, and figure out the right way to access them.

    Some things in the WordPress world are relatively easy to use because they’re well documented and intended to be shared and customized. While powerful additions, premium themes and plugins are often not intended to be customized, so it can mean extra work if you want to use them in a different way than originally intended.

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi adityab,

    I’m glad you were able to figure out how to customize the template for this plugin, that’s a big first step!

    Unfortunately, I’m not sure how much help I can be on the NEXT step. I don’t have the divi theme or access to their support forums, and I didn’t see much in the public documentation to tell me how to call that media from a template.

    If you’re using divi to manage your media in a post, then when it comes to accessing that media in a template, you’ll have to find out how divi wants you to retrieve it. Your theme may provide special functions (an API) or shortcodes that can help, and the Elegant Themes support team may help.

    What you’re looking for is code that would allow you to insert post media into a post loop in a custom template. You’ll need to be specific about how you’re attaching it to the post.

    If you happen to know of a shortcode that will do the trick, you can add a do_shortcode() statement to your plugin theme.

    I’m sorry I can’t be more help with this one, but good luck! Let me know what you find out, and if I can be of any more help.

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi antirich,

    I would need to know which rating plugin you’re looking at, and understand how it works to give specific advice.

    Generally, I suspect you’re going to need some custom programming to integrate a rating plugin with this one. This will probably involve creating a custom template as described here (How do I change the output template) and discussed here, and adding code that pulls the rating information for each post.

    I haven’t worked with any rating plugins myself, so I can’t advise you there.

    If you tell me what plugin(s) you’re looking at, I may be able to give you a little more advice.

    Thread Starter Patrick Jackson

    (@pjackson1972)

    Awesome! I’ll keep an eye out for the update

    Thanks Josh!

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    I’m glad to hear you got that resolved!

    I’m doing some formal testing on the plugin today, so hopefully we’ll update the official compatibility soon.

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi brinksa5man,

    Regarding the file showing as inactive, it sounds like you’re referring to WordPress’s built in plugin editor. My understanding is that the active/inactive label used in that case is really only valid if you’re editing the “main” plugin file. In this case that would be the posts_in_page.php file. If the plugin is active, and you go to edit that file, then it should show as active, while all other files in the plugin directory show as inactive. I don’t know what the purpose of this would be, other than to make sure you’re editing an inactive plugin, but I’d say you can safely ignore it.

    A word of advice: as a rule, it’s best to avoid editing plugins directly. Plugin authors often post updates, and those updates may overwrite your changes.

    In the case of this plugin, you can make a copy of the template file, place the copy in your theme directory, and add a “template” attribute to your shortcode with the name of the file. That way you can be sure your custom version of the template isn’t overwritten if the plugin is updated.

    [ic_add_posts template='post_loop_template.php']

    Moving on… you said you want to make the blog textareas transparent. Are you talking about the excerpts (the summary that shows for each blog)?
    Is this something you can do with CSS?
    If I wanted an easy way to make the excerpt go away, one option would be to add the following to the style.css file in your theme:

    .entry-summary {
        display: none;
    }

    Or if you really want it to be transparent, you can set the opacity:

    .entry-summary {
        opacity: 0.25; /* 25% opacity = 75% transparent */
    }

    Does any of that help?

    Plugin Contributor Patrick Jackson

    (@pjackson1972)

    Hi ontwerperij & phoenix_maximus,

    Yes, you can replace the default excerpt output with content output.

    You do this by creating a custom output template as described in the FAQ under How do I change the output template.

    Go to the posts-in-page plugin directory and copy the ?posts_loop_template.php file to your active theme directory. If you are using a child theme, you’ll need to add it to the parent theme.

    In your shortcode, add the following attribute: template=’?posts_loop_template.php’.

    Now you can safely edit your own copy of the template to make layout changes.

    Find the excerpt output section…

    <!-- This is the output of the EXCERPT -->
    <div class="entry-summary">
        <?php the_excerpt(); ?>
    </div>

    … and replace the_excerpt with the_content:

    <!-- This is the output of the CONTENT -->
    <div class="entry-summary">
        <?php the_content(); ?>
    </div>

    This should insert the entire content of your posts on the page.

    Let me know if that helps!

Viewing 15 replies - 76 through 90 (of 106 total)