• Resolved sringnan

    (@sringnan)


    I’m new to wordpress with very limited/low knowledge in coding,

    I’m trying to build a faq section,
    where I need to insert the post title, post date, author etc. in multiple places.

    Eg.

    1.How do i use (post title)
    A.Use this (page title) as instructed here (link) by (author)
    2.Where do i buy (post title)
    A.Buy (post title) from here (link).

    And I need this to be posted for all posts under a certain category,

    How do I accomplish this?

    Thank you

    • This topic was modified 3 years, 8 months ago by Yui. Reason: moved to fixing wordpress
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    You got to take a look at https://codex.wordpress.org/ for understanding various functions and hooks you can use to achieve your desired output.

    I am afraid what you are asking is extensive and can’t just be commented here.

    You gotta try something with your personal code then you could ask where you are stuck.

    Explore – the_title() for getting post title, get_the_author() for getting author name, get_permalink() for getting post URL functions. This will surely help.

    Thread Starter sringnan

    (@sringnan)

    Thanks. I completed the first part, For anyone looking for the same,

    I stumbled on PHP code snippets and used that and created a shortcode with php to show what I wanted in my faq sections,

    Now need some help in showing this faq to all my posts under one category.

    Regards

    Hello,

    You can use the hook to display your custom function after the primary content.

    Try with

    add_action('the_content','your_function_name', 10);

    Different themes provide their own hooks to add the data at any location of blog or page.

    Thread Starter sringnan

    (@sringnan)

    Yes, did it, it’s working now, thanks,

    • This reply was modified 3 years, 7 months ago by sringnan.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post Title inside content and Content to show only on specific categories’ is closed to new replies.