Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • What was the solution to your problem?

    Thread Starter agustealo

    (@agustealo)

    OK guys I figured it out, so like I mentioned I am a designer so this might be an amatuer mistake but here is the solution for anyone else that might be facing the same issue.

    Instead of calling the <?php the_excerpt(); ?> I echo it instead <?php echo get_the_excerpt(); ?>.

    Works like a charm, alternatively you can format your own by copying the excerpt function from the /wp_includes/formatting.php file and place it into your function file. Modify it to suit your theme.

    Below is the line of code I used in my index.php

    <?php if ( have_posts() ) : ?>
    
    <?php if (is_home()) { query_posts("cat=-5");} ?>
      <?php while ( have_posts() ) : the_post(); ?>
      <?php if (function_exists('has_post_thumbnail')): if (has_post_thumbnail()):?>
    
    <div class="column-wrap clearfix">
    <div class="column">
          <a  class="caption" href="<?php the_permalink(); ?>"
              title="<?php the_title_attribute(); ?>"
              data-title="<?php the_title(); ?>"
              data-description="<?php echo get_the_excerpt(); ?>" >
    
    <?php the_post_thumbnail(array(301,301)); ?>
                                    </a>
    <?php endif; endif; ?>

    Such a simple fix for a big problem. I guess I answered my own question, not too bad for an amatuer ??

    I hope someone else find this useful.

    Thread Starter agustealo

    (@agustealo)

    I think you missed my previous post but I now have a clear understanding of what’s going on. The problem is the method i’m using to achieve my style effect.

    Pulling my data straight into the anchor also place all the html formatting of that data including any plugins attached. This is what’s causing things to break, and why the share plugin react the way it does because it’s link to my excerpts.

    Now what I really want is a way to strip everything from my excerpt (even the <p> tag) except the actual excerpt info. I want a way to do this without affecting a global change.

    Thread Starter agustealo

    (@agustealo)

    I think it was a plugin issue I deactivate all my plugins and it all went away.

    I believe the culprit to be the WordPress Jetpack Share plugin. I reactivate all other plugins and kept it off and everything looks great.

    Although I found the problem I know there is a way this should work. This is a WordPress friendly plugin so i’m sure there is a better way to achieve what i’m trying to do.

    Any suggestions would greatly be appreciated, I am a designer by trade just worked with enough programmers to understand the basics.

    Here is a HTML output example for the anchor

    <a
    class=?"caption" href=?"http:?/?/?www.agustealo.com/?sam-wpap-design/?" title=?"SAM WPAP DESIGN" data-title=?"SAM WPAP DESIGN" data-description=?"
    <div class="sharedaddy sd-sharing-enabled">?
    </a>?

    The share plugin inserts a div tag right before the end of the anchor <div class=” sharedaddy sd-sharing-enabled”>??, and throw the img tag out of the anchor. I’m not sure if this is separate from the ” > render, but it looks to be related.

    *Edit

    This is what it looks like with share off.

    <a
    class="caption" href="https://www.agustealo.com/sam-wpap-design/" title="SAM WPAP DESIGN" data-title="SAM WPAP DESIGN" data-description=""
    >
    <img
    width="301" height="301" src="https://www.agustealo.com/wp-content/uploads/2013/06/Sam-320x320.jpg" class="attachment-301x301 wp-post-image" alt="Sam"
    >
    </a>
    Thread Starter agustealo

    (@agustealo)

    No php error at all, take a look

    https://www.agustealo.com

    It is next to the lower left corner of each image.

    Thread Starter agustealo

    (@agustealo)

    Thanks wpfan1000 I hate syntax errors, here is the entire loops snippet.

    Still no luck.

    <?php if ( have_posts() ) : ?>
    
    <?php /* Start the Loop */ ?>
    
    <?php if (is_home()) { query_posts("cat=-5");} ?>
    	<?php while ( have_posts() ) : the_post(); ?>
    		<?php if (function_exists('has_post_thumbnail')): if (has_post_thumbnail()):?>
    
    	<div class="column-wrap clearfix">
    	<div class="column">
    
            <a  class="caption" href="<?php the_permalink(); ?>"
                        title="<?php the_title_attribute(); ?>"
                        data-title="<?php the_title(); ?>"
                        data-description="<?php the_excerpt(); ?>" >
    
    	<?php the_post_thumbnail(array(301,301)); ?>
            </a>
    
    <?php endif; endif; ?>
    Thread Starter agustealo

    (@agustealo)

    Ok so after going through the WP Codex I found this simple solution.

    Here it is for anyone else facing the same scenario.

    The original call for menu is

    <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>

    and it outpost

    <div class="">
    <ul id="" class="">
      <li id="" class="">
        <a href="#">Page Name</a>
          </div>

    I add a few lines to wp_nav_menu array to achieve a little more styling freedom of my menu.

    <?php wp_nav_menu( array( 'theme_location' => 'main-menu', 'link_before' => '<span class="icon"><i aria-hidden="true" class="icon-home"></i></span><span class="MenuName">', 'link_after' => '</span>' ) ); ?>

    Outputs

    <div class="">
      <ul id="" class="">
         <li class="">
           <a href="#">
             <span class=""> … </span>
               <span class="">Page Name</span>
            </a>
            </div>

    To get even more customization and control of your menu’s html output, look into WP Walker Class inside the Codex.

    I’m a designer and just getting familiar with WordPress so not sure if this is the absolute best way to do this but it worked for and I hope it’ll help someone else.

    Thread Starter agustealo

    (@agustealo)

    Thanks for your fast reply, but although I’m using a TidyTheme what I’m trying to accomplish isn’t necessarily BlankSlate specific.

    I guess I would like to know how to have a better control of styling the Menu Item in WordPress not only for BlankSlate. I’m just happen to be using BlankSlate.

    If someone has the answer to this I’d rather it be posted here for others to see. Your site requires registration, sorry but my inbox is filled with junk mail from sites I registered to for one reason or another.

Viewing 8 replies - 1 through 8 (of 8 total)