Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter HuitZiloP

    (@huitzilop)

    Finally, I got this little guy to run the way I wanted. I want to thank Alleister, MichaelH and Otto for being such a great help during the process. Keep up the gret work guys, thanks again!

    Thread Starter HuitZiloP

    (@huitzilop)

    Still no luck. Now it shows only in single posts, but got back to the beginning of each post. I’m about to give up, this can’t be so hard. Thanks a lot for the support though!

    Thread Starter HuitZiloP

    (@huitzilop)

    Aleister, thank you very much for your inmense help. I’ve managed to make the plugin work the way you told me, but it still displays at the home, how do I limit it to displaying just in single posts? Would you mind if I email you my code so you can take a look at it? Thanks a lot again!

    @michaelh Thanks a lot, I needed to replace the action for a filter indeed.

    Thread Starter HuitZiloP

    (@huitzilop)

    Hi Aleister, thank you very much for your helpful answer. I managed to make it work, however, I still have trouble controlling this little buddy, because it appears at the beggining of each post and not at the end, which is where I want it to appear. It also appears at the fornt page, but I want to display it just in single posts, how can it be done? Here’s a sample of what I’ve done so far:

    function my_link($content)
    {
    echo "<h2>Some text<h2>";
    	$my_url = '<a href="https://www.google.com/"</a>';
    	print $my_url;
    
    return $content;
    }
    
    add_action ( 'the_content', 'my_link' );

    I thank you very much for your help and hope you can help me again, I’m kind of green with programming. Thanks a lot again buddy!

    EDIT: Oh and how can I add h2/general html tags without using print or echo? I seem to be still getting valid code. Thanks a lot!

    Thread Starter HuitZiloP

    (@huitzilop)

    Hi Ben, thanks for your reply. When I use your first suggestion, I get the links listed exactly the way I want, but without the typical indent of a li element. Is there any way (only one I think of is CSS, but don’t know how to do it, kinda newb here) to give them that indent so they line up with my other li’s?

    Your other suggestion gives me weird mysql errors:

    Warning: join(): Bad arguments. in C:\server\www\blog\wp-includes\category.php on line 277
    
    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND post_type = 'post' AND post_status = 'publish'' at line 1]
    SELECT post_id, category_id FROM wp_post2cat LEFT JOIN wp_posts ON post_id = ID WHERE category_id IN () AND post_type = 'post' AND post_status = 'publish'
    
    Warning: Invalid argument supplied for foreach() in C:\server\www\blog\wp-includes\category.php on line 287
    # No categories

    Thanks a lot!

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